You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* drizzle-kit and push to d1-http failed
There are two reasons:
- d1-http don't support transactions with db.run("begin/commit/rollback")
- introspections run against some CF-D1 internal tables and fails later.
that could mitigated with a right tablesFilter: ['!_cf_KV'].
There was a incomplete mitigation in place which now includes _cf_KV
tables.
* chore: there are more _cf_ prefixed tables
* fix: Add escaping to sqlite pull queries
* should we pass-with-no-tests ??
* D P R I N T
* Add ci vitest config
* Bump kit, added release notes
---------
Co-authored-by: Roman <[email protected]>
Co-authored-by: AndriiSherman <[email protected]>
-[[BUG]: d1 push locally is not working](https://github.com/drizzle-team/drizzle-orm/issues/4099) - thanks @mabels and @RomanNabukhotnyi
4
+
-[[BUG] Cloudflare D1: drizzle-kit push is not working (error 7500 SQLITE_AUTH)](https://github.com/drizzle-team/drizzle-orm/issues/3728) - thanks @mabels and @RomanNabukhotnyi
m.name as "tableName", p.name as "columnName", p.type as "columnType", p."notnull" as "notNull", p.dflt_value as "defaultValue", p.pk as pk, p.hidden as hidden, m.sql, m.type as type
524
-
FROM sqlite_master AS m JOIN pragma_table_xinfo(m.name) AS p
525
-
WHERE (m.type = 'table' OR m.type = 'view')
526
-
and m.tbl_name != 'sqlite_sequence'
527
-
and m.tbl_name != 'sqlite_stat1'
528
-
and m.tbl_name != '_litestream_seq'
529
-
and m.tbl_name != '_litestream_lock'
530
-
and m.tbl_name != 'libsql_wasm_func_table'
531
-
and m.tbl_name != '__drizzle_migrations'
532
-
and m.tbl_name != '_cf_KV';
533
-
`,
534
-
);
533
+
}>(`SELECT
534
+
m.name as "tableName",
535
+
p.name as "columnName",
536
+
p.type as "columnType",
537
+
p."notnull" as "notNull",
538
+
p.dflt_value as "defaultValue",
539
+
p.pk as pk,
540
+
p.hidden as hidden,
541
+
m.sql,
542
+
m.type as type
543
+
FROM sqlite_master AS m
544
+
JOIN pragma_table_xinfo(m.name) AS p
545
+
WHERE (m.type = 'table' OR m.type = 'view')
546
+
AND ${filterIgnoredTablesByField('m.tbl_name')};`);
535
547
536
548
consttablesWithSeq: string[]=[];
537
549
538
550
constseq=awaitdb.query<{
539
551
name: string;
540
-
}>(
541
-
`SELECT * FROM sqlite_master WHERE name != 'sqlite_sequence'
`SELECT m.name as "tableFrom", f.id as "id", f."table" as "tableTo", f."from", f."to", f."on_update" as "onUpdate", f."on_delete" as "onDelete", f.seq as "seq"
690
-
FROM sqlite_master m, pragma_foreign_key_list(m.name) as f
691
-
where m.tbl_name != '_cf_KV';`,
692
-
);
697
+
}>(`SELECT
698
+
m.name as "tableFrom",
699
+
f.id as "id",
700
+
f."table" as "tableTo",
701
+
f."from",
702
+
f."to",
703
+
f."on_update" as "onUpdate",
704
+
f."on_delete" as "onDelete",
705
+
f.seq as "seq"
706
+
FROM
707
+
sqlite_master m,
708
+
pragma_foreign_key_list(m.name) as f
709
+
WHERE ${filterIgnoredTablesByField('m.tbl_name')};`);
0 commit comments