`db.$count` with extras throws error when correlating with outer table
.extras()
with db.query.orderTable.findMany()
to get the count of related orderItemTable
rows like this:
```ts
const orders = await db.query.orderTable.findMany({
extras: (t) => ({
itemCount: db.$count(orderItemTable, eq(orderItemTable.orderId, t.id)),...Why does drizzle-zod refinements overwrite the nullability of the field?
typeOverrides
object that specifies all the schemas that should be applied to createInsertSchema
and createSelectSchema
. Depending on the schema, the override would be applied and then the nullability of the column would be applied on top of the refinement.
After upgrading to 0.8.2, it seems this is no longer the case and the website documentation even states it explicitly: https://orm.drizzle.team/docs/zod#refinements
In the example on the site, preferences
is a nullable json field. The way this example overwrites the nullability, you can easily insert null values into the preferences
field but using the userSelectSchema
to parse data coming out of the DB would fail....How to refine seed data using `with` clause in drizzle seed
workout
that has a one-to-many relationship to another table called exercise
(i.e one workout has many exercises associated with it). Now, when I try to seed some workouts, I want to be able to seed each workout with
multiple exercises. I want to be able to refine what parameters are allowed for the nested exercises, but I see no way to do that.
Here's what I have:
```javascript
await seed(db, { workout, exercise }).refine((funcs) => ({
workout: {...Drizzle-kit keeps recreating foreign key constraints
drizzle doesnt connect to GCP database string
`postgresql://postgres:${password}@localhost/${database_name}?host=/cloudsql/educate-393101:us-central1:educate-ai&connection_limit=10`
`postgresql://postgres:${password}@localhost/${database_name}?host=/cloudsql/educate-393101:us-central1:educate-ai&connection_limit=10`
Unable to load Drizzle Studio due to error
studio can not delete/update a record,

#drizzle-studio Error ID: b7abbd6110e9The result contains the unsupported data type "CHAR".
Error ID: b7abbd6110e94f219f2e6596b88e168e
The result contains the unsupported data type "CHAR"....
Type-safe subquery in "extras" of findMany query
TypeError: n.trimChar is not a function
Studio stopped working after update to latest stable versions of kit and ORM
"drizzle-orm": "^0.44.2"
"drizzle-kit": "0.31.2"
...
Issue with Drizzle Kit
"devDependencies": {
"drizzle-kit": "^0.31.2"
},
"devDependencies": {
"drizzle-kit": "^0.31.2"
},

how to get type bigint return type "number | undefined" in schema ?
Update with CTE
UPDATE .. SET .. FROM .. WHERE ..
now i tried to change to WITH .. UPDATE .. SET .. WHERE ..
by following the example provided in drizzle docs (https://orm.drizzle.team/docs/update#with-update-clause)
it shows the error of missing FROM-clause entry for table [CTE name here]
may I know if it requires FROM
keyword like original query, or without it will works too?...Types don't infer correctly for tables with`references` method?
text
or int
, get typed correctly. Any time I create an association with the references
method the generated type becomes { [x: string]: any }
.
I'm using:
- Expo SDK: 51
- Expo SQLite: 14.0.6...Why does the same query not work using `select`?
How to use a prepared query inside a transaction?
CloudflareSocket is not a constructor

Schema that needs to joins twice from the same schema
