jabh
jabh
DTDrizzle Team
Created by hirefrank on 4/22/2024 in #help
Creating a View with Turso/Sqlite
Hey, the docs say:
Views are currently only implemented in the drizzle-orm, drizzle-kit does not support views yet. You can query the views that already exist in the database, but they won’t be added to drizzle-kit migrations or db push as of now.
https://orm.drizzle.team/docs/views
2 replies
DTDrizzle Team
Created by jabh on 12/4/2023 in #help
bun:sqlite FindFirst returns an object with all values undefined
Will do, thanks! Is there any prefered online codespace I should submit with or just a codeblock?
8 replies
DTDrizzle Team
Created by jabh on 12/4/2023 in #help
bun:sqlite FindFirst returns an object with all values undefined
My intention is not to use the .get() or .all() but rather that they seem to be the underlaying functions being called and somewhere in the code for get in combination with bun:sqlite (i think) it breaks and I get an object with the correct keys but undefined values. For now this is my workaround to emulate the correct behaviour with findFirst
const user = await db.query.user
.findMany({
where: eq(userTable.username, username),
columns: {
id: true,
passwordHash: true,
firstName: true,
},
limit: 1,
})
.then((users) => users.at(0));
const user = await db.query.user
.findMany({
where: eq(userTable.username, username),
columns: {
id: true,
passwordHash: true,
firstName: true,
},
limit: 1,
})
.then((users) => users.at(0));
8 replies