At first I didn't know this package existed, but I have also begun a prototype of an Effect and Kysely with a slightly different approach to things. My intent behind this issue is to see if you'd be interested in merging forces 😄
The key difference is the implementation of @effect/sql's (used to be sqlfx) Client interface here. This allows Kysely to use its drivers/dialects and configuration and we'd gain access to any libraries that will pop up supporting the @effect/sql interfaces directly, including its own.
It also provides Kysely's type-safety around the Sql.schema.* and Sql.resolver.* methods ensuring that Kysely returns at least (can have additional properties) the Encoded side of the Schema for proper conversion to the Type of the schema.
Right now I only have the postgres connection setup, but it will be quite trivial to support all of the @effect/sql-* variants as the only real change is in the @effect/sql-* Compiler interface to construct the Client, all else is the same.
Hey there 👋
At first I didn't know this package existed, but I have also begun a prototype of an Effect and Kysely with a slightly different approach to things. My intent behind this issue is to see if you'd be interested in merging forces 😄
My Prototype
I have put together a prototype integration here - https://github.com/TylorS/typed/blob/ts/poc/kysely/examples/realworld/src/api/common/infrastructure/kysely.ts.
The key difference is the implementation of
@effect/sql
's (used to be sqlfx)Client
interface here. This allows Kysely to use its drivers/dialects and configuration and we'd gain access to any libraries that will pop up supporting the@effect/sql
interfaces directly, including its own.It also provides Kysely's type-safety around the
Sql.schema.*
andSql.resolver.*
methods ensuring that Kysely returns at least (can have additional properties) theEncoded
side of the Schema for proper conversion to theType
of the schema.Right now I only have the postgres connection setup, but it will be quite trivial to support all of the
@effect/sql-*
variants as the only real change is in the @effect/sql-*Compiler
interface to construct theClient
, all else is the same.Links