Code Monkey home page Code Monkey logo

effect-kysely's People

Contributors

fredx87 avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

effect-kysely's Issues

Import path issues

I'm giving this lib a try and I was having some issues w/ the import path. I currently have to add this to my ts config for ts to accept that "effect-kysely/sqlfx" is a path that exists. lol.

"compilerOptions": {
    "paths": {
        "effect-kysely/*": [
            "node_modules/effect-kysely/dist/*"
        ]
    }
}

Also, importing from "effect-kysely/dist/sqlfx" makes ts happy without the code above but breaks (at least) bun test.

Implementation of @effect/sql's Client interface

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.* 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.

Links

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.