-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
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
v1 #1
Comments
Following this 👀 Thanks for your work. |
Amazing work! Looking forward to the SQLite support. |
@octalpixel I've just added the SQLite adapter on v0.5.0, feel free to check out and let me know if there's a problem |
Thanks for the ping. Will check this out later today. |
Hey tried this now on a quick sample project with two tables and it works well! Thanks for this! Will do a bit more a bigger schema. |
I know this a bit unrela
Ik this a bit unrelated but I tried this on React Native Project, and there is require cycle. This because categories and transaction import each other for relationships. How about an optional flag to define all the relationship in another file ? |
Thanks for noticing! Just released the patch v0.5.2 where you can add generator drizzle {
provider = "prisma-generator-drizzle"
relationalQuery = false
} A proper fix would be to simply separate the definition to a separate file later |
Thanks! I believe this is one way of solving it. Also just looking at your patch at the moment and train of thought.Maybe not the best, but here is a thought dump
|
It would be great if this lib also properly handled @ignore and @@ignore. Basically don't pull these columns and/or tables into the generated schema(s). |
Yeah that seems simple. |
So just wanted to report an experiment that I did. After trying out your lib, an idea sparked in my head. WHAT IF we introspect the database using drizzlekit to actually pull in the schema. I tried this with a local sqlite db, and db pushed the schema to it using prisma and introspected it with drizzlekit. This is what I got. PS: Disregard the table names being title case :D From introspect
From the generator
Off scope for you: One thing I noticed that prisma doesn't play well with enum of sqlite (Probably something you can look into). If i remember correctly Sqlite enums are done using CHECKS in sql so in one way doesnt make sense ? Also drizzle-team/drizzle-orm#636 seems to be solved with incorrect relationships. So I guess in theory the introspect should work ? |
That's actually also my initial hack a while ago, and it is a good one! (depends on the stability of db pull tho) However the downside for this solution is that it requires an active database connection, meaning it requires another setup and it became more complex when managing with multiple branches. Therefore since Prisma already have their DMMF helper, as well as other packages like the nexus, zod, typegraphql, pothos, etc.. uses this technique to map Prisma with their features, it'd be safer use the proven pipeline like the others.
Fyi I'm not really familiar for this. Currently the goal of this library is to provide all features that Prisma has — excluding unsupported features like the ENUMs in sqlite. Once Prisma has the support, we could reliably map the feature to drizzle. So if you'd like to use one that drizzle has already supported, I think you could generate and commit the result. However it requires you to maintain the modified schema everytime the script generates the schema, I think this could be a feature that we could look in the future. Also I think this is where the |
Definitely! Thanks for your insights on this! I empathize with the fact that extra setup is needed for a case like such. My thought process if purely SQLite based. Thats where your libs value prop lies for me. Really love what Prisma Schema has to offer for the DX when setting up the database. Looking to use Prisma as the schema generator, more sort of like where some devs use Prisma + Kysely. |
Thanks also for the suggestion! keep it coming |
Also! I forgot to mention you have another value prop. You generate the relationships as well where the introspect does not drizzle-team/drizzle-kit-mirror#202 |
Hi! Are default values currently in development? I'd want to use the package, but unfortunately default values of identifiers aren't set properly, so typescript wants me to set ID on every insert, kinda annoying! |
On it #22 |
Hey @farreldarian with the inclusion of defaults support, could you push a new version? |
I'm planning to address #18 and add bytes support for the 0.6.0, but I've just published a canary release If you'd like to try out |
Hi, this works great with general default values, but unfourtenately this didn't solve the id issues. |
Defining In this case I recommend using the UPDATE |
Looks great! Could you provide a canary version for now to test it out? Thanks! |
Just released v0.6.0 🚀 |
Planned Features
These are the essential features needed for querying and mutating purposes, providing 1:1 feature mapping from Prisma. Please mention if there's anything missed from this list.
Models
notNull
(when no ? modifier)@db.
fieldHelpers
$type<...>()
defined from Prisma schemaConfig
Not planned
v1 will concentrates exclusively on query and mutation operations, these parts are currently not on consideration:
The text was updated successfully, but these errors were encountered: