Skip to content

Commit 5df5543

Browse files
committed
postgres range
1 parent 5c473bd commit 5df5543

File tree

1 file changed

+36
-13
lines changed

1 file changed

+36
-13
lines changed

wit/postgres.wit

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,33 +54,33 @@ interface postgres {
5454
}
5555

5656
record int4range {
57-
start: int4bound,
58-
end: int4bound
57+
start: int4bound,
58+
end: int4bound
5959
}
6060

6161
record int8range {
62-
start: int8bound,
63-
end: int8bound
62+
start: int8bound,
63+
end: int8bound
6464
}
6565

6666
record numrange {
67-
start: numbound,
68-
end: numbound
67+
start: numbound,
68+
end: numbound
6969
}
7070

7171
record tsrange {
72-
start: tsbound,
73-
end: tsbound
72+
start: tsbound,
73+
end: tsbound
7474
}
7575

7676
record tstzrange {
77-
start: tstzbound,
78-
end: tstzbound
77+
start: tstzbound,
78+
end: tstzbound
7979
}
8080

8181
record daterange {
82-
start: datebound,
83-
end: datebound
82+
start: datebound,
83+
end: datebound
8484
}
8585

8686
record enumeration-type {
@@ -112,6 +112,27 @@ interface postgres {
112112
value: lazy-db-value
113113
}
114114

115+
record range-type {
116+
name: string,
117+
base-type: lazy-db-column-type
118+
}
119+
120+
variant value-bound {
121+
included(lazy-db-value),
122+
excluded(lazy-db-value),
123+
unbounded
124+
}
125+
126+
record values-range {
127+
start: value-bound,
128+
end: value-bound
129+
}
130+
131+
record range {
132+
name: string,
133+
value: values-range
134+
}
135+
115136
variant db-column-type {
116137
character,
117138
int2,
@@ -152,7 +173,8 @@ interface postgres {
152173
enumeration(enumeration-type),
153174
composite(composite-type),
154175
domain(domain-type),
155-
array(lazy-db-column-type)
176+
array(lazy-db-column-type),
177+
range(range-type)
156178
}
157179

158180
variant db-value {
@@ -196,6 +218,7 @@ interface postgres {
196218
composite(composite),
197219
domain(domain),
198220
array(list<lazy-db-value>),
221+
range(range),
199222
null
200223
}
201224

0 commit comments

Comments
 (0)