103 lines
3.0 KiB
Go
103 lines
3.0 KiB
Go
//
|
|
// Code generated by go-jet DO NOT EDIT.
|
|
//
|
|
// WARNING: Changes to this file may cause incorrect behavior
|
|
// and will be lost if the code is regenerated
|
|
//
|
|
|
|
package table
|
|
|
|
import (
|
|
"github.com/go-jet/jet/v2/sqlite"
|
|
)
|
|
|
|
var Expert = newExpertTable("", "expert", "")
|
|
|
|
type expertTable struct {
|
|
sqlite.Table
|
|
|
|
// Columns
|
|
ID sqlite.ColumnInteger
|
|
UID sqlite.ColumnString
|
|
SecUID sqlite.ColumnString
|
|
ShortID sqlite.ColumnString
|
|
RealName sqlite.ColumnString
|
|
NickName sqlite.ColumnString
|
|
State sqlite.ColumnString
|
|
Since sqlite.ColumnInteger
|
|
Config sqlite.ColumnString
|
|
ConfigAt sqlite.ColumnInteger
|
|
|
|
AllColumns sqlite.ColumnList
|
|
MutableColumns sqlite.ColumnList
|
|
}
|
|
|
|
type ExpertTable struct {
|
|
expertTable
|
|
|
|
EXCLUDED expertTable
|
|
}
|
|
|
|
// AS creates new ExpertTable with assigned alias
|
|
func (a ExpertTable) AS(alias string) *ExpertTable {
|
|
return newExpertTable(a.SchemaName(), a.TableName(), alias)
|
|
}
|
|
|
|
// Schema creates new ExpertTable with assigned schema name
|
|
func (a ExpertTable) FromSchema(schemaName string) *ExpertTable {
|
|
return newExpertTable(schemaName, a.TableName(), a.Alias())
|
|
}
|
|
|
|
// WithPrefix creates new ExpertTable with assigned table prefix
|
|
func (a ExpertTable) WithPrefix(prefix string) *ExpertTable {
|
|
return newExpertTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
|
}
|
|
|
|
// WithSuffix creates new ExpertTable with assigned table suffix
|
|
func (a ExpertTable) WithSuffix(suffix string) *ExpertTable {
|
|
return newExpertTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
|
}
|
|
|
|
func newExpertTable(schemaName, tableName, alias string) *ExpertTable {
|
|
return &ExpertTable{
|
|
expertTable: newExpertTableImpl(schemaName, tableName, alias),
|
|
EXCLUDED: newExpertTableImpl("", "excluded", ""),
|
|
}
|
|
}
|
|
|
|
func newExpertTableImpl(schemaName, tableName, alias string) expertTable {
|
|
var (
|
|
IDColumn = sqlite.IntegerColumn("id")
|
|
UIDColumn = sqlite.StringColumn("uid")
|
|
SecUIDColumn = sqlite.StringColumn("sec_uid")
|
|
ShortIDColumn = sqlite.StringColumn("short_id")
|
|
RealNameColumn = sqlite.StringColumn("real_name")
|
|
NickNameColumn = sqlite.StringColumn("nick_name")
|
|
StateColumn = sqlite.StringColumn("state")
|
|
SinceColumn = sqlite.IntegerColumn("since")
|
|
ConfigColumn = sqlite.StringColumn("config")
|
|
ConfigAtColumn = sqlite.IntegerColumn("config_at")
|
|
allColumns = sqlite.ColumnList{IDColumn, UIDColumn, SecUIDColumn, ShortIDColumn, RealNameColumn, NickNameColumn, StateColumn, SinceColumn, ConfigColumn, ConfigAtColumn}
|
|
mutableColumns = sqlite.ColumnList{UIDColumn, SecUIDColumn, ShortIDColumn, RealNameColumn, NickNameColumn, StateColumn, SinceColumn, ConfigColumn, ConfigAtColumn}
|
|
)
|
|
|
|
return expertTable{
|
|
Table: sqlite.NewTable(schemaName, tableName, alias, allColumns...),
|
|
|
|
//Columns
|
|
ID: IDColumn,
|
|
UID: UIDColumn,
|
|
SecUID: SecUIDColumn,
|
|
ShortID: ShortIDColumn,
|
|
RealName: RealNameColumn,
|
|
NickName: NickNameColumn,
|
|
State: StateColumn,
|
|
Since: SinceColumn,
|
|
Config: ConfigColumn,
|
|
ConfigAt: ConfigAtColumn,
|
|
|
|
AllColumns: allColumns,
|
|
MutableColumns: mutableColumns,
|
|
}
|
|
}
|