Replies: 3 comments
-
It would be also really cool to switch them:
And we also need some kind of Upgrade instructions (EVENTS) to manage the data while an definition upgrade is made:
Or maybe/also something like this:
Layer updates should be performed in an transaction and if failed they will automatically rollback. Imagine you have thousands of namespaces and all databases need to be in sync, you will have no chance without such a system, or am i wrong? |
Beta Was this translation helpful? Give feedback.
-
are you suggesting aspecting in DB 🫨 (because I imagine the security side of this is not going to make it easy to implement). DEFINE EVENT eventname ON TABLE sometable
WHEN $event = "CREATE" THEN {
-- this is an atomic operation and it will fail adding to the original table if something fails inside the event
}; at least partially. |
Beta Was this translation helpful? Give feedback.
-
I thought about a nearly equal thing as something like templating repeating definitions in this post. But in this Post it seems to go deeper to layer everything, not only tables, like in my post. But in addition to this post it should be useful to combine Layers to build modular definitions. I tried to write a function which defines fields with dynamic table name, but it seems not to be possible to provide a dynamic table name like: DEFINE FUNCTION fn::CREATION_FIELDS($table: string) {
DEFINE FIELD created_at ON $table
TYPE datetime
DEFAULT time::now()
PERMISSIONS FOR select FULL FOR create, update NONE
} This could be an alternative way but with DEFINE LAYER or DEFINE TEMPLATE style it would be a more user/db-admin friendlier way, I think. It feels a little bit like class and interface definitions in object orientated programming languages. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It would be nice to see a new type of DEFINE LAYER to manage defaults for any kind of definition, e.g. when creating a namespace, database, table or field. In simplicity i was looking for something like this:
When upgrading the layer emailAddress with a new version the defined field will not change but can be updated manually:
Or using auto upgrade mechanism by default:
Another main idea is to create defaults for namespaces like automatically create or upgrade databases/tables and so on:
Is somthing planned or on the todo-list of this great project?
Beta Was this translation helpful? Give feedback.
All reactions