3 ms·
That bonus bug could be read as the perfect case to argue against using an ORM > .left_join(schema::alert::table.on(view::metric_boundary::boundary_id.eq(schem
by chx 3y ago
That bonus bug could be read as the perfect case to argue against using an ORM
> .left_join(schema::alert::table.on(view::metric_boundary::boundary_id.eq(schema::alert::boundary_id.nullable())))
instead of
> LEFT OUTER JOIN alert ON (alert.boundary_id = metric_boundary.boundary_id)
- orthoxerox 3y agometric_boundary.as("m").join(alert.as("a"), $"a.boundary_id" === $"m.boundary_id") Scala is sometimes dangerously syntax-sweet, but Spark does some things right.
- klabb3 3y agoIs that from an orm? Looks like a query builder to me. The main thing you left out is the type conversions with plain sql. So a fair comparison would include the e2e flow, imo. That said, your point is very much valid because of the nested parentheses - I think the main issue is that SQL is an “infix”(?) dsl? It’s strange because Rust has perfectly good proc macros for this type of stuff.
- epompeii 3y agoIf anything, this experience has made me appreciate Diesel even more! Having strongly typed SQL has prevented these sort of bugs from happening at compile time. The only reason I ran into trouble here was that I went into `unsafe` land without proper precaution. That's on me, not the ORM.