Created
May 13, 2018 23:31
-
-
Save ItsDoot/4da640efff6db9fcbcc374516b8b486f to your computer and use it in GitHub Desktop.
sql framework experiment
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
shared object serversTable extends Table<String|Boolean,[String, Boolean]>("servers") { | |
Column<String> name => Column<String>("name"); | |
Column<Boolean> online => Column<Boolean>("online"); | |
shared actual [Column<String>, Column<Boolean>] columns => [name, online]; | |
} |
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
shared abstract class Table<Col, Columns>(name) | |
given Columns satisfies Col[] { | |
shared String name; | |
shared formal Column<Col>[] columns; | |
shared class Column<out Value>(name, default = null) | |
given Value satisfies Col { | |
shared String name; | |
shared Value? default; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment