lordbinbash
lordbinbash
DTDrizzle Team
Created by lordbinbash on 9/12/2024 in #help
Is it possible to use .map and batch?
const prepared = [1, 2, 3].map((id) => db.select().from(Users));

const batchDynamic = await db.batch(prepared); // TS Errors ❌
const batchStatic = await db.batch([db.select().from(Users)]); // Works ✅
const prepared = [1, 2, 3].map((id) => db.select().from(Users));

const batchDynamic = await db.batch(prepared); // TS Errors ❌
const batchStatic = await db.batch([db.select().from(Users)]); // Works ✅
1 replies
DTDrizzle Team
Created by lordbinbash on 7/10/2024 in #help
Conditional returning, returning wrong types
No description
16 replies
DTDrizzle Team
Created by lordbinbash on 7/10/2024 in #help
Any tips for using Drizzle without the schema declared via Drizzle syntax?
We are using Atlas for DB migrations, and therefore don't have the schema declared via Drizzle. Introspecting the DB has not been too accurate unfortunately. Some issues: BOOLEAN inferred correctly as numeric, could this be inferred as integer mode: "boolean"? (I think Prisma does this) Named foreign keys getting dropped. (not too important?) DEFAULT native => default("sql(native)"). UNIQUE constraints getting dropped (not too important?)
20 replies
DTDrizzle Team
Created by lordbinbash on 6/21/2024 in #help
Introspect poor accuracy (SQLite/Turso)
Is it just me or does introspect work pretty badly? A few examples: - Named foreign keys getting dropped. - DEFAULT native => default("sql(native)"). - UNIQUE constraints getting dropped
4 replies
DTDrizzle Team
Created by lordbinbash on 6/5/2024 in #help
How to access ROWID in SQLite queries?
Tried sqlrowid but to no avail
2 replies
DTDrizzle Team
Created by lordbinbash on 3/12/2024 in #help
Dynamic Batch w/Turso
No description
4 replies