Open bradobro opened 6 months ago
I suspect the real culprit is the software creating the table, that if it had used single quotes for the default strings drizzle-kit
would have generated valid code.
But SQLite seems to allow--and preserve--this, which isn't likely to change quickly.
I wonder if there's a simple but robust workaround for this? Maybe generate code for strings with JSON.stringify(thestring);
?
For example:
const desiredString = 'sql`("base")`';
const jsonString = JSON.stringify(desiredString);
console.log(desiredString, jsonVersion);
// output: sql`("base")` "sql`(\"base\")`"
Summary: pulling schema from a local SQLite database creates schema statements that don't parse as TypeScript.
Example:
Environment:
Package Versions: "drizzle-kit": "^0.21.2" "drizzle-orm": "^0.30.10" "@libsql/client": "^0.6.0" "typescript": "^5.0.0"
Runtimes:
v21.7.1
1.1.8
OS/Hardware:
Recreating Here's a SQL to create a table that will cause some offenders: