3 ms·
Could you describe what you mean by “leaky” in your experience?
by he0001 7y ago
Could you describe what you mean by “leaky” in your experience?
- kevindong 7y agoFor ORMs, the ORM is theoretically supposed to hide all details of the underlying RDBMS from the developer and only expose a set of common APIs. In actuality, you have to be acutely aware of the subtle differences between the various RDBMS and how they interact with the ORM. Generally the most frequently used functions are fine. But the less frequently used functions (which tend to be some of the most useful functions) may be dramatically different in behavior dependent upon the RDBMS [0]. For tools to generate a schema from code, the common data types are simple since the tooling is usually good enough to handle those common cases. But once you get into the non-trivial types (notably numerical types with custom scale and precision and timestamps), things go haywire very quickly. Another example is that all of the migration tools I've ever used have required the developer to define the model separately from the actual migration code which inevitably causes drift in the schema/migration code at some point. Anyone that tries to define non-trivial relationships between tables/entities using non-SQL code is usually doomed to strange relationships in the RDBMS that'll make it arduous/near-impossible to ever use a different migration tool/ORM. I've seen some horrifying schema designs due to a near religious dependency on ORMs/automatic migration tools (foreign key references to the same table, join tables lacking foreign key constraints, columns intended to be foreign keys lacking a foreign key constraint, tables lacking in primary keys, etc.). [0]: Notice how constraints are deferrable and adding comments onto columns are only available on certain RDBMS. https://sequelize.org/v5/manual/models-definition.html https://sequelize.org/v5/manual/models-definition.html