BinaryArtifex
BinaryArtifex
Explore posts from servers
DTDrizzle Team
Created by BinaryArtifex on 1/6/2024 in #help
how to add ulid compatibility to postgres?
now that i think about it, ive been downa bit of a rabbit hole about how best to store ulid's in a postgres database and without needlessly bloating primary keys (via varchar(26)) and still have the nicety of sortable indexing so i think im gonna drop the whole ulid thing in favor of uuidv7. there's currently a good npm lib at https://github.com/LiosK/uuidv7 that looks like a good candidate...
2 replies
DTDrizzle Team
Created by BinaryArtifex on 7/29/2023 in #help
cannot set alias for composite primary key, getting (errno 1059) (sqlstate 42000) errors
@Andrew Sherman at the risk of stretchin the friendship i don't spose a cheeky little Check constraint feature is gonna creep into 0.29.0? cause that'd just be swell.
13 replies
DTDrizzle Team
Created by BinaryArtifex on 7/29/2023 in #help
onConflictDoNothing does not exist on planetscale client
oh nice, forgot i even asked this and went back to ask again and found my original question answered haha
6 replies
DTDrizzle Team
Created by BinaryArtifex on 7/29/2023 in #help
cannot set alias for composite primary key, getting (errno 1059) (sqlstate 42000) errors
cant see a mention of custom names for primary keys in the releases page just yet, will this feature be far away?
13 replies
DTDrizzle Team
Created by BinaryArtifex on 7/29/2023 in #help
cannot set alias for composite primary key, getting (errno 1059) (sqlstate 42000) errors
@Andrew Sherman been away for a minute sorry for late reply, yeah im pushing incremental migrations to planetscale through the greenfields phase till i settle on a version 1 database schema for production, so before that its the wild west atm
13 replies
DTDrizzle Team
Created by BinaryArtifex on 7/29/2023 in #help
onConflictDoNothing does not exist on planetscale client
oh hang on....is this what im looking for? this doesn't appear to be in the docs....
export async function lookupNationalitySeed(client: DbClient) {
await client
.insert(lookupNationality)
.ignore() // <<------
.values(
data.map((nationality) => ({
id: ulid(),
name: nationality,
slug: paramCase(nationality),
})),
);
}
export async function lookupNationalitySeed(client: DbClient) {
await client
.insert(lookupNationality)
.ignore() // <<------
.values(
data.map((nationality) => ({
id: ulid(),
name: nationality,
slug: paramCase(nationality),
})),
);
}
6 replies
DTDrizzle Team
Created by BinaryArtifex on 7/29/2023 in #help
cannot set alias for composite primary key, getting (errno 1059) (sqlstate 42000) errors
@Andrew Sherman sorry to buzz ya mate, don't seem to be getting a bite on my question, hopin you could maybe point me in the right direction? i don't particularly want to compress my table or column names as ive got a consistent set of conventions id really prefer to stick to....
13 replies