Access SQLite database from Python, no content

Hi All,
I can’t seem to connect to my sqlite database from within Python.

problem starts with the connection: I have tried various strings but only this is free from error messages (suggesting the connection is established i guess)

conn = sqlite3.connect(‘home-assistant_v2.db’)

However: i can’t reach any table in this database. It seems empty.

select * from events → error ’ no such table et cetera…’

What am I doing wrong here ?
Many thanks in advance,
Best regards,
H.

Although i can’t help you i will warn you: if you connect to HA sqlite database normally (with write possibility) then you’ll loose all history. Sqlite accepts only one connection at a time, so if you connect to it then HA can’t and it will assume corruption and create a new one. ( this is not the case with mariadb, though). Been there, done that.
Exception is if you connect “read only”, then it’s safe

Hi, thank you for that warning. Will keep it in mind. It has not occured yet , so i assume i haven’t got a working connection yet. So it must me something in the
connection string:
conn=sqlite3.connect(‘home-assistant_v2.db’

How does one make a connection read-only btw ? Isn’t that done at user level ? Depeninding on the user you may read/write read et cetera.
Best regards,
H.