Skip to content

Instantly share code, notes, and snippets.

@cultleader777
Created June 7, 2023 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cultleader777/41210e58026a0bec29f7e014945e40b0 to your computer and use it in GitHub Desktop.
Save cultleader777/41210e58026a0bec29f7e014945e40b0 to your computer and use it in GitHub Desktop.
EdenDB improvements - ref foreign child
TABLE server {
hostname TEXT PRIMARY KEY,
}
TABLE server_volume {
volume_name TEXT PRIMARY KEY CHILD OF server,
mountpoint TEXT,
}
DATA server(hostname) {
server-a WITH server_volume {
pgtest1, '/srv/volumes/pgtest1';
};
server-b WITH server_volume {
pgtest1, '/srv/volumes/pgtest1';
};
}
TABLE db_deployment {
deployment_name TEXT PRIMARY KEY,
}
TABLE db_deployment_instance {
deployment_id INT PRIMARY KEY CHILD OF db_deployment,
db_server REF FOREIGN CHILD server_volume,
CHECK { deployment_id > 0 },
}
DATA STRUCT db_deployment [
{
deployment_name: foo WITH db_deployment_instance [
{
deployment_id: 1,
db_server: server-a=>pgtest1,
},
{
deployment_id: 2,
db_server: server-b=>pgtest1,
},
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment