chaisql / chai

Modern embedded SQL database
MIT License
1.57k stars 95 forks source link

ORM or similar tooling #219

Open gedw99 opened 4 years ago

gedw99 commented 4 years ago

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

https://github.com/kyleconroy/sqlc

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

asdine commented 4 years ago

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

gedw99 commented 4 years ago

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

joe-getcouragenow commented 3 years ago

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: https://github.com/genjidb/genji/issues/338

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