github.com/kunlun-qilian/sqlx/v3@v3.0.0/builder/interfaces.go (about) 1 package builder 2 3 // replace ? as some query snippet 4 // 5 // examples: 6 // ? => ST_GeomFromText(?) 7 type ValuerExpr interface { 8 ValueEx() string 9 } 10 11 type DataTypeDescriber interface { 12 DataType(driverName string) string 13 } 14 15 type Model interface { 16 TableName() string 17 } 18 19 type WithTableDescription interface { 20 TableDescription() []string 21 } 22 23 type Indexes map[string][]string 24 25 type WithPrimaryKey interface { 26 PrimaryKey() []string 27 } 28 29 type WithUniqueIndexes interface { 30 UniqueIndexes() Indexes 31 } 32 33 type WithIndexes interface { 34 Indexes() Indexes 35 } 36 37 type WithPartition interface { 38 Partition() []string 39 } 40 41 type WithComments interface { 42 Comments() map[string]string 43 } 44 45 type WithRelations interface { 46 ColRelations() map[string][]string 47 } 48 49 type WithColDescriptions interface { 50 ColDescriptions() map[string][]string 51 } 52 53 type Dialect interface { 54 DriverName() string 55 PrimaryKeyName() string 56 IsErrorUnknownDatabase(err error) bool 57 IsErrorConflict(err error) bool 58 CreateDatabase(dbName string) SqlExpr 59 CreateSchema(schemaName string) SqlExpr 60 DropDatabase(dbName string) SqlExpr 61 CreateTableIsNotExists(t *Table) []SqlExpr 62 DropTable(t *Table) SqlExpr 63 TruncateTable(t *Table) SqlExpr 64 AddColumn(col *Column) SqlExpr 65 RenameColumn(col *Column, target *Column) SqlExpr 66 ModifyColumn(col *Column, prev *Column) SqlExpr 67 DropColumn(col *Column) SqlExpr 68 AddIndex(key *Key) SqlExpr 69 DropIndex(key *Key) SqlExpr 70 DataType(columnType *ColumnType) SqlExpr 71 }