Documentation ¶
Index ¶
- Constants
- Variables
- func ColumnDefinition(columns TableColumns) (statement string)
- func GetAll() map[string]Table
- func Register(tp Table, pluginName string) error
- func SensibleComparison(columnType int, op sqlite3.Op) bool
- type Column
- type Constraint
- type ConstraintSet
- type Constraints
- type Pair
- type QueryContext
- type Table
- type TableColumns
- type TableRow
- type TableRows
- type UsedColumns
Constants ¶
View Source
const ( /// Default/no options. DEFAULT = 0 /// Treat this column as a primary key. INDEX = 1 /// This column MUST be included in the github.com/dean2021/sysql predicate. REQUIRED = 2 /* * @brief This column is used to generate additional information. * * If this column is included in the github.com/dean2021/sysql predicate, the tables will generate * additional information. Consider the browser_plugins or shell history * tables: by default they list the tables or history relative to the user * running the github.com/dean2021/sysql. However, if the calling github.com/dean2021/sysql specifies a UID explicitly * in the predicate, the meaning of the tables changes and results for that * user are returned instead. */ ADDITIONAL = 4 /* * @brief This column can be used to optimize the github.com/dean2021/sysql. * * If this column is included in the github.com/dean2021/sysql predicate, the tables will generate * optimized information. Consider the system_controls tables, a default filter * without a github.com/dean2021/sysql predicate lists all of the keys. When a specific domain is * included in the predicate then the tables will only issue syscalls/lookups * for that domain, greatly optimizing the time and utilization. * * This optimization does not mean the column is an index. */ OPTIMIZED = 8 /// This column should be hidden from '*” selects. HIDDEN = 16 )
View Source
const ( EQUALS = 2 GREATER_THAN = 4 LESS_THAN_OR_EQUALS = 8 LESS_THAN = 16 GREATER_THAN_OR_EQUALS = 32 MATCH = 64 LIKE = 65 GLOB = 66 REGEXP = 67 UNIQUE = 1 )
ConstraintOperator
View Source
const ( UNKNOWN_TYPE int = iota TEXT_TYPE INTEGER_TYPE BIGINT_TYPE UNSIGNED_BIGINT_TYPE DOUBLE_TYPE BLOB_TYPE )
Variables ¶
View Source
var ColumnOptionsNames = map[int]string{ HIDDEN: "HIDDEN", OPTIMIZED: "OPTIMIZED", ADDITIONAL: "ADDITIONAL", REQUIRED: "REQUIRED", INDEX: "INDEX", DEFAULT: "DEFAULT", }
View Source
var ColumnTypeNames = map[int]string{ UNKNOWN_TYPE: "UNKNOWN", TEXT_TYPE: "TEXT", INTEGER_TYPE: "INTEGER", BIGINT_TYPE: "BIGINT", UNSIGNED_BIGINT_TYPE: "UNSIGNED BIGINT", DOUBLE_TYPE: "DOUBLE", BLOB_TYPE: "BLOB", }
Functions ¶
func ColumnDefinition ¶
func ColumnDefinition(columns TableColumns) (statement string)
func SensibleComparison ¶
Types ¶
type Constraint ¶
type Constraint struct { Name string Op sqlite3.Op Expr interface{} }
type ConstraintSet ¶
type ConstraintSet []Constraint
type Constraints ¶
type Constraints []Constraint
func (*Constraints) Count ¶
func (c *Constraints) Count(columnName string) int
func (*Constraints) GetAll ¶
func (c *Constraints) GetAll(columnName string, op int) []interface{}
func (*Constraints) Size ¶
func (c *Constraints) Size() int
type QueryContext ¶
type QueryContext struct {
Constraints Constraints
}
type Table ¶
type Table interface { Name() string Columns() TableColumns Generate(context *QueryContext) (TableRows, error) }
type TableColumns ¶
type TableColumns []Column
type UsedColumns ¶
type UsedColumns []string
Click to show internal directories.
Click to hide internal directories.