Module Talon.Schema
Schemas: the names and types of a table's columns.
A schema is an ordered list of columns, each a name and a Type.t, with distinct names. Tables, queries and format descriptions each have one, and a query's is known before any data is read.
type tThe type for schemas.
v columns is the schema of columns, in order. A schema may have no columns, and a column's name may be empty.
Raises Invalid_argument if two columns have the same name, or a name is not valid UTF-8.
columns s is the columns of s, in order. columns (v cs) is cs.
find s name is the type of the column name of s, or None if s has no such column. It costs O(log n) for a schema of n columns.
Comparing
equal s0 s1 is true iff s0 and s1 have the same names with equal types (Type.equal) in the same order.
type change = - #
| Added of string * Type.any(*
*)Added (name, t):s1has the columnnameof typet, ands0has none. - #
| Removed of string * Type.any(*
*)Removed (name, t):s0has the columnnameof typet, ands1has none. - #
| Retyped of string * Type.any * Type.any(*
*)Retyped (name, t0, t1): the columnnamehas the typet0ins0and a different typet1ins1.
The type for the differences between two schemas s0 and s1.