Documentation
¶
Overview ¶
Package sql3util implements SQLite utilities.
Index ¶
- func NamedArg(arg string) (key, val string)
- func ParseBool(s string) (b, ok bool)
- func ParseFloat(s string) (f float64, ok bool)
- func ParseTimeShift(s string) (years, months, days int, duration time.Duration, ok bool)
- func Unquote(val string) string
- func ValidPageSize(s int) bool
- type Column
- type ConflictClause
- type FKAction
- type FKDefType
- type ForeignKey
- type OrderClause
- type StatementType
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NamedArg ¶
NamedArg splits an named arg into a key and value, around an equals sign. Spaces are trimmed around both key and value.
func ParseFloat ¶ added in v0.30.4
ParseFloat parses a decimal floating point number.
func ParseTimeShift ¶ added in v0.30.4
ParseTimeShift parses a time shift modifier, also the output of timediff.
func ValidPageSize ¶
ValidPageSize returns true if s is a valid page size.
Types ¶
type Column ¶
type Column struct {
Name string
Type string
Length string
ConstraintName string
Comment string
IsPrimaryKey bool
IsAutoIncrement bool
IsNotNull bool
IsUnique bool
PKOrder OrderClause
PKConflictClause ConflictClause
NotNullConflictClause ConflictClause
UniqueConflictClause ConflictClause
CheckExpr string
DefaultExpr string
CollateName string
ForeignKeyClause *ForeignKey
}
Column holds metadata about a column.
type ConflictClause ¶
type ConflictClause uint32
const ( CONFLICT_NONE ConflictClause = iota CONFLICT_ROLLBACK CONFLICT_ABORT CONFLICT_FAIL CONFLICT_IGNORE CONFLICT_REPLACE )
type ForeignKey ¶
type OrderClause ¶
type OrderClause uint32
const ( ORDER_NONE OrderClause = iota ORDER_ASC ORDER_DESC )
type StatementType ¶
type StatementType uint32
const ( CREATE_UNKNOWN StatementType = iota CREATE_TABLE ALTER_RENAME_TABLE ALTER_RENAME_COLUMN ALTER_ADD_COLUMN ALTER_DROP_COLUMN )
type Table ¶
type Table struct {
Name string
Schema string
Comment string
IsTemporary bool
IsIfNotExists bool
IsWithoutRowID bool
IsStrict bool
Columns []Column
Type StatementType
CurrentName string
NewName string
}
Table holds metadata about a table.
func ParseTable ¶
ParseTable parses a CREATE or ALTER TABLE command.
Click to show internal directories.
Click to hide internal directories.