Documentation ¶
Index ¶
- func BuildSchema(driver Driver, queries ...Builder) string
- func CopyTable(from *sqlx.DB, to *sqlx.Tx, name string) error
- func CopyTables(from *sqlx.DB, to *sqlx.DB, tables []string) error
- func Migrate(migrations []Migration, db *sqlx.DB, current int) error
- type Builder
- type Driver
- type Migration
- type QueryAlterTable
- type QueryCreateMigrationTable
- type QueryCreateTable
- func (q *QueryCreateTable) Build(driver Driver) string
- func (q *QueryCreateTable) WithCreatedAt() *QueryCreateTable
- func (q *QueryCreateTable) WithDeletedAt() *QueryCreateTable
- func (q *QueryCreateTable) WithField(name string, dataType string, options ...string) *QueryCreateTable
- func (q *QueryCreateTable) WithForeignKey(field string, table string, reference string) *QueryCreateTable
- func (q *QueryCreateTable) WithID() *QueryCreateTable
- func (q *QueryCreateTable) WithPrimaryKey(fields ...string) *QueryCreateTable
- func (q *QueryCreateTable) WithUpdatedAt() *QueryCreateTable
- type QueryInsert
- type QueryRemoveField
- type QueryWithCreatedAt
- type QueryWithDeletedAt
- type QueryWithField
- type QueryWithForeignKey
- type QueryWithID
- type QueryWithPrimaryKey
- type QueryWithUpdatedAt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildSchema ¶
func CopyTables ¶
CopyTables copies the tables from one database to another. The tables are copied in one unique transaction.
Types ¶
type Builder ¶
func CreateMigrationTable ¶
type Driver ¶
func DriverFromName ¶
type QueryAlterTable ¶
type QueryAlterTable struct {
// contains filtered or unexported fields
}
func AlterTable ¶
func AlterTable(name string) *QueryAlterTable
func (*QueryAlterTable) AddField ¶
func (q *QueryAlterTable) AddField(name string, dataType string, options ...string) *QueryAlterTable
func (*QueryAlterTable) Build ¶
func (q *QueryAlterTable) Build(driver Driver) string
func (*QueryAlterTable) RemoveField ¶
func (q *QueryAlterTable) RemoveField(name string) *QueryAlterTable
type QueryCreateMigrationTable ¶
type QueryCreateMigrationTable struct {
// contains filtered or unexported fields
}
func (*QueryCreateMigrationTable) Build ¶
func (q *QueryCreateMigrationTable) Build(driver Driver) string
type QueryCreateTable ¶
type QueryCreateTable struct {
// contains filtered or unexported fields
}
func CreateTable ¶
func CreateTable(name string) *QueryCreateTable
func (*QueryCreateTable) Build ¶
func (q *QueryCreateTable) Build(driver Driver) string
func (*QueryCreateTable) WithCreatedAt ¶
func (q *QueryCreateTable) WithCreatedAt() *QueryCreateTable
func (*QueryCreateTable) WithDeletedAt ¶
func (q *QueryCreateTable) WithDeletedAt() *QueryCreateTable
func (*QueryCreateTable) WithField ¶
func (q *QueryCreateTable) WithField(name string, dataType string, options ...string) *QueryCreateTable
func (*QueryCreateTable) WithForeignKey ¶
func (q *QueryCreateTable) WithForeignKey(field string, table string, reference string) *QueryCreateTable
func (*QueryCreateTable) WithID ¶
func (q *QueryCreateTable) WithID() *QueryCreateTable
func (*QueryCreateTable) WithPrimaryKey ¶
func (q *QueryCreateTable) WithPrimaryKey(fields ...string) *QueryCreateTable
func (*QueryCreateTable) WithUpdatedAt ¶
func (q *QueryCreateTable) WithUpdatedAt() *QueryCreateTable
type QueryInsert ¶
type QueryInsert struct {
// contains filtered or unexported fields
}
func InsertInto ¶
func InsertInto(table string) *QueryInsert
func (*QueryInsert) Build ¶
func (q *QueryInsert) Build(driver Driver) string
func (*QueryInsert) Columns ¶
func (q *QueryInsert) Columns(columns ...string) *QueryInsert
func (*QueryInsert) Values ¶
func (q *QueryInsert) Values(values ...interface{}) *QueryInsert
type QueryRemoveField ¶
type QueryRemoveField struct {
// contains filtered or unexported fields
}
func (*QueryRemoveField) Build ¶
func (q *QueryRemoveField) Build(driver Driver) string
type QueryWithCreatedAt ¶
type QueryWithCreatedAt struct{}
func (*QueryWithCreatedAt) Build ¶
func (q *QueryWithCreatedAt) Build(driver Driver) string
type QueryWithDeletedAt ¶
type QueryWithDeletedAt struct{}
func (*QueryWithDeletedAt) Build ¶
func (q *QueryWithDeletedAt) Build(driver Driver) string
type QueryWithField ¶
type QueryWithField struct {
// contains filtered or unexported fields
}
func (*QueryWithField) Build ¶
func (q *QueryWithField) Build(driver Driver) string
type QueryWithForeignKey ¶
type QueryWithForeignKey struct {
// contains filtered or unexported fields
}
func (*QueryWithForeignKey) Build ¶
func (q *QueryWithForeignKey) Build(driver Driver) string
type QueryWithID ¶
type QueryWithID struct{}
func (*QueryWithID) Build ¶
func (q *QueryWithID) Build(driver Driver) string
type QueryWithPrimaryKey ¶
type QueryWithPrimaryKey struct {
// contains filtered or unexported fields
}
func (*QueryWithPrimaryKey) Build ¶
func (q *QueryWithPrimaryKey) Build(driver Driver) string
type QueryWithUpdatedAt ¶
type QueryWithUpdatedAt struct{}
func (*QueryWithUpdatedAt) Build ¶
func (q *QueryWithUpdatedAt) Build(driver Driver) string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.