This commit is contained in:
parent
e5e78068f0
commit
e57af981ea
24
src/database.jmc
Normal file
24
src/database.jmc
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
@lazy //takes name of table. metadata must already exist.
|
||||||
|
function createTable(name) {
|
||||||
|
say "initialzing table: $name...";
|
||||||
|
Array.forEach(
|
||||||
|
"ferdinland:ferdinland",
|
||||||
|
"database.tables.$name.fields",
|
||||||
|
()=>{say "::database.tables.$name.fields[0]";}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class database {
|
||||||
|
@add(__load__)
|
||||||
|
function __init__() {}
|
||||||
|
|
||||||
|
@add(this.__init__)
|
||||||
|
function schema() {}
|
||||||
|
|
||||||
|
@add(this.schema)
|
||||||
|
function tables.myTable() {
|
||||||
|
::database.tables.myTable.name = "myTable";
|
||||||
|
::database.tables.myTable.fields = ["one", "two"];
|
||||||
|
createTable(myTable);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user