Support parsing doubly quoted strings as identifiers#296
Open
garnacho wants to merge 1 commit intoasg017:mainfrom
Open
Support parsing doubly quoted strings as identifiers#296garnacho wants to merge 1 commit intoasg017:mainfrom
garnacho wants to merge 1 commit intoasg017:mainfrom
Conversation
766a498 to
f381ea1
Compare
Per https://www.sqlite.org/lang_keywords.html, SQLite supports identifiers expressed as strings surrounded between double quotes: $ sqlite3 SQLite version 3.52.0 2026-03-06 16:01:44 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open FILENAME" to reopen on a persistent database. sqlite> create table a("oh,boy!" TEXT); sqlite> pragma table_info(a); ╭─────┬─────────┬──────┬─────────┬────────────┬────╮ │ cid │ name │ type │ notnull │ dflt_value │ pk │ ╞═════╪═════════╪══════╪═════════╪════════════╪════╡ │ 0 │ oh,boy! │ TEXT │ 0 │ NULL │ 0 │ ╰─────┴─────────┴──────┴─────────┴────────────┴────╯ When identifiers are parsed as such, no escaping applies, i.e. backslashes don't affect the next character: sqlite> create table b("oh\tno\" TEXT); sqlite> pragma table_info(b); ╭─────┬─────────┬──────┬─────────┬────────────┬────╮ │ cid │ name │ type │ notnull │ dflt_value │ pk │ ╞═════╪═════════╪══════╪═════════╪════════════╪════╡ │ 0 │ oh\tno\ │ TEXT │ 0 │ NULL │ 0 │ ╰─────┴─────────┴──────┴─────────┴────────────┴────╯ Make sqlite-vec internal scanner handle these identifiers, so that the column names in a vec0 virtual table may have the same (reduced) limitations as any other SQLite table. Note: SQLite also implements similar support for single quoted strings to be handled as identifiers. This is done for compatibility with other SQL implementations rather than standard conformance, so it's perhaps a bit more dubious to support.
f381ea1 to
b9df189
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per https://www.sqlite.org/lang_keywords.html, SQLite supports identifiers expressed as strings surrounded between double quotes:
When identifiers are parsed as such, no escaping applies, i.e. backslashes don't affect the next character:
Make sqlite-vec internal scanner handle these identifiers, so that the column names in a vec0 virtual table may have the same (reduced) limitations as any other SQLite table.
Note: SQLite also implements similar support for single quoted strings to be handled as identifiers. This is done for compatibility with other SQL implementations rather than standard conformance, so it's perhaps a bit more dubious to support.