Documentation ¶
Index ¶
- Constants
- type Array
- type BinaryExpr
- type CaseValueWhen
- type Column
- type Constant
- type CurrentTimestamp
- type Expr
- type FuncExpr
- type GetVariable
- type Interval
- type IntervalUnit
- type Name
- type Op
- type Overlay
- type ParenExpr
- type Parser
- type QName
- type RowNum
- type SetVariable
- type StringUnit
- type SubRowNum
- type Subscript
- type Substring
- type SyntaxError
- type Table
- type Template
- type Timestamp
- type UnaryExpr
- type When
Constants ¶
View Source
const ( IntervalUnitWeek = IntervalUnit(7 * 24 * time.Hour) IntervalUnitDay = IntervalUnit(24 * time.Hour) IntervalUnitHour = IntervalUnit(time.Hour) IntervalUnitMinute = IntervalUnit(time.Minute) IntervalUnitSecond = IntervalUnit(time.Second) IntervalUnitMillisecond = IntervalUnit(time.Millisecond) IntervalUnitMicrosecond = IntervalUnit(time.Microsecond) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryExpr ¶
func (*BinaryExpr) String ¶
func (expr *BinaryExpr) String() string
type CaseValueWhen ¶
func (*CaseValueWhen) String ¶
func (c *CaseValueWhen) String() string
type Column ¶
type Column struct { // Name is the name of the column. It is the first identifier before the // {{}} and /*{{}}*/ block. It can be empty if no identifier is found, // which means an anonymous column. // // e.g. `CREATE TABLE t ( /*{{ rownum }}*/ )` has an anonymous column. Name Name // Expr is the expression in the stmt block. Expr Expr }
Column represents a column definition in a table.
type CurrentTimestamp ¶
type CurrentTimestamp struct{}
func (*CurrentTimestamp) String ¶
func (*CurrentTimestamp) String() string
type GetVariable ¶
type GetVariable struct {
Name string
}
func (*GetVariable) String ¶
func (gv *GetVariable) String() string
type Interval ¶
type Interval struct { Unit IntervalUnit Value Expr }
type IntervalUnit ¶
func (IntervalUnit) String ¶
func (u IntervalUnit) String() string
type Name ¶
type Name struct { // O is the original name. O string // N is the normalized name. It is lower case, without quotation marks. N string }
Name represents a name parsed from a template.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser is a parser for templates.
type QName ¶
type QName struct { // Parts represents the name parts of a schema-qualified name. Parts []Name }
QName is schema-qualified name with quotation marks still intact. e.g. "db"."schema"."table".
func (*QName) SchemaName ¶
func (*QName) UniqueName ¶
type SetVariable ¶
func (*SetVariable) String ¶
func (sv *SetVariable) String() string
type StringUnit ¶
type StringUnit int
StringUnit specifies how to index a (byte) string.
const ( // StringUnitCharacters indexes the string using characters (code points). StringUnitCharacters StringUnit = iota + 1 // StringUnitOctets indexes the string using bytes (code unit). StringUnitOctets )
type SyntaxError ¶
func (*SyntaxError) Error ¶
func (e *SyntaxError) Error() string
type Table ¶
type Table struct { Name *QName // Content is the content of whole create table statement // with the {{}} and /*{{}}*/ blocks removed. Content string // Columns is the list of columns in the table. Columns []*Column // Derived is the indices of derived tables and the number of rows to generate. Derived []lo.Tuple2[int, Expr] }
Table represents a table in a template.
Click to show internal directories.
Click to hide internal directories.