jbrundagejr
jbrundagejr
Explore posts from servers
DTDrizzle Team
Created by jbrundagejr on 2/10/2025 in #help
db.query not updating
Hey all! I recently refactored my schema to take advantage of the findMany and findFirst functions. These are my collectionsTable relations:
export const collectionsRelations = relations(collectionsTable, ({ one }) => ({
author: one(usersTable, {
fields: [collectionsTable.authorID],
references: [usersTable.id],
}),
}))
export const collectionsRelations = relations(collectionsTable, ({ one }) => ({
author: one(usersTable, {
fields: [collectionsTable.authorID],
references: [usersTable.id],
}),
}))
and a collection references those tables like so in the table setup:
authorID: varchar({ length: 255 })
.notNull()
.references(() => usersTable.id),
authorID: varchar({ length: 255 })
.notNull()
.references(() => usersTable.id),
and my query looks like this:
const collectionsQuery = await db.query.collectionsTable.findMany({
where: userID
? or(
eq(collectionsTable.publicationStatus, PubStatus.PUBLIC), // Public collections
and(
eq(collectionsTable.authorID, userID), // User-created collections
eq(collectionsTable.publicationStatus, PubStatus.DRAFT)
),
and(
eq(teamUsersTable.userID, userID), // Team-only collections
eq(collectionsTable.publicationStatus, PubStatus.TEAM_ONLY)
)
)
: eq(collectionsTable.publicationStatus, PubStatus.PUBLIC), // Only public collections

})
const collectionsQuery = await db.query.collectionsTable.findMany({
where: userID
? or(
eq(collectionsTable.publicationStatus, PubStatus.PUBLIC), // Public collections
and(
eq(collectionsTable.authorID, userID), // User-created collections
eq(collectionsTable.publicationStatus, PubStatus.DRAFT)
),
and(
eq(teamUsersTable.userID, userID), // Team-only collections
eq(collectionsTable.publicationStatus, PubStatus.TEAM_ONLY)
)
)
: eq(collectionsTable.publicationStatus, PubStatus.PUBLIC), // Only public collections

})
But I keep getting the error:
Unknown column 'collectionsTable.userID' in 'where clause'
Unknown column 'collectionsTable.userID' in 'where clause'
even though I'm only looking for collectionsTable.authorID. Does drizzle have a cache I need to refresh? I was using collectionsTable.userID before but renamed the column. I've ran drizzle-kit push and there is nothing to change. Thanks in advance for any help as this query was working as a select with join tables before. Wondering if I should just revert...
2 replies
NNuxt
Created by jbrundagejr on 1/29/2025 in #❓・help
okta integration
hello all: I'm trying to add Okta to my Nuxt 3.14 app and am struggling to find good documentation. I've been following along this guide from Okta but am struggling with the redirect page. Does anyone else have a solid example of how to use Okta with NUXT? Thanks in advance!! https://developer.okta.com/docs/guides/sign-into-spa-redirect/vue/main/
6 replies
NNuxt
Created by jbrundagejr on 1/8/2025 in #❓・help
dynamic route getRouterParams not updated
No description
5 replies
NNuxt
Created by jbrundagejr on 6/13/2023 in #❓・help
Robot.txt file?
I recently deployed a new NUXT build and am failing the SEO audit for my robots.txt file in Lighthouse. I found the nuxtjs/robots module on NPM - is that the way to generate the robot.txt file dynamically?
4 replies
NNuxt
Created by jbrundagejr on 12/30/2022 in #❓・help
Local Fonts Not Loading
Hey friends- I thought I followed the docs on using a local font, but I am not getting them. Any thoughts on where I am going wrong? nuxt.config.ts
export default defineNuxtConfig({
css: [
"@/css/fonts.css",
"@/css/mobile.css"
],
});
export default defineNuxtConfig({
css: [
"@/css/fonts.css",
"@/css/mobile.css"
],
});
/css/fonts.css
@font-face {
font-family: "Grotesk";
src: url("~/assets/fonts/Grotesk-Regular.otf") format("otf");
font-display: swap;
}
@font-face {
font-family: "Grotesk";
src: url("~/assets/fonts/Grotesk-Regular.otf") format("otf");
font-display: swap;
}
/css/mobile.css
h1 {
font-family: 'Grotesk'
}
h1 {
font-family: 'Grotesk'
}
assets folder is in the root of the project with the fonts folder inside of it. Any help would be appreciated!!
3 replies