Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datasette breaks on square brackets in table name #2431

Open
slavos1 opened this issue Sep 23, 2024 · 0 comments
Open

datasette breaks on square brackets in table name #2431

slavos1 opened this issue Sep 23, 2024 · 0 comments

Comments

@slavos1
Copy link

slavos1 commented Sep 23, 2024

First off, thanks for datasette. 🙏🏻

Checking Evolution's data, I've hit a snag with tables with names like [Gmail]/Inbox.

A minimal reproduction:

$ sqlite3 /tmp/slashes
SQLite version 3.45.1 2024-01-30 16:01:20
Enter ".help" for usage hints.
sqlite> create table "[foo]/bar" (a text);
Ctrl-D

$ datasette /tmp/slashes
Usage: datasette serve [OPTIONS] [FILES]...
Try 'datasette serve --help' for help.

Error: Connection to /tmp/slashes failed check: near "/": syntax error

$ datasette --version
datasette, version 0.64.8

Testing further, having only [...] fails with:

$ sqlite3 /tmp/slashes
SQLite version 3.45.1 2024-01-30 16:01:20
Enter ".help" for usage hints.
sqlite> create table "[foo]" (a text);

$ datasette /tmp/slashes
Usage: datasette serve [OPTIONS] [FILES]...
Try 'datasette serve --help' for help.

Error: Connection to /tmp/slashes failed check: unrecognized token: "]"

In summary:

Table name Works with datasette?
[foo]/bar no (failed check: near "/": syntax error)
[foo] no (failed check: unrecognized token: "]")
[foo yes
foo] no (failed check: unrecognized token: "]")
foo/bar yes

sqlite3 cli itself does not have problems with any names mentioned above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant