Skip to content

Commit

Permalink
postgres - range
Browse files Browse the repository at this point in the history
  • Loading branch information
justcoon committed Jan 9, 2025
1 parent 9aa51de commit 9068329
Showing 1 changed file with 36 additions and 13 deletions.
49 changes: 36 additions & 13 deletions wit/deps/rdbms/postgres.wit
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,33 @@ interface postgres {
}

record int4range {
start: int4bound,
end: int4bound
start: int4bound,
end: int4bound
}

record int8range {
start: int8bound,
end: int8bound
start: int8bound,
end: int8bound
}

record numrange {
start: numbound,
end: numbound
start: numbound,
end: numbound
}

record tsrange {
start: tsbound,
end: tsbound
start: tsbound,
end: tsbound
}

record tstzrange {
start: tstzbound,
end: tstzbound
start: tstzbound,
end: tstzbound
}

record daterange {
start: datebound,
end: datebound
start: datebound,
end: datebound
}

record enumeration-type {
Expand Down Expand Up @@ -112,6 +112,27 @@ interface postgres {
value: lazy-db-value
}

record range-type {
name: string,
base-type: lazy-db-column-type
}

variant value-bound {
included(lazy-db-value),
excluded(lazy-db-value),
unbounded
}

record values-range {
start: value-bound,
end: value-bound
}

record range {
name: string,
value: values-range
}

variant db-column-type {
character,
int2,
Expand Down Expand Up @@ -152,7 +173,8 @@ interface postgres {
enumeration(enumeration-type),
composite(composite-type),
domain(domain-type),
array(lazy-db-column-type)
array(lazy-db-column-type),
range(range-type)
}

variant db-value {
Expand Down Expand Up @@ -196,6 +218,7 @@ interface postgres {
composite(composite),
domain(domain),
array(list<lazy-db-value>),
range(range),
null
}

Expand Down

0 comments on commit 9068329

Please sign in to comment.