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

ORM or similar tooling #219

Open
gedw99 opened this issue Oct 3, 2020 · 3 comments
Open

ORM or similar tooling #219

gedw99 opened this issue Oct 3, 2020 · 3 comments

Comments

@gedw99
Copy link

gedw99 commented Oct 3, 2020

I wonder if its possible to use existing SQL DB tools with genji ?

https://github.com/kyleconroy/sqlc

  • Just takes SQL and generates the golang code. So not dependent on anything else.
  • Can hence be used to take migration and generate te golng code for a migration also.
  • The template it uses to generate the code can be easily modified to suit genji

Or https://gitea.com/xorm from gitea project ?

@gedw99 gedw99 changed the title Org or similar tooling ORM or similar tooling Oct 4, 2020
@asdine
Copy link
Collaborator

asdine commented Oct 6, 2020

Good question, I haven't tried any existing ORM yet

@gedw99
Copy link
Author

gedw99 commented Oct 14, 2020

One thing that might be a good one is Ent.

https://entgo.io/
https://entgo.io/docs/privacy/

Why ?

Its code generation based and very easy to use. Its not an ORM that takes over too much.
It enforces authz at the data layer. something genji does not do yet.
Its well used, and has facebook coders working on it.
It has the concept of nodes and edges, rather than inner join etc, and so is more aligned to a degree with genji.
It is all golang.

The thing with all the existing SQL ish tooling for go, is that genji needs a driver layer in order to use any of these tools.
If we liked Ent, then it would not be that hard to add a Ent driver for genji i think.

https://github.com/facebookincubator/ent-contrib

  • shows how it supports graphql easily.
  • shows however that other RPC mechanisms can be added if needed too.

@joe-getcouragenow
Copy link

Ent is not an ORM btw. Its a code generator. Some devs like this and some dont.

Its all comes down to having a working github.com/genjidb/genji/sql/driver.
Like this issue addresses: #338

Then all the various golang ORM and code generators and migration tools can work with them.

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

3 participants