@lobomfz/db 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/database.ts +4 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobomfz/db",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Bun SQLite database with Arktype schemas and typed Kysely client",
5
5
  "keywords": [
6
6
  "arktype",
package/src/database.ts CHANGED
@@ -365,8 +365,12 @@ export class Database<T extends SchemaRecord> {
365
365
  reset(table?: keyof T & string): void {
366
366
  const tables = table ? [table] : Object.keys(this.options.schema.tables);
367
367
 
368
+ this.sqlite.run("PRAGMA foreign_keys = OFF");
369
+
368
370
  for (const t of tables) {
369
371
  this.sqlite.run(`DELETE FROM "${t}"`);
370
372
  }
373
+
374
+ this.sqlite.run("PRAGMA foreign_keys = ON");
371
375
  }
372
376
  }