Skip to content
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

Prisma ORM for Dart 3.0 #68

Closed
Tracked by #216
medz opened this issue Nov 26, 2022 · 3 comments
Closed
Tracked by #216

Prisma ORM for Dart 3.0 #68

medz opened this issue Nov 26, 2022 · 3 comments
Assignees

Comments

@medz
Copy link
Owner

medz commented Nov 26, 2022

Due to the limitation of the Dart language, many functions of Prisma ORM for Dart cannot be realized, the most common ones are select, include.

There are many other problems:

  1. Codegen is too complex
  2. Difficult to add new features

The guesses for the v3 version are as follows:

  1. Give up type safety and use Map
  2. Give up building a private client and use Prisma DMMF to build a general client
  3. Abandon the binary engine (although it supports conventional platforms and architectures, but it is troublesome for serverless or Docker), and build a brand new engine suitable for Dart.
  4. For parameter input, use chain reaction to build
@medz medz self-assigned this Nov 26, 2022
@medz
Copy link
Owner Author

medz commented Dec 20, 2022

For 3.0, there are the following technical requirements:

  1. Dart SDK requires 3.0 (better for copying Prisma TS/JS client)
  2. Looking for a better JSON serialization build Abandon the build_* ecological package from the project
  3. Provide a complete Prisma C API implementation, discarding the binary query engine

@wstrange
Copy link

It would be great to see the engine implemented in pure Dart, even if it only means supporting a subset of databases and features (postgres, sqllite?).

The binary engine makes packaging and distribution harder (can't just compile a pure dart server). I suspect it would make debugging easier as well (no binary interface to cross).

@medz
Copy link
Owner Author

medz commented Mar 14, 2023

It would be great to see the engine implemented in pure Dart, even if it only means supporting a subset of databases and features (postgres, sqllite?).

The binary engine makes packaging and distribution harder (can't just compile a pure dart server). I suspect it would make debugging easier as well (no binary interface to cross).

@wstrange Now the problem is, I'm an introductory Rust learner. I tried writing a dynamic engine library to make it behave better with the engine, but I couldn't solve the upstream breaking issue.

prisma/prisma-engines#3757

This issue has already flagged how to fix the upstream breakage, and I think it will be a long time before that happens.

In addition, Dart3's macro support release date is undecided, and Union-Types does not know whether it will appear in Dart 3 within this year, because it is still making proposals.

Under the current limited conditions, I can only do the engine client based on maximizing parameter selection and cannot fully realize all the requirements of Prisma (unless I use Map)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants