Louistiti
Louistiti
DTDrizzle Team
Created by Louistiti on 9/23/2023 in #help
Where does the onDelete on relation is applying ?
For instance :
const product = pgTable('product', {
logistics_id: serial('logistics_id')
.references(() => logistics.id, { onDelete: 'cascade' })
.notNull(),
})
const product = pgTable('product', {
logistics_id: serial('logistics_id')
.references(() => logistics.id, { onDelete: 'cascade' })
.notNull(),
})
Here the cascade delete will occur when I delete my product entity (and so delete the logistic linked to it) Or when I delete the logistic (will delete the product linked to it)
14 replies
DTDrizzle Team
Created by Louistiti on 7/19/2023 in #help
Disable postgres log when executing raw sql queries
Is there a way to disable auto logging notices ? I have a script that truncates all my db each time a test suite is running and my console gets full of
console.log
{
severity_local: 'NOTICE',
severity: 'NOTICE',
code: '00000',
message: 'truncate cascades to table "shops_staff"',
file: 'tablecmds.c',
line: '1826',
routine: 'ExecuteTruncateGuts'
}

at NoticeResponse (../../node_modules/.pnpm/[email protected]/node_modules/postgres/cjs/src/connection.js:875:17)
console.log
{
severity_local: 'NOTICE',
severity: 'NOTICE',
code: '00000',
message: 'truncate cascades to table "shops_staff"',
file: 'tablecmds.c',
line: '1826',
routine: 'ExecuteTruncateGuts'
}

at NoticeResponse (../../node_modules/.pnpm/[email protected]/node_modules/postgres/cjs/src/connection.js:875:17)
when running my test suites... Is there a way to disable this ?
1 replies
DTDrizzle Team
Created by Louistiti on 7/18/2023 in #help
Clear the whole database?
For my test environment I'd like to clear the whole db.. is there a way to achieve this using drizzle ?
59 replies
DTDrizzle Team
Created by Louistiti on 7/17/2023 in #help
auto updated_at
is there a way to automatically update the updatedAt column of a postgres table ?
1 replies
DTDrizzle Team
Created by Louistiti on 7/15/2023 in #help
Use Drizzle in NestJS app
Hi everyone ! I am new to both drizzle and NestJS and was wondering if there was any recipe out there to use Drizzle in NestJS (I couldn't find anything) should I create a service or something ? (as Prisma ?)
16 replies