DT
Drizzle Teamjohnnydt
testing best practices
Can anyone share how they're writing tests that involve drizzle? Looking for something similar to these docs for Prisma:
https://www.prisma.io/docs/guides/testing/unit-testing
D
DiamondDragon•229d ago
@johnnydt did you find a solution
J
johnnydt•229d ago
No
A
Angelelz•229d ago
If you want you write unit tests that involve Drizzle, you can mock like you would mock any thing else
There's no point in testing library code in my opinion
For database stuff, it's better to run integration tests in some docker or something like that
Just my two cents
D
DiamondDragon•228d ago
ok i think i got a working solution. mine was a little more complicated since i am using pg_uuidv7 extension. But now this is running all my migration files to the docker container postgres server @johnnydt
J
jakeleventhal•115d ago
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
7.2KMembers
View on DiscordWant results from more Discord servers?
More Postssupabase workflowHey I'm trying to set up a sveltekit app with supabase + drizzle and currently what I got going is aError: self signed certificate in certificate chainHello, I am a new user of drizzle and trying to run the command for the first time:
```bash
drizzle-insert with InferModel not workingHey, playing with Drizzle, like it a lot but I am having an issue where I inferred the model of a scmysql-core fails on TS build on 0.27.1Getting this error when I try to build my ts node appUse a different schema on postgresHello, I am currently trying to define a table with drizzle like this:
```typescript
const rollupAcSpecifying foreign key names in SchemaAfter introspecting from a database, and generating new schema with changes, the existing foreign keInternal server error: Error connecting to database: fetch failedI'm trying to send the following query to my db but it eventually times out, throwing an error:
```ERR_PACKAGE_PATH_NOT_EXPORTED on 0.27.1I'm getting the following message using drizzle-orm `0.27.1`. I've tried using various different nodError: Error connecting to database: fetch is not definedTrying to use neon-http with SST
```
import { neonConfig, neon, Pool } from "@neondatabase/serverlegood way to get the "count" for paginated queriesI'm doing the following to get the total count and the values in a paginated query:
```
const fileCoSqlite3 support for DenoApologies if I'm being dense, but is there support for deno with a local sqlite3 db? I can't seem topostges, auto-generated uuid as primary keyI'm looking to change all my tables from having a serial int primary key as ID
what is the best way Relational query `extras` are not properly adding sqlWhen I try to use the drizzle orm relational query like it is show in the docs I run into an error. Schema not ingested with drizzle-orm/node-postgresI have a db connection for production using Vercel Postgres. It works great. I'm trying to set up a Extract interface for table from schemaCan I extract an interface for a table from my schema without using it from the client? Something liIncluding more than 1 relation in query throws errorIf i try to include more than 1 relation i get an error 👇
```
{
"errorMessage": "could not ideNew neon http driver not working with pooled connectionsis the new `{ drizzle } from "drizzle-orm/neon-http"` not compatible with pooled connections? GettinPostgres functionsHey, I'm migrating a ton of postgres raw sql into using drizzle ORM. Is there any sort of setup for