frectonz / sql-studio

SQL Database Explorer [SQLite, libSQL, PostgreSQL, MySQL/MariaDB, DuckDB, ClickHouse]
https://sql-studio.onrender.com/
MIT License
2.28k stars 59 forks source link

Tricky table name causes error #4

Closed MostAwesomeDude closed 3 months ago

MostAwesomeDude commented 3 months ago

I tried to use this with my SQLite database from one of my projects and got this error:

2024-06-16T23:41:39.610846Z ERROR sqlite_studio::handlers: error while getting database overview: Rusqlite("near "2": syntax error in SELECT count(*) FROM 2-categories at offset 21")

I think that this is caused by the table name 2-categories. It's legal but requires extra quotes. I confirmed this with the SQLite REPL:

sqlite> select count(*) from 2-categories;
Parse error: near "2": syntax error
  select count(*) from 2-categories;
                       ^--- error here
sqlite> select count(*) from '2-categories';
31
frectonz commented 3 months ago

Thanks for finding this bug, will fix it soon.

frectonz commented 3 months ago

Fixed in the latest issue.