dex
dex
TTCTheo's Typesafe Cult
Created by dex on 10/16/2024 in #questions
Need help making a drizzle query
I have the following schema
export const userTable = createTable("user", {
id: int("id", { mode: "number" }).primaryKey({ autoIncrement: true }),

pictureKey: text("picture_key").references(() => nameTable.key),
signatureKey: text("signature_key").references(() => nameTable.key),
})


export const nameTable = createTable("name", {
key: text("key", {length:256}).unique().primaryKey().notNull(),
url: text("url").notNull(),
})
export const userTable = createTable("user", {
id: int("id", { mode: "number" }).primaryKey({ autoIncrement: true }),

pictureKey: text("picture_key").references(() => nameTable.key),
signatureKey: text("signature_key").references(() => nameTable.key),
})


export const nameTable = createTable("name", {
key: text("key", {length:256}).unique().primaryKey().notNull(),
url: text("url").notNull(),
})
How do I select user and join the picture and signature? I cant seem to have both picture and signature in one object.
4 replies
TTCTheo's Typesafe Cult
Created by dex on 1/19/2024 in #questions
How to stop outline from showing after closing dropdown?
No description
6 replies
TTCTheo's Typesafe Cult
Created by dex on 12/28/2023 in #questions
Error when running `pnpm db:push`
When i try to pnpm db:push i get this error
dg-system on  main [✘!?] via 🍞 v1.0.11 via  v20.10.0
❯ pnpm db:push

> [email protected] db:push /Users/barsi/Dev/dg-system
> dotenv drizzle-kit push:mysql

node:internal/modules/cjs/loader:598
throw e;
^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './relations' is not defined by "exports" in /Users/barsi/Dev/dg-system/node_modules/drizzle-orm/package.json
at exportsNotFound (node:internal/modules/esm/resolve:294:10)
at packageExportsResolve (node:internal/modules/esm/resolve:641:9)
at resolveExports (node:internal/modules/cjs/loader:591:36)
at Module._findPath (node:internal/modules/cjs/loader:668:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at src/introspect-pg.ts (/Users/barsi/Dev/dg-system/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:18794:24)
at __init (/Users/barsi/Dev/dg-system/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:9:56) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v20.10.0
 ELIFECYCLE  Command failed with exit code 1.
dg-system on  main [✘!?] via 🍞 v1.0.11 via  v20.10.0
❯ pnpm db:push

> [email protected] db:push /Users/barsi/Dev/dg-system
> dotenv drizzle-kit push:mysql

node:internal/modules/cjs/loader:598
throw e;
^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './relations' is not defined by "exports" in /Users/barsi/Dev/dg-system/node_modules/drizzle-orm/package.json
at exportsNotFound (node:internal/modules/esm/resolve:294:10)
at packageExportsResolve (node:internal/modules/esm/resolve:641:9)
at resolveExports (node:internal/modules/cjs/loader:591:36)
at Module._findPath (node:internal/modules/cjs/loader:668:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at src/introspect-pg.ts (/Users/barsi/Dev/dg-system/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:18794:24)
at __init (/Users/barsi/Dev/dg-system/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:9:56) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v20.10.0
 ELIFECYCLE  Command failed with exit code 1.
Package JSON:
"drizzle-orm": "^0.28.5",
devDeps
"drizzle-kit": "^0.20.7",
"drizzle-orm": "^0.28.5",
devDeps
"drizzle-kit": "^0.20.7",
8 replies
TTCTheo's Typesafe Cult
Created by dex on 10/21/2023 in #questions
Drizzle migration error with Example table.
No description
6 replies
TTCTheo's Typesafe Cult
Created by dex on 10/10/2022 in #questions
How does NextAuth save user info to the database with the prisma adapter?
Is it possible to see the function that nextauth calls to save user info to the database? Is there a way to console.log what the Provider returns after signing in? I'd like to add one more field to the User schema like their Facebook Public Profile ID after signing in when using FacebookProvider but I don't know where to start.
3 replies