aboutsummaryrefslogtreecommitdiffhomepage
path: root/demo
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-09-13 12:00:34 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-09-13 12:00:34 -0400
commit3120f9ddb17494dc36d7a329c28dc587be55de77 (patch)
tree79d8cd5ca5daae30ad0d2bdbc1ba789d485f3615 /demo
parent98b889b93a2ab366f002bc0607063e56bb3e6339 (diff)
Have nullable columns working with Dbgrid
Diffstat (limited to 'demo')
-rw-r--r--demo/more/grid1.ur11
-rw-r--r--demo/more/grid1.urp1
2 files changed, 8 insertions, 4 deletions
diff --git a/demo/more/grid1.ur b/demo/more/grid1.ur
index 4d0fe1bf..ea0dcbd5 100644
--- a/demo/more/grid1.ur
+++ b/demo/more/grid1.ur
@@ -4,7 +4,7 @@ table t1 : {Id : int, A : string}
PRIMARY KEY Id
sequence s
-table t : {Id : int, A : int, B : string, C : bool, D : int, E : option int}
+table t : {Id : int, A : int, B : string, C : bool, D : int, E : option int, F : option int}
PRIMARY KEY Id,
CONSTRAINT Foreign FOREIGN KEY (D) REFERENCES t1(Id) ON DELETE CASCADE
@@ -25,6 +25,8 @@ open Make(struct
D = {New = return 0,
Inj = _},
E = {New = return None,
+ Inj = _},
+ F = {New = return None,
Inj = _}}
structure F = Direct.Foreign(struct
@@ -34,11 +36,12 @@ open Make(struct
end)
val cols = {Id = Direct.readOnly [#Id] ! "Id" Direct.int,
- A = Direct.editable [#A] ! "A" Direct.int,
+ (*A = Direct.editable [#A] ! "A" Direct.int,
B = Direct.editable [#B] ! "B" Direct.string,
- C = Direct.editable [#C] ! "C" Direct.bool(*,
- D = Direct.editable [#D] ! "D" F.meta,
+ C = Direct.editable [#C] ! "C" Direct.bool,
+ D = Direct.editable [#D] ! "D" F.meta,*)
E = Direct.editable [#E] ! "E" (Direct.nullable Direct.int),
+ F = Direct.editable [#F] ! "F" (Direct.nullable F.meta)(*,
DA = computed "2A" (fn r => 2 * r.A),
Link = computedHtml "Link" (fn r => <xml><a link={page (r.A, r.B)}>Go</a></xml>)*)}
end)
diff --git a/demo/more/grid1.urp b/demo/more/grid1.urp
index 5fc18139..a4f33375 100644
--- a/demo/more/grid1.urp
+++ b/demo/more/grid1.urp
@@ -1,3 +1,4 @@
+debug
database dbname=test
library grid
sql grid.sql