chico
chico
Explore posts from servers
DTDrizzle Team
Created by chico on 7/31/2024 in #help
findMany not including right table details in query
i changed it a little and this one gives the expected result
result = db.query.authorsTable.findMany({
with: {
chapters: {
with: {
chapter: true,
},
},
books: {
with: { book: true },
},
},
})
result = db.query.authorsTable.findMany({
with: {
chapters: {
with: {
chapter: true,
},
},
books: {
with: { book: true },
},
},
})
thanks @Raphaël M (@rphlmr) ⚡ ✨
4 replies
DTDrizzle Team
Created by chico on 7/31/2024 in #help
findMany not including right table details in query
@Raphaël M (@rphlmr) ⚡ thanks for your reply when I use with nested, I get an error
Object literal may only specify known properties, and 'books' does not exist in type '{ author?: true | { columns?: { id?: boolean; ... }; with?: { books?: true | DBQueryConfig<"many", false, ExtractTablesWithRelations<typeof import(../db/src/schema/index")>, { ...; }>;
Object literal may only specify known properties, and 'books' does not exist in type '{ author?: true | { columns?: { id?: boolean; ... }; with?: { books?: true | DBQueryConfig<"many", false, ExtractTablesWithRelations<typeof import(../db/src/schema/index")>, { ...; }>;
and
'Object literal may only specify known properties, and chapters' does not exist in type '{ author?: true | {...}`
'Object literal may only specify known properties, and chapters' does not exist in type '{ author?: true | {...}`
4 replies
DTDrizzle Team
Created by Kwanza on 5/31/2024 in #help
Nested Where Clause in Many-to-Many relation using Query
what is the underline hover message? can you move the where clause to below the includes true
5 replies
DTDrizzle Team
Created by chico on 5/29/2024 in #help
Drizzle SQLite not implicitly handling autoincrement primary key id
resolved. I needed to define it as id: integer("id").primaryKey(), and didn't need the rest of the constraint
2 replies