Drizzle Studio not working with bun
/drizzle.config.ts
.
Now when I run bun drizzle-kit studio
I get this error:
/drizzle/drizzle.config.json file does not exist
...Union of schema with relations
As Column Alias
Migrations issues with Mysql2
sqlMessage: "Table 'game_player_ban' already exists"
sqlMessage: "Table 'game_player_ban' already exists"
pnpm drizzle-kit generate:mysql
pnpm drizzle-kit generate:mysql
CREATE TABLE IF NOT EXISTS
CREATE TABLE IF NOT EXISTS
Running complex migrations
users
table with columns id
and todo_body
. Now I want to split that table into separate users
and todos
tables to have a many-to-many relation.
Currently we're using knex, so in the knex migration file first I'd create the new table, then backfill existing todos into the new table, then drop the columns of the existing table....How do I type the `with` object part of a query builder if I extract it to it's own object?
with
object that I reuse across multiple queries and I wanted to extract it to its own variable for reusing it. I typed this object with DBQueryConfig["with"]
which seems to make typescript happy but the return type is not inferred correctly. Am I missing something?
```typescript
const fullEventWithParams: DBQueryConfig["with"] = {
users: {...Does calling `drizzle()` multiple times on the same db client instance consume more resources?
postgres(...)
client instance and creating multiple Drizzle instances from it, e.g. one for each request in a middleware, consume additional database connection resources compared to creating one drizzle instance for the whole server process?
@Angelelz this is related to the question you asked in the github issue. I believe my current implementation doesn't have this problem since it uses proxies, but I was about to refactor to call drizzle()
once per request and want to make sure I'm not about to blow up my database!...Is there a better way to extract Typescript types for use in function args than what I'm doing here?
export const client = drizzle(adminPgClient, { schema });
export type DrizzleClient = typeof client;
export type DrizzleTransaction = Parameters<Parameters<DrizzleClient["transaction"]>[0]>[0];
export const client = drizzle(adminPgClient, { schema });
export type DrizzleClient = typeof client;
export type DrizzleTransaction = Parameters<Parameters<DrizzleClient["transaction"]>[0]>[0];
Has JSON aggregation been added yet (analogous to Kysely?)
jsonAgg...
functions to generate raw SQL to helper utilities a while back, in order to generate arrays of nested json objects in aggregation. There was discussion of adding these as first-class drizzle functions, did that ever happen?
Helpers source: https://gist.github.com/rphlmr/0d1722a794ed5a16da0fdf6652902b15...Recommended place to add prepared statements
Relational Query - how to call mapRelationalRow
Drizzle query with where clause and primary composite key
drizzle-kit dry run / different in/out
Can't set nullable field back to null in drizzle-studio
int
column to null even when choosing NULL
from the dropdown. It defaults to a 0
which then throws an error upon saving.Prepared queries don't appear to be generated
Is it possible to pass sub query to `from`?
db.select().from()
and I need to pass a nested query into that from.
```
SELECT g.id, g.name, g.background_image, json_agg(p) as platforms
FROM (
SELECT g.*...Use `getTableColumns` with `groupBy`
getTableColumns
in the groupBy
, I've tried just calling the method and destructing. No luck, the error reads "must have a Symbol.iterator method that returns an iterator""Duplicate Index" - but no dupliacte index...
disk I/O error when running migration in context of vitest runner