3 ms·
FWIW, Oracle now has data domains that allow more complex constraints, including JSON schema based ones: https://docs.oracle.com/en/database/oracle/oracle-data
by tanelpoder 2y ago
FWIW, Oracle now has data domains that allow more complex constraints, including JSON schema based ones:
https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/create-domain.html https://docs.oracle.com/en/database/oracle/oracle-database/2...
- DaiPlusPlus 2y agoDomain-constraints are just reusable CHECK constraints on steroids :3
- vips7L 2y agoJavaScript is just reusable assembly on steroids.
- tanelpoder 2y agoThere's indeed some comparison there as (as far as I understand) the current implementation of domain constraints all still works on a single table (one column or multicolumn). But the flexible domains (enforce different domains based on a field's value or expression's result) are pretty cool and the JSON-schema based domains could make some (JSON-related) validation things easier out of the box too (I searched the web, looks like Postgres has support for domains too). For more complex cases, one could write (or autogenerate) triggers, but that will likely cause performance and maintenance issues... so the other option is to standardize any important data validation & logic into application code - and that part of application code can be stored procedures if it needs to be close to the database. Edit: Sometimes it's easier to sell the idea of using stored procedures for (data) logic to non-database developers when you call them database APIs instead of stored procedures :-)
- yndoendo 2y agoSide note. Had to setup an Oracle development environment this week. I find the sql shell to be quite bad compared to sqlite shell. Latter can has dynamic scaling with the terminal width while former requires a manually applied fixed width assignment. Even the HMTL5 tools where bad. Creating a table via the UI caused a right pop-out modal that did not properly utilize the web browsers view. Typing in the column name would cause the data type field to be partial visible and selecting the data type caused the column name to be partial visible. My take, expensive solution with inferior tooling based on competition.
- bux93 2y agoOracle is the bane of my existence, and I haven't worked with it for 10+ years. Still scarred.