-
Notifications
You must be signed in to change notification settings - Fork 2
/
exploration.pike
32 lines (28 loc) · 915 Bytes
/
exploration.pike
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
int main() {
object sql = Sql.Sql("mysql://root@localhost/interSync");
object schema = SyncDB.Schema(
SyncDB.Types.Integer("id", SyncDB.Flags.Key(),
SyncDB.Flags.Automatic(),
SyncDB.Flags.Join(([ "two" : "id" ]))),
SyncDB.Types.String("name"),
SyncDB.Types.String("email"),
// two
SyncDB.Types.Range("date",
SyncDB.Types.Date("startdate", Calendar.Second),
SyncDB.Types.Date("stopdate", Calendar.Second)
),
SyncDB.Types.String("firstname",
SyncDB.Flags.Foreign("two", "firstname")),
SyncDB.Types.String("lastname",
SyncDB.Flags.Foreign("two", "lastname"))
);
object table = SyncDB.MySQL.Table("one", sql, schema, "one");
add_constant("sql", sql);
add_constant("schema", schema);
add_constant("table", table);
void PR(mixed ... args) {
werror("%O\n", args);
};
add_constant("pr", PR);
Tools.Hilfe.StdinHilfe();
}