We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drizzle-orm
0.39.0
drizzle-kit
0.30.3
No response
When using
import type { Kyselify } from "drizzle-orm/kysely";
the casing option of snake_case is not supported. Here's my workaround that should be included in the Kyselify file.
snake_case
type CamelToSnake<S extends string> = S extends `${infer T}${infer U}` ? `${T extends Lowercase<T> ? T : `_${Lowercase<T>}`}${CamelToSnake<U>}` : S; type ConvertKeysToSnakeCase<T> = { [K in keyof T as CamelToSnake<Extract<K, string>>]: T[K]; }; type KyselifyCased< T extends Table, Casing extends "camelCase" | "snake_case" = "camelCase", > = Casing extends "camelCase" ? Kyselify<T> : ConvertKeysToSnakeCase<Kyselify<T>>;
Can be used like
interface Database { token: KyselifyCased<typeof token, "snake_case">; user: KyselifyCased<typeof user, "snake_case">; } const result = await kysely.selectFrom("token").select(["id", "created_at"]).execute();
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Report hasn't been filed before.
What version of
drizzle-orm
are you using?0.39.0
What version of
drizzle-kit
are you using?0.30.3
Other packages
No response
Describe the Bug
When using
the casing option of
snake_case
is not supported. Here's my workaround that should be included in the Kyselify file.Can be used like
The text was updated successfully, but these errors were encountered: