Can i share drizzle transaction with knex.js's transaction (postgresql)
How to automatically run migration on NextJS start
npx tsx src/index.ts
which is a CLI command instead of runtime.
Natively write SQL functions/triggers with Drizzle?
[SOLVED] "Not enough info to infer relation", many-to-many junction table w/ postgres
The TLDR of the schema: templateDefinition has many colorSets, colorSets have many templateDefinition. I want to query templateDefinition to include colorSets from the junction table https://gist.github.com/Connorelsea/76f12181ec4205533bdc4329970a6f66...

Applying drizzle migrations on Vercel with Hono
Unable to use `push` or `studio` anymore
drizzle-kit push...
Using drizzle-kit push only works the first time (when database is empty)
Orphaned Children tables after a successful migration
ticket_order
are referring to the temporary and now deleted ticket_order_old
table
``sql
PRAGMA foreign_keys=off;--> statement-breakpoint
ALTER TABLE
ticket_order RENAME TO
ticket_order_old`;--> statement-breakpoint...
Orphaned children tables after a successful migration
ticket_order
are referring to the temporary and now deleted ticket_order_old
table
``sql
PRAGMA foreign_keys=off;--> statement-breakpoint
ALTER TABLE
ticket_order RENAME TO
ticket_order_old`;--> statement-breakpoint...How to achieve a returning insert with relations
custom datatypes
features: text().array().notNull().default(sql`ARRAY[]::text[]`),
features: text().array().notNull().default(sql`ARRAY[]::text[]`),
DefaultPostgresSchema?
how to sort rows lexographically by the string value of the postgres enum column
How to update/insert id of a reference when I have a different constraint
id
as the primary key, and a unique constraint on appId
and code
. At the time of update/insert, I only have the unique constraint. How can I update/insert the record without fetching the id?
Something like this:
```ts...Using drizzle in monorepo
admin
and web
. The admin
is responsible for CRUD operations to database and allows the admin user to manage content on their website, while web
interacts with the database in a read-only way, displaying the content for the user.
I want to share a single drizzle db client
between both projects because this keeps types for both projects synced and I don't have to write changes in 2 places whenever I want to modify something schema related.
How can I achieve such a thing in a turbo monorepo or any other way?...Calculating average of joined table column
$returningId returning extra rows
mysql2
driver in drizzle-orm
this:
console.log(await db.insert(table).values([row1, row2]).$returningId())
console.log(await db.insert(table).values([row1, row2]).$returningId())