Kairu
Kairu
DTDrizzle Team
Created by Jam on 12/10/2024 in #help
SQLITE deprecation warning
the third param to sqliteTable (all your indexes) is an array now, not an object
3 replies
DTDrizzle Team
Created by Kairu on 11/30/2024 in #help
`The types of '_.config.columns' are incompatible between these types` when upgrading to Next 15
ok actually i think i've figured it out. i have a react-email package that was still using react 18.3, so i've updated the deps for that to use the same react 19 rc versions and now typecheck is passing. yet to be seen if react-email actually supports 19 but apparently it does
7 replies
DTDrizzle Team
Created by Kairu on 11/30/2024 in #help
`The types of '_.config.columns' are incompatible between these types` when upgrading to Next 15
locking my drizzle version to exactly 0.33.0 (vs. using ^0.33.0) in all packages doesnt work either so i'm not sure it's a version mismatch
7 replies
DTDrizzle Team
Created by Kairu on 11/30/2024 in #help
`The types of '_.config.columns' are incompatible between these types` when upgrading to Next 15
@Xpecial Poo do you happen to be in a turborepo monorepo, exporting your schema from a package?
7 replies
DTDrizzle Team
Created by Kairu on 11/30/2024 in #help
`The types of '_.config.columns' are incompatible between these types` when upgrading to Next 15
i haven't been able to figure out a solution either.. kinda hoping todays release has something to do with libsql because i have another issue thats seemingly rendered migrations broken for a couple months now
7 replies
DTDrizzle Team
Created by Kairu on 10/25/2024 in #help
Nextjs pages router: You may need an appropriate loader to handle this file type
for anyone else running into this: needed to add transpilePackages: ["@repo/schema"] to my next config.
3 replies
DTDrizzle Team
Created by Vinny on 3/10/2024 in #help
Error Too many connections with Drizzle + MySQL2
haven’t encountered any errors so im probably fine for now
13 replies
DTDrizzle Team
Created by Vinny on 3/10/2024 in #help
Error Too many connections with Drizzle + MySQL2
0/disabled I believe
13 replies
DTDrizzle Team
Created by Vinny on 3/10/2024 in #help
Error Too many connections with Drizzle + MySQL2
i should probably check what mine is set to, presumably the default
13 replies
DTDrizzle Team
Created by Shezan on 3/8/2024 in #help
Best/recommended column type for Id - Drizzle Neon
neon supports extensions https://neon.tech/docs/extensions/pg-extensions you could use pgx_ulid for ULIDs? they're like 01ARZ3NDEKTSV4RRFFQ69G5FAV i'm using citext for something and adding the create extension statement to a migration and creating a custom column is very easy
2 replies
DTDrizzle Team
Created by Vinny on 3/10/2024 in #help
Error Too many connections with Drizzle + MySQL2
afaik it wont work on serverless which is why serverless drivers and the drizzle http proxy exists, but i dont get enough traffic per second to exhaust connections
13 replies
DTDrizzle Team
Created by Vinny on 3/10/2024 in #help
Error Too many connections with Drizzle + MySQL2
this is my way for avoiding connection exhaustion in HMR
type PostgresDB = ReturnType<typeof postgres> | undefined;
let postgresDb: PostgresDB = undefined;

if (!postgresDb) {
postgresDb = postgres(databaseUrl);
}

export const db = drizzle(postgresDb, { schema });
type PostgresDB = ReturnType<typeof postgres> | undefined;
let postgresDb: PostgresDB = undefined;

if (!postgresDb) {
postgresDb = postgres(databaseUrl);
}

