Drizzle / ORM improvements

considering .all doesn't do any remapping, and both .all and .raw call the same /query endpoint - maybe using .all is the fix?
3 Replies
divby0
divby02y ago
Considering the "(we still need to figure out a fix for .raw on our side, but this might unblock y'all)" from @rozenmd and the ".all is still returning objects and not raw array of arrays. So it’s something d1 should fix firstly" from @Andrii Sherman , does that mean the cloudflare team is aware of this or do you still need more info or something?
elithrar
elithrar2y ago
@divby0 - re: other SQLite based integrations - do you not also run into this with (e.g.) libsql? By default you convert into an object, which would (necessarily) clobber any duplicate column names? https://github.com/drizzle-team/drizzle-orm/blob/474f1a3534446b8679c97eba43d0667900f9af45/drizzle-orm/src/libsql/session.ts#L175-L185
GitHub
drizzle-orm/session.ts at 474f1a3534446b8679c97eba43d0667900f9af45 ...
TypeScript ORM for SQL. Contribute to drizzle-team/drizzle-orm development by creating an account on GitHub.
elithrar
elithrar2y ago
Part of this is because SQLite does not expand column names per https://www.sqlite.org/pragma.html#pragma_full_column_names (deprecated!) - users are expected to AS alias names across a JOIN This doesn't mean we shouldn't expose a proper .raw() or .values() API that provides an array of arrays, but I don't think we're unique in that gap? The ORM will (necessarily) have to re-map back to fully-qualified column names.
Want results from more Discord servers?
Add your server