Giter Club home page Giter Club logo

Comments (7)

koskimas avatar koskimas commented on May 11, 2024 2

What prevents you from using that library using npx? I agree something like that would be a nice feature, but does writing a simple interface per table really take a significant portion of the development time? I can only imagine it does if you are writing a very simple crud.

While something like this would be a nice feature, It's a lot of work to write and maintain it. It would be helpful for people migrating an existing codebase to Kysely though.

Kysely already has the db.introspection module, which could be used to implement this.

from kysely.

martinblostein avatar martinblostein commented on May 11, 2024 1

To be fair, if sql-ts really works, code would not have to to be copy pasted. Instead Kysely could include sql-ts as an optional dependency.

And there is a benefit beyond saving time: automatic generation prevent errors when creating the type interfaces.

from kysely.

mmahalwy avatar mmahalwy commented on May 11, 2024

Nothing prevents. It was a suggestion!

from kysely.

koskimas avatar koskimas commented on May 11, 2024

What I meant was, if that library already does what you need, why not use it to create the interfaces for Kysely? If it works, why would we need to copy paste the code to Kysely?

from kysely.

koskimas avatar koskimas commented on May 11, 2024

sql-ts has a CLI you can run using npx without installing anything locally.

from kysely.

mmahalwy avatar mmahalwy commented on May 11, 2024

Yeah, they dont need to depend on each other. They can work in parallel where we simple import the types from the generated sql-ts file.

import { Person, Pet, Movie } from './sql-ts-generated';

interface Database {
  person: Person
  pet: Pet
  movie: Movie
}

from kysely.

martinblostein avatar martinblostein commented on May 11, 2024

Sure, I was just saying that sql-ts could be integrated without copy and pasting code. If you don't want to go that route, no worries.

from kysely.

Related Issues (20)

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.