export const db = drizzle(postgresDb, { schema });
13 replies
DTDrizzle Team
Created by Kairu on 3/7/2024 in #help
Executing database migrations on Vercel
alright this seems to work really nicely with vercel preview branching using neon and drizzle seems to try overwriting the meta info upon migration?
{
severity_local: 'NOTICE',
severity: 'NOTICE',
code: '42P06',
message: 'schema "drizzle" already exists, skipping',
file: 'schemacmds.c',
line: '132',
routine: 'CreateSchemaCommand'
}
{
severity_local: 'NOTICE',
severity: 'NOTICE',
code: '42P07',
message: 'relation "__drizzle_migrations" already exists, skipping',
file: 'parse_utilcmd.c',
line: '207',
routine: 'transformCreateStmt'
}
{
severity_local: 'NOTICE',
severity: 'NOTICE',
code: '42P06',
message: 'schema "drizzle" already exists, skipping',
file: 'schemacmds.c',
line: '132',
routine: 'CreateSchemaCommand'
}
{
severity_local: 'NOTICE',
severity: 'NOTICE',
code: '42P07',
message: 'relation "__drizzle_migrations" already exists, skipping',
file: 'parse_utilcmd.c',
line: '207',
routine: 'transformCreateStmt'
}
2 replies
DTDrizzle Team
Created by Kairu on 1/16/2024 in #help
Drizzle and multi-tenancy
thanks for the reply, sorry for the wall of text lol
8 replies
DTDrizzle Team
Created by Kairu on 1/16/2024 in #help
Drizzle and multi-tenancy
I feel like I will be easier/faster to have a separate drizzle instance per database
agreed. i did just remember i've done a sort of cached connection in my pg side project that could work here, just instead of returning a single instance it has a map of connections and returns the applicable one passed into it, or something like that
type PostgresDB = ReturnType<typeof postgres> | undefined;
let postgresDb: PostgresDB = undefined;
const databaseUrl = `...`;

// prevents HMR from exhausing connections
if (process.env.NODE_ENV !== "production") {
if (!postgresDb) {
postgresDb = postgres(databaseUrl);
}
} else {
postgresDb = postgres(databaseUrl);
}
export const db = drizzle(postgresDb, { schema });
type PostgresDB = ReturnType<typeof postgres> | undefined;
let postgresDb: PostgresDB = undefined;
const databaseUrl = `...`;

// prevents HMR from exhausing connections
if (process.env.NODE_ENV !== "production") {
if (!postgresDb) {
postgresDb = postgres(databaseUrl);
}
} else {
postgresDb = postgres(databaseUrl);
}
export const db = drizzle(postgresDb, { schema });
8 replies
DTDrizzle Team
Created by Kairu on 1/16/2024 in #help
Drizzle and multi-tenancy
After that, changing databases within backend server environment will come to be a question of, does your driver support it?
in theory, starting with sqlite and switching to mysql or pg is only gaining features. imo the driver type isn't the complicated part here, it's the whole hosting of the database server and creating new databases programmatically in different regions that makes it complicated. using turso allows one auth key to connect to X number of database URLs, compared to spinning up mysql/pg servers myself and building a service to coordinate all of these, potentially requiring another API layer to interact with those databases, is just far more complex
8 replies
DTDrizzle Team
Created by Kairu on 1/16/2024 in #help
Drizzle and multi-tenancy
Will it run in a dedicated server
they seem set on using serverless, so the app would be deployed on vercel
do you need to optimize for cold starts
performance is not a big concern here, so i don't believe so
how often a new tenant will be onboarded
current estimation is a few dozen for 2024, scaling to low hundreds per year
what type of resources will you be working with
dynamic form templates, filled in forms, calculations based on those forms
what type of requests will be the most commons
on the system side: just loading what organizations and sub-organizations a user is linked to on the tenant side: the resources mentioned above, nothing super complicated that sql can't breeze through i got confirmation that tenants need to be able to pick their region for legal reasons, so the options for db here is basically - use Turso, the list of locations they offer have been acceptable - spin up new database servers manually and build a service to coordinate tenant onboarding between all these different servers cloudflare d1 looks like a solid turso alternative but not being able to explicitly choose a region makes it difficult to justify when the region selection is a legal requirement
8 replies
DTDrizzle Team
Created by Mr.Propre on 11/30/2023 in #help
relation select query with where condition
the where key is only available on many relations
20 replies