ko_pivot
9 months ago
As an Ent user, I’m surprised to see that as the default ORM. It is graph oriented for better and for worse. No composite primary keys for ‘nodes’ and minimal use of joins (no use?) in the underlying generated SQL. The DX is great, but GORM is a better default IMO.
Nonetheless, great to see a new serious Go meta framework.
endigma
9 months ago
Ent heavily uses joins and does support multi field indices, you should read up on the docs. You can show the queries it’s running using a debug client.
It’s not a Graph DB under the hood and uses any normal relational db quite normally beneath the DX
ko_pivot
9 months ago
> Ent heavily uses joins
I’m specifically talking about this: https://github.com/ent/ent/issues/977.
Devs assume that the `With` methods are adding join clauses but that is not typically the case.
> does support multi field indices
Composite primary keys are useful for reasons other than unique constraints and query speed. For example, CockroachDB uses the primary key to partition rows. Also, at scale, an extra multi-column index in addition to the primary key when the primary key alone could have sufficed can be a meaningful performance degradation.
> not a Graph DB under the hood
No it is not, but because it has a graph ‘mindset’ and does support Gremlin, traditional SQL folks expecting a lightweight ORM (such as Drizzle in the JS world) may not have a good time.
ksajadi
9 months ago
Same here. Go community has a tendency of not using frameworks as much (which I guess is confirmed by the lack of long term maintenance for a lot of Go frameworks), compared to say Ruby. I don't think that is a bad thing. We ended up using Gorm as one of the few frameworks for our web stack and I personally have mixed feelings about it.
On the one hand, it's a very comprehensive ORM (support for different DBs and types of queries, joins, associations, etc). On the other hand, the documentation is not very good and often its behavior leaves you baffled (updates of columns and the associates in different times, for example).
Overall, I think I'd still choose an ORM over writing SQL or quasi-SQL in the code for the sake of maintainability and readability of the code. GORM is the best one around but I wish there were more options.
brodouevencode
9 months ago
Agreed - surprised gorm or something a little more mature wasn't used.