-
-
Save cultleader777/3823ccef5c22b4b086c2468ab9e2e89c to your computer and use it in GitHub Desktop.
Detached defaults in EdenDB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TABLE server { | |
hostname TEXT PRIMARY KEY, | |
tld REF tld DETACHED DEFAULT, | |
fqdn TEXT GENERATED AS { hostname .. "." .. tld }, | |
} | |
TABLE tld { | |
domain TEXT PRIMARY KEY, | |
} | |
DEFAULTS { | |
// defines default for table 'server' and column 'tld'. | |
// you cannot define defaults for non existing tables | |
// and column must be marked as detached default | |
server.tld epl-infra.net, | |
} | |
// now we can define data with detached default | |
DATA STRUCT server { | |
hostname: server-a | |
} | |
DATA tld { | |
epl-infra.net; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment