Commit f381ea1
committed
Support parsing doubly quoted strings as identifiers
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.1 parent 5778fec commit f381ea1
1 file changed
Lines changed: 57 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2072 | 2072 | | |
2073 | 2073 | | |
2074 | 2074 | | |
| 2075 | + | |
2075 | 2076 | | |
2076 | 2077 | | |
2077 | 2078 | | |
| |||
2157 | 2158 | | |
2158 | 2159 | | |
2159 | 2160 | | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
2160 | 2172 | | |
2161 | 2173 | | |
2162 | 2174 | | |
| |||
2263 | 2275 | | |
2264 | 2276 | | |
2265 | 2277 | | |
2266 | | - | |
| 2278 | + | |
| 2279 | + | |
2267 | 2280 | | |
2268 | 2281 | | |
2269 | 2282 | | |
2270 | | - | |
2271 | | - | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
2272 | 2290 | | |
2273 | 2291 | | |
2274 | 2292 | | |
| |||
2346 | 2364 | | |
2347 | 2365 | | |
2348 | 2366 | | |
2349 | | - | |
| 2367 | + | |
| 2368 | + | |
2350 | 2369 | | |
2351 | 2370 | | |
2352 | 2371 | | |
2353 | | - | |
2354 | | - | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
2355 | 2379 | | |
2356 | 2380 | | |
2357 | 2381 | | |
| |||
2418 | 2442 | | |
2419 | 2443 | | |
2420 | 2444 | | |
2421 | | - | |
| 2445 | + | |
| 2446 | + | |
2422 | 2447 | | |
2423 | 2448 | | |
2424 | 2449 | | |
2425 | | - | |
2426 | | - | |
| 2450 | + | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
2427 | 2457 | | |
2428 | 2458 | | |
2429 | 2459 | | |
| |||
2478 | 2508 | | |
2479 | 2509 | | |
2480 | 2510 | | |
2481 | | - | |
| 2511 | + | |
| 2512 | + | |
2482 | 2513 | | |
2483 | 2514 | | |
2484 | 2515 | | |
2485 | | - | |
2486 | | - | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
2487 | 2523 | | |
2488 | 2524 | | |
2489 | 2525 | | |
| |||
2998 | 3034 | | |
2999 | 3035 | | |
3000 | 3036 | | |
3001 | | - | |
| 3037 | + | |
| 3038 | + | |
3002 | 3039 | | |
3003 | 3040 | | |
3004 | 3041 | | |
3005 | | - | |
3006 | | - | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
3007 | 3049 | | |
3008 | 3050 | | |
3009 | 3051 | | |
| |||
0 commit comments