Documentation ¶
Index ¶
Constants ¶
View Source
const ( PqForeignKeyViolation = pq.ErrorCode("23503") PqUniqueViolationError = pq.ErrorCode("23505") )
Variables ¶
This section is empty.
Functions ¶
func NewMigration ¶
func NewMigration(driverName, dataSourceName string) *migration
Types ¶
type Db ¶
type Db interface { // NewModelTx creates new ModelTx object NewModelTx() ModelTx // NewTx creates Tx object NewTx() Tx }
Db interface exposes
type IndexRecord ¶ added in v0.0.2
type ModelTx ¶
type ModelTx interface { Tx // CreateIndex creates index entry CreateIndex(index Index) (string, error) // CreateIndexRecord creates index record entry CreateIndexRecord(record IndexRecord) (string, error) }
ModelTx provides a transaction with some methods for accessing to the Model objects
type QueryResult ¶
type SqlTestSuite ¶
SqlTestSuite struct used to wrap all related database connection stuff into one suite
func (*SqlTestSuite) AfterTest ¶
func (s *SqlTestSuite) AfterTest(suiteName, testName string)
func (*SqlTestSuite) BeforeTest ¶
func (s *SqlTestSuite) BeforeTest(suiteName, testName string)
func (*SqlTestSuite) GetDb ¶
func (s *SqlTestSuite) GetDb() Db
func (*SqlTestSuite) SetupSuite ¶
func (s *SqlTestSuite) SetupSuite()
func (*SqlTestSuite) TearDownSuite ¶
func (s *SqlTestSuite) TearDownSuite()
type Tx ¶
type Tx interface { // MustBegin starts the transaction MustBegin() // MustBeginSerializable starts new transaction with Serializable isolation level MustBeginSerializable(ctx context.Context) // Commit commits the changes made within the transaction Commit() error // Rollback rolls the transaction back Rollback() error // ExecScript allows to execute the sql statements from the file provided ExecScript(sqlScript string) error }
Tx interface describes an abstract DB transaction.
Click to show internal directories.
Click to hide internal directories.