New dialect for snowflake - quotes and case sensitivity

Snowflake has different behavior compared to Postgres and other dialects currently in Kysely, I want to be able to control the casing of all identifiers / tables / schemas meaning that if I have query.selectFrom("table").select(["id"]) I want it to compile to the exact case as it is specified, and also to be able to control if with a configuration to the query compiler (this I imagine is just a simple amendment to the constructor) which functions should be overridden in the query compiler ? Thank you in advance:typescript: :kysely:
3 Replies
koskimas
koskimas4mo ago
None of the built-in dialects change the casing in any way whatsoever. Unless you're using the CamelCasePlugin which, by definition, changes everything from camelCase to snake_case
SneakOnYou
SneakOnYou4mo ago
what if I want to change the casing what should I do then ? create a plugin ?
koskimas
koskimas4mo ago
No, you can definitely change the casing in the compiler if you want. I was just confused when you said
I want it to compile to the exact case as it is specified
as if the other dialects didn't compile it as it is specified. Every identifier is an IdentifierNode. Just implement visitIdentifier
Want results from more Discord servers?
Add your server