Readit News logoReadit News
lfconsult commented on Tracking SQLite Database Changes in Git   garrit.xyz/posts/2023-11-... · Posted by u/vldr
lfconsult · 2 years ago
Awesome...! Thanks for sharing!
lfconsult commented on Geospatial SQL queries in SQLite using TG, SQLite-tg and datasette-SQLite-tg   til.simonwillison.net/sql... · Posted by u/simonw
lfconsult · 2 years ago
Awesome! Another nice gift for the open source community. I'll try it out soon.
lfconsult commented on I'm fed up with it, so I'm writing a browser   adayinthelifeof.nl/2023/0... · Posted by u/jaytaph
thewrinklyninja · 2 years ago
just use Falkon. browser by the KDE team. free, open etc. https://www.falkon.org/
lfconsult · 2 years ago
Great, thanks for sharing!
lfconsult commented on Tell HN: ChatGPT Can Decode Base64    · Posted by u/Supply5411
lfconsult · 2 years ago
Does ChatGPT integrates basics known encoders/decoders aside from LLM (if not, I thought that it was the case)?

Base64 is about encoding not hashing... So decoding it is... natural. The point here is that it's integrated inside ChatGPT? It seems to me that it's an "obvious" "feature" kind of.

lfconsult commented on Ask HN: Is there is an sqlite3_expanded_SQL()'s equivalent for other DBMS?    · Posted by u/lfconsult
rawgabbit · 2 years ago
Not exactly what you are looking for. But SQL server has several ways to track queries. One is DMV. The other is the Query Store.

https://blog.sqlauthority.com/2010/05/14/sql-server-find-mos...

https://learn.microsoft.com/en-us/sql/relational-databases/p...

lfconsult · 2 years ago
Exact, it's not what I'm looking for but it's interesting anyway, thank you for your answer and the links.

It's a bit weird but I'm using a langage (for a specific project) where prepared statements aren't available (except if you pay or use a specific DBMS, I can't do both because the client won't pay and I need SQLServer).

My initial idea was to use a DLL from PDO (I'm developping on a Windows env) or whatever known piece of code that is trustable in order to sanitize user inputs (of course we do it client side but user is devil :-)) before sending it to SQLServer.

After all answers and my researches, I think that I'll use a tiers piece of code to escape queries (probably a C# program using SQLCommand).

Thanks all.

If anybody knows exactly how SQLServer is handling SQL Statements, please let us know.

lfconsult commented on Ask HN: Is there is an sqlite3_expanded_SQL()'s equivalent for other DBMS?    · Posted by u/lfconsult
Someone · 2 years ago
I think it’s likely that other databases do not keep the query string you sent it around but convert it into some internal structure.

Converting that back to the query string you sent may be impossible because that structure won’t record comments, line breaks, indents, escaped characters and the like.

Converting it to a query string that, when sent back, produces the same internal structure should be possible, but as user selecsosi wrote “Most of this I would expect to be more on the client side than server”.

lfconsult · 2 years ago
Thank you for your answer.

It makes sense.

I didn't catch the "client side" part as you do, thanks for the explanation.

lfconsult commented on Ask HN: Is there is an sqlite3_expanded_SQL()'s equivalent for other DBMS?    · Posted by u/lfconsult
lfconsult · 2 years ago
Side note: The result of sqlite3_expanded_sql() is a pointer to the string containing the SQL statement with bound parametrer(s):

"The string returned by sqlite3_expanded_sql(P) [...] is obtained from sqlite3_malloc() [...]"

From SQLite documentation: https://www.sqlite.org/c3ref/expanded_sql.html

lfconsult commented on Ask HN: Is there is an sqlite3_expanded_SQL()'s equivalent for other DBMS?    · Posted by u/lfconsult
yellow_lead · 2 years ago
MariaDB doesn't have one, I've searched before.
lfconsult · 2 years ago
Thank you for your answer.
lfconsult commented on Ask HN: Is there is an sqlite3_expanded_SQL()'s equivalent for other DBMS?    · Posted by u/lfconsult
selecsosi · 2 years ago
Not for sqlserver, but for postgres working w/ python, the psycopg library has a API for getting the bound parameter expression

https://www.psycopg.org/docs/cursor.html#cursor.mogrify

Most of this I would expect to be more on the client side than server (though w/ sqlite you are working w/ both)

lfconsult · 2 years ago
Thank you for your answer.

I'm still wondering why it's not available for SQLServer (because there are use cases for this feature).

It is "just" a matter of driver interface (I mean the piece of code that implement ODBC API) that "just" do not give this feature or it's letteraly not possible with SQLServer?

u/lfconsult

KarmaCake day11December 27, 2022
About
https://github.com/TeddyBear06
View Original