Documentation
¶
Index ¶
- Variables
- func CamelCase(src string) string
- func RegisterDialect(driver string, dialect Dialect)
- type Column
- type Dialect
- type MysqlDialect
- func (this MysqlDialect) CreateTable(table Table) string
- func (this MysqlDialect) DropTable(table Table) string
- func (this MysqlDialect) InsertOne(table Table) string
- func (this MysqlDialect) ListCollections(dbname string, table Table) string
- func (this MysqlDialect) ListColumns(dbname string, table Table) string
- func (this MysqlDialect) ListReferences(dbname string, table Table) string
- func (this MysqlDialect) ListTables(dbname string) string
- func (this MysqlDialect) Name() string
- type SchemaWriter
- type Session
- type SqliteDialect
- type StructGenerator
- type Table
- type TableStruct
Constants ¶
This section is empty.
Variables ¶
View Source
var Done = errors.New("iteration done")
Session is deprecated in favor of sqlx
Functions ¶
func RegisterDialect ¶
Types ¶
type Dialect ¶
type Dialect interface {
CreateTable(table Table) string
DropTable(table Table) string
InsertOne(table Table) string
ListTables(string) string
ListColumns(string, Table) string
Name() string
}
A Dialect is a set of functions for generating the SQL to obtain various metadata about a database.
func DialectByDriver ¶
type MysqlDialect ¶
type MysqlDialect int
func (MysqlDialect) CreateTable ¶
func (this MysqlDialect) CreateTable(table Table) string
func (MysqlDialect) DropTable ¶
func (this MysqlDialect) DropTable(table Table) string
func (MysqlDialect) InsertOne ¶
func (this MysqlDialect) InsertOne(table Table) string
func (MysqlDialect) ListCollections ¶
func (this MysqlDialect) ListCollections(dbname string, table Table) string
func (MysqlDialect) ListColumns ¶
func (this MysqlDialect) ListColumns(dbname string, table Table) string
func (MysqlDialect) ListReferences ¶
func (this MysqlDialect) ListReferences(dbname string, table Table) string
func (MysqlDialect) ListTables ¶
func (this MysqlDialect) ListTables(dbname string) string
func (MysqlDialect) Name ¶
func (this MysqlDialect) Name() string
type SchemaWriter ¶
A SchemaWriter writes a set of tables to the writer denoted by Outfile
func (*SchemaWriter) LoadSchema ¶
Load the database schema into memory using introspection, populating .Tables
func (*SchemaWriter) WriteField ¶
func (this *SchemaWriter) WriteField(column *Column)
Write an individual field
func (*SchemaWriter) WriteType ¶
func (this *SchemaWriter) WriteType(table *Table)
Write an individual table
type Session ¶
func (*Session) FromQuery ¶
func (this *Session) FromQuery(query string, args ...interface{}) (gen StructGenerator, err error)
func (*Session) GetChildren ¶
type SqliteDialect ¶
type SqliteDialect struct {
MysqlDialect
}
func (SqliteDialect) ListColumns ¶
func (this SqliteDialect) ListColumns(dbname string, table Table) string
func (SqliteDialect) ListTables ¶
func (this SqliteDialect) ListTables(dbname string) string
func (SqliteDialect) Name ¶
func (this SqliteDialect) Name() string
type StructGenerator ¶
type StructGenerator func(interface{}) error
type TableStruct ¶
type TableStruct interface {
Table() string
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.