Mario564
Mario564
Explore posts from servers
DTDrizzle Team
Created by RamonaSteve on 12/16/2024 in #help
Error: we don't support params for `sql` default values
@RamonaSteve Try using sql.raw instead of sql
2 replies
DTDrizzle Team
Created by The Rumbling on 12/17/2024 in #help
Cannot generate Typebox schema from Drizzle Enum
@The Rumbling Can I see your tsconfig.json file?
2 replies
DTDrizzle Team
Created by DiamondDragon on 12/17/2024 in #help
Can't upsert with onConflictDoUpdate & generatedAlwaysAsIdentity ID columns?
@DiamondDragon You can use the new .overrideSystemValues method before .values to insert and update generated identity fields
2 replies
DTDrizzle Team
Created by AlexDaniel on 12/15/2024 in #help
Executing a query that was made with QueryBuilder
My bad, it is required. Here are the docs for this feature: https://orm.drizzle.team/docs/select#select-from-subquery
9 replies
DTDrizzle Team
Created by AlexDaniel on 12/15/2024 in #help
Executing a query that was made with QueryBuilder
In that case, there's no other way of doing it. Although, pretty sure in the above query, you don't need to alias query unless you're using it as a CTE for another query
9 replies
DTDrizzle Team
Created by AlexDaniel on 12/15/2024 in #help
Executing a query that was made with QueryBuilder
Ah, I see
9 replies
DTDrizzle Team
Created by jsingleton37 on 12/16/2024 in #help
Running into some type errors with query.where
Have you pushed the latest changes to your DB?
13 replies
DTDrizzle Team
Created by jsingleton37 on 12/16/2024 in #help
Running into some type errors with query.where
It may have to do with the logic rather than being something syntactical
13 replies
DTDrizzle Team
Created by jsingleton37 on 12/16/2024 in #help
Running into some type errors with query.where
Here are some docs that go in a bit more detail: https://orm.drizzle.team/docs/guides/conditional-filters-in-query
13 replies
DTDrizzle Team
Created by jsingleton37 on 12/16/2024 in #help
Running into some type errors with query.where
Yes, before building query
13 replies
DTDrizzle Team
Created by Zefty on 12/14/2024 in #help
Drizzle seed stuck and no info displayed
CC: @OleksiiKH
6 replies
DTDrizzle Team
Created by Olshansky on 12/7/2024 in #help
onedollarstats not showing any stats (olshansky.info)
CC: @alexblokh
22 replies
DTDrizzle Team
Created by AlexDaniel on 12/15/2024 in #help
Executing a query that was made with QueryBuilder
You can build query with the db object rather than the qb object if you want, it'll produce the same output
9 replies
DTDrizzle Team
Created by jsingleton37 on 12/16/2024 in #help
Running into some type errors with query.where
Here's how you solve this: 1. Create an empty array like this:
const filters: (SQL | undefined)[] = [];
const filters: (SQL | undefined)[] = [];
2. Add your filters before building the query by doing filters.push. 3. Spread the array in the where method of the query (.where(...filters))
13 replies
DTDrizzle Team
Created by Johnny on 12/16/2024 in #help
Filter on included relations
This is currently not possible. We're working on making this a feature in RQB v2
2 replies
DTDrizzle Team
Created by Jakesdoc on 10/8/2024 in #help
Transaction Type
The above would look like this for PG with the postgres.js driver (just to give an example):
import type { PgTransaction } from 'drizzle-orm/pg-core';
import type { PostgresJsDatabase, PostgresJsQueryResultHKT } from 'drizzle-orm/postgres-js';

export type Db = PostgresJsDatabase;
export type Tx = PgTransaction<PostgresJsQueryResultHKT>;
import type { PgTransaction } from 'drizzle-orm/pg-core';
import type { PostgresJsDatabase, PostgresJsQueryResultHKT } from 'drizzle-orm/postgres-js';

export type Db = PostgresJsDatabase;
export type Tx = PgTransaction<PostgresJsQueryResultHKT>;
23 replies
DTDrizzle Team
Created by Jakesdoc on 10/8/2024 in #help
Transaction Type
Here's the proper way to type db and tx:
import type { YourDriverDatabase, YourDriverQueryResultHKT } from 'drizzle-orm/your-driver';
import type { DialectTransaction } from 'drizzle-orm/dialect-core';

export type Db = YourDriverDatabase;
export type Tx = DialectTransaction<YourDriverQueryResultHKT>;
import type { YourDriverDatabase, YourDriverQueryResultHKT } from 'drizzle-orm/your-driver';
import type { DialectTransaction } from 'drizzle-orm/dialect-core';

export type Db = YourDriverDatabase;
export type Tx = DialectTransaction<YourDriverQueryResultHKT>;
23 replies
DTDrizzle Team
Created by gwilliamnn on 12/13/2024 in #help
New version Not use IF NOT EXIST'S anymore
This is expected behavior, it's listed as one of the changes in the release notes
2 replies
DTDrizzle Team
Created by jsingleton37 on 12/12/2024 in #help
I messed up my supabase and drizzle setup
You can try using the drop command in Drizzle Kit
19 replies
DTDrizzle Team
Created by jsingleton37 on 12/12/2024 in #help
I messed up my supabase and drizzle setup
Yeah, but that's what I mean by "starting from scratch"
19 replies