github.com/eden-framework/sqlx@v0.0.2/builder/interfaces.go (about)

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