Versions in this module Expand all Collapse all v0 v0.0.3 Nov 18, 2020 v0.0.2 Nov 13, 2020 Changes in this version + const ARRAY_TYPE + const BLOB_TYPE + const IndexType + const NUMERIC_TYPE + const ONLYFROMDB + const ONLYTODB + const TEXT_TYPE + const TIME_TYPE + const TWOSIDES + const UNKNOW_TYPE + const UniqueType + var AlwaysNoReserve = func(string) bool + var AlwaysReserve = func(string) bool + var Array = "ARRAY" + var BigInt = "BIGINT" + var BigSerial = "BIGSERIAL" + var Binary = "BINARY" + var Bit = "BIT" + var Blob = "BLOB" + var Bool = "BOOL" + var BoolType = reflect.TypeOf(c_BOOL_DEFAULT) + var Boolean = "BOOLEAN" + var ByteType = reflect.TypeOf(c_BYTE_DEFAULT) + var Bytea = "BYTEA" + var BytesType = reflect.SliceOf(ByteType) + var Char = "CHAR" + var Clob = "CLOB" + var CommanQuoteMark byte = '`' + var CommonQuoter = Quoter + var Complex128Type = reflect.TypeOf(c_COMPLEX128_DEFAULT) + var Complex64Type = reflect.TypeOf(c_COMPLEX64_DEFAULT) + var Date = "DATE" + var DateTime = "DATETIME" + var Decimal = "DECIMAL" + var Double = "DOUBLE" + var Enum = "ENUM" + var Float = "FLOAT" + var Float32Type = reflect.TypeOf(c_FLOAT32_DEFAULT) + var Float64Type = reflect.TypeOf(c_FLOAT64_DEFAULT) + var Int = "INT" + var Int16Type = reflect.TypeOf(c_INT16_DEFAULT) + var Int32Type = reflect.TypeOf(c_INT32_DEFAULT) + var Int64Type = reflect.TypeOf(c_INT64_DEFAULT) + var Int8Type = reflect.TypeOf(c_INT8_DEFAULT) + var IntType = reflect.TypeOf(c_INT_DEFAULT) + var Integer = "INTEGER" + var Json = "JSON" + var Jsonb = "JSONB" + var LongBlob = "LONGBLOB" + var LongText = "LONGTEXT" + var MediumBlob = "MEDIUMBLOB" + var MediumInt = "MEDIUMINT" + var MediumText = "MEDIUMTEXT" + var Money = "MONEY" + var NChar = "NCHAR" + var NText = "NTEXT" + var NVarchar = "NVARCHAR" + var Numeric = "NUMERIC" + var PtrBoolType = reflect.PtrTo(BoolType) + var PtrByteType = reflect.PtrTo(ByteType) + var PtrComplex128Type = reflect.PtrTo(Complex128Type) + var PtrComplex64Type = reflect.PtrTo(Complex64Type) + var PtrFloat32Type = reflect.PtrTo(Float32Type) + var PtrFloat64Type = reflect.PtrTo(Float64Type) + var PtrInt16Type = reflect.PtrTo(Int16Type) + var PtrInt32Type = reflect.PtrTo(Int32Type) + var PtrInt64Type = reflect.PtrTo(Int64Type) + var PtrInt8Type = reflect.PtrTo(Int8Type) + var PtrIntType = reflect.PtrTo(IntType) + var PtrStringType = reflect.PtrTo(StringType) + var PtrTimeType = reflect.PtrTo(TimeType) + var PtrUint16Type = reflect.PtrTo(Uint16Type) + var PtrUint32Type = reflect.PtrTo(Uint32Type) + var PtrUint64Type = reflect.PtrTo(Uint64Type) + var PtrUint8Type = reflect.PtrTo(Uint8Type) + var PtrUintType = reflect.PtrTo(UintType) + var Real = "REAL" + var Serial = "SERIAL" + var Set = "SET" + var SmallDateTime = "SMALLDATETIME" + var SmallInt = "SMALLINT" + var SmallMoney = "SMALLMONEY" + var SqlTypes = map[string]int + var StringType = reflect.TypeOf(c_EMPTY_STRING) + var SysName = "SYSNAME" + var Text = "TEXT" + var Time = "TIME" + var TimeStamp = "TIMESTAMP" + var TimeStampz = "TIMESTAMPZ" + var TimeType = reflect.TypeOf(c_TIME_DEFAULT) + var TinyBlob = "TINYBLOB" + var TinyInt = "TINYINT" + var TinyText = "TINYTEXT" + var Uint16Type = reflect.TypeOf(c_UINT16_DEFAULT) + var Uint32Type = reflect.TypeOf(c_UINT32_DEFAULT) + var Uint64Type = reflect.TypeOf(c_UINT64_DEFAULT) + var Uint8Type = reflect.TypeOf(c_UINT8_DEFAULT) + var UintType = reflect.TypeOf(c_UINT_DEFAULT) + var UniqueIdentifier = "UNIQUEIDENTIFIER" + var Uuid = "UUID" + var VarBinary = "VARBINARY" + var Varchar = "VARCHAR" + var Year = "YEAR" + func SQLType2Type(st SQLType) reflect.Type + type Column struct + Comment string + Default string + DefaultIsEmpty bool + DisableTimeZone bool + EnumOptions map[string]int + FieldName string + Indexes map[string]int + IsAutoIncrement bool + IsCascade bool + IsCreated bool + IsDeleted bool + IsJSON bool + IsPrimaryKey bool + IsUpdated bool + IsVersion bool + Length int + Length2 int + MapType int + Name string + Nullable bool + SQLType SQLType + SetOptions map[string]int + TableName string + TimeZone *time.Location + func NewColumn(name, fieldName string, sqlType SQLType, len1, len2 int, nullable bool) *Column + func (col *Column) ConvertID(sid string) (interface{}, error) + func (col *Column) ValueOf(bean interface{}) (*reflect.Value, error) + func (col *Column) ValueOfV(dataStruct *reflect.Value) (*reflect.Value, error) + type DBType string + const KINGBASE + const MSSQL + const MYSQL + const ORACLE + const POSTGRES + const SQLITE + type Index struct + Cols []string + IsRegular bool + Name string + Type int + func NewIndex(name string, indexType int) *Index + func (index *Index) AddColumn(cols ...string) + func (index *Index) Equal(dst *Index) bool + func (index *Index) XName(tableName string) string + type PK []interface + func (p *PK) FromString(content string) error + func (p *PK) IsZero() bool + func (p *PK) ToString() (string, error) + func NewPK(pks ...interface{}) *PK + type Quoter struct + IsReserved func(string) bool + Prefix byte + Suffix byte + func (q Quoter) IsEmpty() bool + func (q Quoter) Join(a []string, sep string) string + func (q Quoter) JoinWrite(b *strings.Builder, a []string, sep string) error + func (q Quoter) Quote(s string) string + func (q Quoter) QuoteTo(buf *strings.Builder, value string) error + func (q Quoter) Replace(sql string) string + func (q Quoter) Strings(s []string) []string + func (q Quoter) Trim(s string) string + type SQLType struct + DefaultLength int + DefaultLength2 int + Name string + func Type2SQLType(t reflect.Type) (st SQLType) + func (s *SQLType) IsArray() bool + func (s *SQLType) IsBlob() bool + func (s *SQLType) IsJson() bool + func (s *SQLType) IsNumeric() bool + func (s *SQLType) IsText() bool + func (s *SQLType) IsTime() bool + func (s *SQLType) IsType(st int) bool + type Table struct + AutoIncrement string + Charset string + Comment string + Created map[string]bool + Deleted string + Indexes map[string]*Index + Name string + PrimaryKeys []string + StoreEngine string + Type reflect.Type + Updated string + Version string + func NewEmptyTable() *Table + func NewTable(name string, t reflect.Type) *Table + func (table *Table) AddColumn(col *Column) + func (table *Table) AddIndex(index *Index) + func (table *Table) AutoIncrColumn() *Column + func (table *Table) ColumnType(name string) reflect.Type + func (table *Table) Columns() []*Column + func (table *Table) ColumnsSeq() []string + func (table *Table) DeletedColumn() *Column + func (table *Table) GetColumn(name string) *Column + func (table *Table) GetColumnIdx(name string, idx int) *Column + func (table *Table) IDOfV(rv reflect.Value) (PK, error) + func (table *Table) PKColumns() []*Column + func (table *Table) UpdatedColumn() *Column + func (table *Table) VersionColumn() *Column