Documentation
¶
Overview ¶
Package datatable is a query's result in one shape every step and chat can read (spec_059_data DAT-01..DAT-05): its columns with portable types, its rows as arrays in the columns' order, its values as JSON's.
Index ¶
Constants ¶
const ( String = "string" Integer = "integer" Number = "number" Boolean = "boolean" Date = "date" Time = "time" Timestamp = "timestamp" JSON = "json" Bytes = "bytes" Other = "other" )
The portable types (DAT-02): the same across databases.
const MarkdownRows = 50
MarkdownRows is how many rows Markdown shows (DAT-05).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Column ¶
type Column struct {
Name string `json:"name"`
Description string `json:"description"`
Type string `json:"type"`
Length *int64 `json:"length"`
DBType string `json:"db_type,omitempty"`
Nullable *bool `json:"nullable,omitempty"`
}
Column is a result's column: its name, its schema's comment, its portable type and declared length (nil when it has none), and the database's own type and whether it may be NULL (nil when unsaid).
type RowItem ¶
type RowItem struct {
Index int `json:"index"`
Row map[string]any `json:"row"`
Columns []Column `json:"columns"`
}
RowItem is one row standing alone (DAT-04): its place in the result, its values by column name, and its columns.
type Table ¶
type Table struct {
Columns []Column `json:"columns"`
Rows [][]any `json:"rows"`
Total int `json:"total"`
Truncated bool `json:"truncated"`
}
Table is a query's result (DAT-01): Total is how many rows it holds, Truncated whether a limit cut the query's rows there.