sql

package
v0.0.0-...-fbe7d06 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2015 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	db.BaseBackend

	Db *sql.DB
	Tx *sql.Tx
	// contains filtered or unexported fields
}

func New

func New(driver, driverOptions string) (*Backend, apperror.Error)

func (*Backend) Begin

func (b *Backend) Begin() (db.Transaction, apperror.Error)

func (*Backend) Build

func (b *Backend) Build()

func (*Backend) Clone

func (b *Backend) Clone() db.Backend

func (*Backend) Commit

func (b *Backend) Commit() apperror.Error

func (*Backend) CreateCollection

func (b *Backend) CreateCollection(collections ...string) apperror.Error

func (Backend) DetermineMigrationVersion

func (b Backend) DetermineMigrationVersion() (int, apperror.Error)

func (*Backend) DisableSqlProfiling

func (b *Backend) DisableSqlProfiling()

func (*Backend) EnableSqlProfiling

func (b *Backend) EnableSqlProfiling()

func (*Backend) Exec

func (b *Backend) Exec(statement Expression) apperror.Error

func (*Backend) ExecQuery

func (b *Backend) ExecQuery(statement FieldedExpression) ([]interface{}, apperror.Error)

func (*Backend) GetMigrationHandler

func (b *Backend) GetMigrationHandler() *db.MigrationHandler

*

  • Implement migration related interfaces.

func (*Backend) HasNativeJoins

func (b *Backend) HasNativeJoins() bool

func (*Backend) HasStringIds

func (b *Backend) HasStringIds() bool

func (Backend) IsMigrationLocked

func (b Backend) IsMigrationLocked() (bool, apperror.Error)

func (*Backend) IsSqlProfilingEnabled

func (b *Backend) IsSqlProfilingEnabled() bool

func (Backend) MigrationsSetup

func (b Backend) MigrationsSetup() apperror.Error

func (*Backend) MustBegin

func (b *Backend) MustBegin() db.Transaction

func (Backend) NewMigrationAttempt

func (b Backend) NewMigrationAttempt() db.MigrationAttempt

func (*Backend) Rollback

func (b *Backend) Rollback() apperror.Error

func (*Backend) SqlExec

func (b *Backend) SqlExec(query string, args ...interface{}) (sql.Result, error)

func (*Backend) SqlQuery

func (b *Backend) SqlQuery(query string, args ...interface{}) (*sql.Rows, error)

type Dialect

type Dialect interface {
	ExpressionTranslator
	New() Dialect
	DetermineColumnType(attr *db.Attribute) (string, apperror.Error)

	AfterCollectionCreate(info *db.ModelInfo) apperror.Error
}

func NewPostgresDialect

func NewPostgresDialect(b *Backend) Dialect

type MigrationAttempt

type MigrationAttempt struct {
	db.BaseMigrationAttemptIntId
}

type MysqlDialect

type MysqlDialect struct {
	// contains filtered or unexported fields
}

func (MysqlDialect) AfterCollectionCreate

func (MysqlDialect) AfterCollectionCreate(info *db.ModelInfo) apperror.Error

func (MysqlDialect) DetermineColumnType

func (MysqlDialect) DetermineColumnType(attr *db.Attribute) (string, apperror.Error)

func (MysqlDialect) New

func (MysqlDialect) New() Dialect

func (*MysqlDialect) PrepareExpression

func (d *MysqlDialect) PrepareExpression(e Expression) apperror.Error

type PostgresDialect

type PostgresDialect struct {
	// contains filtered or unexported fields
}

func (*PostgresDialect) AfterCollectionCreate

func (d *PostgresDialect) AfterCollectionCreate(info *db.ModelInfo) apperror.Error

func (PostgresDialect) DetermineColumnType

func (PostgresDialect) DetermineColumnType(attr *db.Attribute) (string, apperror.Error)

func (*PostgresDialect) New

func (d *PostgresDialect) New() Dialect

func (PostgresDialect) Placeholder

func (PostgresDialect) Placeholder() string

func (*PostgresDialect) PrepareExpression

func (d *PostgresDialect) PrepareExpression(expression Expression) apperror.Error

func (*PostgresDialect) String

func (d *PostgresDialect) String() string

func (*PostgresDialect) Translate

func (d *PostgresDialect) Translate(expression Expression) apperror.Error

type SqliteDialect

type SqliteDialect struct {
	// contains filtered or unexported fields
}

func (SqliteDialect) AfterCollectionCreate

func (SqliteDialect) AfterCollectionCreate(info *db.ModelInfo) apperror.Error

func (SqliteDialect) DetermineColumnType

func (SqliteDialect) DetermineColumnType(attr *db.Attribute) (string, apperror.Error)

func (SqliteDialect) New

func (SqliteDialect) New() Dialect

func (*SqliteDialect) PrepareExpression

func (d *SqliteDialect) PrepareExpression(e Expression) apperror.Error

Directories

Path Synopsis
t

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL