[Solved] drizzle-seed autocomplete not working if there are enums or zod objects
drizzle-seed
.
I'm trying to seed my database and I was surprised that I wouldn't get table autocomplete inside the seed function when the schema is in different files. Whenever I import * from "./single-file"
everything seems to work. Curiously when I deconstruct the import for a specific table, I lose the autocompelte. The tsconfig is in the comment below.
Case 1 (works) - import * as schema from "./schema/contexts"
...utility function for COALESCE
🚨 Issue: Testing with PostgreSQL and Drizzle ORM using Testcontainers
Enum in Unique Constraint throws error.
export const myEnum = pgEnum('myEnum', ['A', 'B', 'C']);
export const myEnum = pgEnum('myEnum', ['A', 'B', 'C']);
define where query outside
``
const whereQuery = exists(
db
.select({ id: sql
1` })...Read replica + schema
drizzle-zod 0.6.1 has errors on each createXyzSchema
The inferred type of 'selectWorkspacesSchema' cannot be named without a reference to '../node_modules/drizzle-zod/schema.types.internal.mjs'. This is likely not portable. A type annotation is necessary. ts(2742)
The inferred type of 'selectWorkspacesSchema' cannot be named without a reference to '../node_modules/drizzle-zod/schema.types.internal.mjs'. This is likely not portable. A type annotation is necessary. ts(2742)
conditional columns
Drizzle-Zod extend schema....

drizzle-kit commands are slow
generate
and migrate
, the operation seem to take no time, like in producing the migration file but the command takes quite some time to exit like half a minute or so. Is this related to the commands or the conditions of the pc, like RAM, CPU, running tasks, et cetera?drizzle-kit push not working with pgSchema
docker-compose.yaml
that is spinning up a Postgres instance alongside Adminer.
```
services:
db:...There is not enough information to infer relation "group.users"
Need help with type issues on InferInsertModel and InferSelectModel
user
schema and I'm creating types for them using the InferInsertModel
and InferSelectModel
.
But however when I hover the type variables CreateUser
and User
I'm getting generic types instead of user schema type as you see in the second screenshot.
Am I doing anything wrong here?...
Drizzle-kit force rename

Error code 5: database is locked ExpoSQLite
Struggling to setup postgresql in prod, pglite in dev
Cannot read properties of undefined (reading 'findMany')
Generated Postgres Column adding together other columns that may have null values
generated always as
expression, remove the table name before each column name ("supply_item"."location1_quantity"
-> "location1_quantity"
)Is there any way to have a subquery in an insert statement?
INSERT INTO games (name, sortOrder)
VALUES ('New Game', COALESCE((SELECT MAX(sortOrder) FROM games), 0) + 1);
INSERT INTO games (name, sortOrder)
VALUES ('New Game', COALESCE((SELECT MAX(sortOrder) FROM games), 0) + 1);
Need help with InferSelectModel
booking
schema and creating types for them using InferInsertModel
. But when I hover over the CreateBooking type it shows only some columns from the booking table and most of the columns are missing. Any idea why it behave like this?