jsoneaday
jsoneaday
Explore posts from servers
PPrisma
Created by jsoneaday on 10/31/2024 in #help-and-questions
Why is omit not available for this query?
I was surprised that it's still in beta. I've enabled it but cannot get it to work for this query where my author has a password that I want to omit.
const authors = await this.#client.work.findMany({
select: {
author: {
include: {
works: {
include: {
workLikes: true,
},
},
},
},
},
orderBy: {
workLikes: {
_count: SortOrder.Desc,
},
},
take: size,
});
const authors = await this.#client.work.findMany({
select: {
author: {
include: {
works: {
include: {
workLikes: true,
},
},
},
},
},
orderBy: {
workLikes: {
_count: SortOrder.Desc,
},
},
take: size,
});
8 replies
PPrisma
Created by jsoneaday on 10/31/2024 in #help-and-questions
Why is omit not available for this query?
When I set a local Omit it tells me the type is never
8 replies
PPrisma
Created by jsoneaday on 9/9/2024 in #help-and-questions
Cursor based paging issue for multilevel relationships
When I first run this query with parameters pageSize = 5 and no lastCursor it returns expected data like this. However the second run returns nothing. My sort is descending so shouldn't id values less than 300n be returned?
works before flatmap: [
257n, 256n, 255n, 254n, 253n, 263n,
262n, 261n, 259n, 258n, 268n, 267n,
266n, 265n, 264n, 273n, 272n, 271n,
270n, 269n, 278n, 277n, 276n, 275n,
274n, 284n, 283n, 282n, 281n, 279n,
289n, 288n, 287n, 286n, 285n, 294n,
293n, 292n, 291n, 290n, 299n, 298n,
297n, 296n, 295n, 304n, 303n, 302n,
301n, 300n
]
firstFive: [ 304n, 303n, 302n, 301n, 300n ]
lastCursor: 300n
works before flatmap: []
nextFive: []
works before flatmap: [
257n, 256n, 255n, 254n, 253n, 263n,
262n, 261n, 259n, 258n, 268n, 267n,
266n, 265n, 264n, 273n, 272n, 271n,
270n, 269n, 278n, 277n, 276n, 275n,
274n, 284n, 283n, 282n, 281n, 279n,
289n, 288n, 287n, 286n, 285n, 294n,
293n, 292n, 291n, 290n, 299n, 298n,
297n, 296n, 295n, 304n, 303n, 302n,
301n, 300n
]
firstFive: [ 304n, 303n, 302n, 301n, 300n ]
lastCursor: 300n
works before flatmap: []
nextFive: []
2 replies
PPrisma
Created by jsoneaday on 6/17/2024 in #help-and-questions
Docker error Can't reach database server at localhost:5432
I moved my prisma code from the docker run command into cmd and it worked. Thank you
5 replies
PPrisma
Created by jsoneaday on 6/17/2024 in #help-and-questions
Docker error Can't reach database server at localhost:5432
Note also I am able to run
prisma generate
prisma generate
without issue from docker
5 replies
DTDrizzle Team
Created by pjb3 on 10/12/2023 in #help
ResolveMessage error when trying to run a query with drizzle postgres and bun
const migrationClient = postgres(db_conn, { max: 1 });
const migrationsPath = path.join(__dirname, "../../drizzle");
const folderExists = fs.existsSync(migrationsPath);
console.log("migrationsPath:", migrationsPath, "folderExists:", folderExists);

console.log("migrating...");
await migrate(drizzle(migrationClient), { migrationsFolder: migrationsPath });
const migrationClient = postgres(db_conn, { max: 1 });
const migrationsPath = path.join(__dirname, "../../drizzle");
const folderExists = fs.existsSync(migrationsPath);
console.log("migrationsPath:", migrationsPath, "folderExists:", folderExists);

console.log("migrating...");
await migrate(drizzle(migrationClient), { migrationsFolder: migrationsPath });
13 replies
DTDrizzle Team
Created by pjb3 on 10/12/2023 in #help
ResolveMessage error when trying to run a query with drizzle postgres and bun
Hi did you ever figure this out? I'm also trying to use Bund and Drizzle together, but I'm having the same error when I try and deploy a drizzle-kit migration
13 replies