Commit 8bab075
committed
csv-table-name: reject invalid SQLite identifiers up front
.import interpolates the table name directly into a CREATE TABLE
statement, so passing something with a dash or a quote produced a
cryptic sqlite syntax error that the user had to decode. Validate
the name as a conventional unquoted SQLite identifier (letter or
underscore, then letters / digits / underscores) before invoking
sqlite3 so the message is actionable.
Closes the validation half of #810.
Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>1 parent 2e8610c commit 8bab075
1 file changed
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| |||
479 | 482 | | |
480 | 483 | | |
481 | 484 | | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
0 commit comments