SQL Integration problems - error: SQL Query invalid

I am having problems reading my sqlite database. The query works, but when the same query is added in homeassistant it is suddenly invalid. The query for database size does work with the same database. That’s weird.

Error SQL Query invalid:

SELECT "temperature" AS value FROM "metrics" ORDER BY "datetime" DESC LIMIT 1;

Same Query in database:

Database size query:

The database was placed in the config folder, was recognised by sql integration, but the sql query was invalid. Only the problem was not the sql query, but the database url. It works now. The correct database url is: