Trying to delete specific cookies from google chrome

Nice one; thanks.

Yes, I have almost the same; the difference being I have the quotes the other way around:

c.execute(f"SELECT * FROM '{table_name}'")

… the reason being, I seem to recall that SQL statements are case sensitive (on Linux systems, least ways) and although this is not SQL and will most likely never be ported to said, I feel it’s best to be in keeping with that format.

Thanks for the info and tips; I’ve learned more from this project than I expected to.

Edit: hummm, it’s just occurred to me, what I just typed “… case sensitive…” has nothing to do with the quotes. Lack of sleep is fogging my mind. :face_with_diagonal_mouth:

Attention, it is not like Python :slight_smile: The two quotes have different meaning in SQL!

'text' A text in single quotes is a string literal.
"text" A text in double-quotes is an identifier.

https://www.sqlite.org/lang_keywords.html

Keywords (like SELECT) and identifiers are case-insensitive in SQL.

In general there should not be differences depending on the platform the SQL is running on but there are differences between SQL dialects. It is good that SQLite tries to follow ANSI SQL.

Edit: In the citation from the SQLite documentation I changed the confusingly used word “keyword” for “text”.

3 Likes

IIRC, the SQL standard requires column and table names to be double-quoted, not single-quoted. SQLite will accept both forms, though, but such a query may fail with other database engines, so using double-quotes is good practice. Also note that string literals should be single-quoted. The latter is more important, since SQLite can be compiled with for example -DSQLITE_DQS=0.

3 Likes

My thanks to you both: so, that’s why I see the Table names, Field names and Data, all being returned in single quotes: makes perfect sense.

SQLite has its quirks. I often resort to this page when debugging sqlite3 stuff:

https://www.sqlite.org/quirks.html

3 Likes

Thank you all for contributing , i have a lot of work todo :grinning:

You are welcome. I hope you will like Python. You can start from the Python code here:

There I fixed my earlier bug pointed out by Erlend.

You will probably need to add just the DELETE SQL query but do not forget to call commit() before the end of the with block (context manager).

FTR, the stdlib sqlite3 extension module will come with a simple CLI starting with Python 3.12. This means you can run a basic SQLite CLI like this:

$ python3.12 -m sqlite3
1 Like