smoke
smoke
Explore posts from servers
DTDrizzle Team
Created by smoke on 5/20/2023 in #help
Relations module - or condition
Hi there! I have a teams table, an users table, and a team_members table that connects these two. A team also has an ownerId column. Currently I have a query that fetches all the teams of an userId whether they are connected through the ownerId column or the join table. I was wondering if this is possible using the new relations module? Since this is a many-to-many, but also an one-to-many, with an 'or' condition.
40 replies
DTDrizzle Team
Created by smoke on 5/19/2023 in #help
drizzle-kit: Error: Cannot find module 'drizzle-orm/version'
Hi there, when I run the following command: pnpx drizzle-kit generate:pg, I get the following error and I am not sure why:
drizzle-kit: v0.17.6

node:internal/modules/cjs/loader:995
const err = new Error(message);
^

Error: Cannot find module 'drizzle-orm/version'
Require stack:
- /Users/user/Library/pnpm/store/v3/tmp/dlx-5856/node_modules/.pnpm/drizzle-kit@0.17.6/node_modules/drizzle-kit/index.js
drizzle-kit: v0.17.6

node:internal/modules/cjs/loader:995
const err = new Error(message);
^

Error: Cannot find module 'drizzle-orm/version'
Require stack:
- /Users/user/Library/pnpm/store/v3/tmp/dlx-5856/node_modules/.pnpm/drizzle-kit@0.17.6/node_modules/drizzle-kit/index.js
{
"devDependencies": {
"@types/node": "^18.15.5",
"@types/pg": "^8.6.6",
"drizzle-kit": "0.17.6",
"ts-node-dev": "^2.0.0",
"typescript": "^5.0.2"
},
"dependencies": {
"drizzle-orm": "^0.25.4",
"pg": "^8.11.0"
}
}
{
"devDependencies": {
"@types/node": "^18.15.5",
"@types/pg": "^8.6.6",
"drizzle-kit": "0.17.6",
"ts-node-dev": "^2.0.0",
"typescript": "^5.0.2"
},
"dependencies": {
"drizzle-orm": "^0.25.4",
"pg": "^8.11.0"
}
}
8 replies
DTDrizzle Team
Created by smoke on 4/1/2023 in #help
Select exists
Hi there, I was wondering if there is currently a good way of performing a ‘select exists’, to check whether a specific row exists. I could use the exists expression as a subquery, but this is not the same as the select exists if I only want to check if a record exists without returning the values. Thanks a lot, I appreciate it. I could just perform a raw query but there might be some better solutions.
7 replies