mysql_queries

package
v0.4.41 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type GetDatabaseSchemaRow

type GetDatabaseSchemaRow struct {
	TableSchema            string
	TableName              string
	ColumnName             string
	OrdinalPosition        int64
	ColumnDefault          string
	IsNullable             string
	DataType               string
	CharacterMaximumLength sql.NullInt64
	NumericPrecision       sql.NullInt64
	NumericScale           sql.NullInt64
	Extra                  sql.NullString
}

type GetForeignKeyConstraintsRow

type GetForeignKeyConstraintsRow struct {
	ConstraintName    string
	SchemaName        string
	TableName         string
	ColumnName        string
	IsNullable        string
	ForeignSchemaName string
	ForeignTableName  string
	ForeignColumnName string
}

type GetMysqlRolePermissionsRow

type GetMysqlRolePermissionsRow struct {
	TableSchema   string
	TableName     string
	PrivilegeType string
}

type GetPrimaryKeyConstraintsRow

type GetPrimaryKeyConstraintsRow struct {
	SchemaName     string
	TableName      string
	ColumnName     string
	ConstraintName string
}

type GetUniqueConstraintsRow

type GetUniqueConstraintsRow struct {
	SchemaName     string
	TableName      string
	ConstraintName string
	ColumnName     string
}

type MockDBTX

type MockDBTX struct {
	mock.Mock
}

MockDBTX is an autogenerated mock type for the DBTX type

func NewMockDBTX

func NewMockDBTX(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockDBTX

NewMockDBTX creates a new instance of MockDBTX. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockDBTX) EXPECT

func (_m *MockDBTX) EXPECT() *MockDBTX_Expecter

func (*MockDBTX) ExecContext

func (_m *MockDBTX) ExecContext(_a0 context.Context, _a1 string, _a2 ...interface{}) (sql.Result, error)

ExecContext provides a mock function with given fields: _a0, _a1, _a2

func (*MockDBTX) PrepareContext

func (_m *MockDBTX) PrepareContext(_a0 context.Context, _a1 string) (*sql.Stmt, error)

PrepareContext provides a mock function with given fields: _a0, _a1

func (*MockDBTX) QueryContext

func (_m *MockDBTX) QueryContext(_a0 context.Context, _a1 string, _a2 ...interface{}) (*sql.Rows, error)

QueryContext provides a mock function with given fields: _a0, _a1, _a2

func (*MockDBTX) QueryRowContext

func (_m *MockDBTX) QueryRowContext(_a0 context.Context, _a1 string, _a2 ...interface{}) *sql.Row

QueryRowContext provides a mock function with given fields: _a0, _a1, _a2

type MockDBTX_ExecContext_Call

type MockDBTX_ExecContext_Call struct {
	*mock.Call
}

MockDBTX_ExecContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecContext'

func (*MockDBTX_ExecContext_Call) Return

func (*MockDBTX_ExecContext_Call) Run

func (_c *MockDBTX_ExecContext_Call) Run(run func(_a0 context.Context, _a1 string, _a2 ...interface{})) *MockDBTX_ExecContext_Call

func (*MockDBTX_ExecContext_Call) RunAndReturn

func (_c *MockDBTX_ExecContext_Call) RunAndReturn(run func(context.Context, string, ...interface{}) (sql.Result, error)) *MockDBTX_ExecContext_Call

type MockDBTX_Expecter

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

func (*MockDBTX_Expecter) ExecContext

func (_e *MockDBTX_Expecter) ExecContext(_a0 interface{}, _a1 interface{}, _a2 ...interface{}) *MockDBTX_ExecContext_Call

ExecContext is a helper method to define mock.On call

  • _a0 context.Context
  • _a1 string
  • _a2 ...interface{}

func (*MockDBTX_Expecter) PrepareContext

func (_e *MockDBTX_Expecter) PrepareContext(_a0 interface{}, _a1 interface{}) *MockDBTX_PrepareContext_Call

PrepareContext is a helper method to define mock.On call

  • _a0 context.Context
  • _a1 string

func (*MockDBTX_Expecter) QueryContext

func (_e *MockDBTX_Expecter) QueryContext(_a0 interface{}, _a1 interface{}, _a2 ...interface{}) *MockDBTX_QueryContext_Call

QueryContext is a helper method to define mock.On call

  • _a0 context.Context
  • _a1 string
  • _a2 ...interface{}

func (*MockDBTX_Expecter) QueryRowContext

func (_e *MockDBTX_Expecter) QueryRowContext(_a0 interface{}, _a1 interface{}, _a2 ...interface{}) *MockDBTX_QueryRowContext_Call

QueryRowContext is a helper method to define mock.On call

  • _a0 context.Context
  • _a1 string
  • _a2 ...interface{}

type MockDBTX_PrepareContext_Call

type MockDBTX_PrepareContext_Call struct {
	*mock.Call
}

MockDBTX_PrepareContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrepareContext'

func (*MockDBTX_PrepareContext_Call) Return

func (*MockDBTX_PrepareContext_Call) Run

func (*MockDBTX_PrepareContext_Call) RunAndReturn

type MockDBTX_QueryContext_Call

type MockDBTX_QueryContext_Call struct {
	*mock.Call
}

MockDBTX_QueryContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryContext'

func (*MockDBTX_QueryContext_Call) Return

func (*MockDBTX_QueryContext_Call) Run

func (_c *MockDBTX_QueryContext_Call) Run(run func(_a0 context.Context, _a1 string, _a2 ...interface{})) *MockDBTX_QueryContext_Call

func (*MockDBTX_QueryContext_Call) RunAndReturn

func (_c *MockDBTX_QueryContext_Call) RunAndReturn(run func(context.Context, string, ...interface{}) (*sql.Rows, error)) *MockDBTX_QueryContext_Call

type MockDBTX_QueryRowContext_Call

type MockDBTX_QueryRowContext_Call struct {
	*mock.Call
}

MockDBTX_QueryRowContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryRowContext'

func (*MockDBTX_QueryRowContext_Call) Return

func (*MockDBTX_QueryRowContext_Call) Run

func (_c *MockDBTX_QueryRowContext_Call) Run(run func(_a0 context.Context, _a1 string, _a2 ...interface{})) *MockDBTX_QueryRowContext_Call

func (*MockDBTX_QueryRowContext_Call) RunAndReturn

func (_c *MockDBTX_QueryRowContext_Call) RunAndReturn(run func(context.Context, string, ...interface{}) *sql.Row) *MockDBTX_QueryRowContext_Call

type MockQuerier

type MockQuerier struct {
	mock.Mock
}

MockQuerier is an autogenerated mock type for the Querier type

func NewMockQuerier

func NewMockQuerier(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockQuerier

NewMockQuerier creates a new instance of MockQuerier. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockQuerier) EXPECT

func (_m *MockQuerier) EXPECT() *MockQuerier_Expecter

func (*MockQuerier) GetDatabaseSchema

func (_m *MockQuerier) GetDatabaseSchema(ctx context.Context, db DBTX) ([]*GetDatabaseSchemaRow, error)

GetDatabaseSchema provides a mock function with given fields: ctx, db

func (*MockQuerier) GetForeignKeyConstraints

func (_m *MockQuerier) GetForeignKeyConstraints(ctx context.Context, db DBTX, tableSchema string) ([]*GetForeignKeyConstraintsRow, error)

GetForeignKeyConstraints provides a mock function with given fields: ctx, db, tableSchema

func (*MockQuerier) GetMysqlRolePermissions

func (_m *MockQuerier) GetMysqlRolePermissions(ctx context.Context, db DBTX) ([]*GetMysqlRolePermissionsRow, error)

GetMysqlRolePermissions provides a mock function with given fields: ctx, db

func (*MockQuerier) GetPrimaryKeyConstraints

func (_m *MockQuerier) GetPrimaryKeyConstraints(ctx context.Context, db DBTX, tableSchema string) ([]*GetPrimaryKeyConstraintsRow, error)

GetPrimaryKeyConstraints provides a mock function with given fields: ctx, db, tableSchema

func (*MockQuerier) GetUniqueConstraints

func (_m *MockQuerier) GetUniqueConstraints(ctx context.Context, db DBTX, tableSchema string) ([]*GetUniqueConstraintsRow, error)

GetUniqueConstraints provides a mock function with given fields: ctx, db, tableSchema

type MockQuerier_Expecter

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

func (*MockQuerier_Expecter) GetDatabaseSchema

func (_e *MockQuerier_Expecter) GetDatabaseSchema(ctx interface{}, db interface{}) *MockQuerier_GetDatabaseSchema_Call

GetDatabaseSchema is a helper method to define mock.On call

  • ctx context.Context
  • db DBTX

func (*MockQuerier_Expecter) GetForeignKeyConstraints

func (_e *MockQuerier_Expecter) GetForeignKeyConstraints(ctx interface{}, db interface{}, tableSchema interface{}) *MockQuerier_GetForeignKeyConstraints_Call

GetForeignKeyConstraints is a helper method to define mock.On call

  • ctx context.Context
  • db DBTX
  • tableSchema string

func (*MockQuerier_Expecter) GetMysqlRolePermissions

func (_e *MockQuerier_Expecter) GetMysqlRolePermissions(ctx interface{}, db interface{}) *MockQuerier_GetMysqlRolePermissions_Call

GetMysqlRolePermissions is a helper method to define mock.On call

  • ctx context.Context
  • db DBTX

func (*MockQuerier_Expecter) GetPrimaryKeyConstraints

func (_e *MockQuerier_Expecter) GetPrimaryKeyConstraints(ctx interface{}, db interface{}, tableSchema interface{}) *MockQuerier_GetPrimaryKeyConstraints_Call

GetPrimaryKeyConstraints is a helper method to define mock.On call

  • ctx context.Context
  • db DBTX
  • tableSchema string

func (*MockQuerier_Expecter) GetUniqueConstraints

func (_e *MockQuerier_Expecter) GetUniqueConstraints(ctx interface{}, db interface{}, tableSchema interface{}) *MockQuerier_GetUniqueConstraints_Call

GetUniqueConstraints is a helper method to define mock.On call

  • ctx context.Context
  • db DBTX
  • tableSchema string

type MockQuerier_GetDatabaseSchema_Call

type MockQuerier_GetDatabaseSchema_Call struct {
	*mock.Call
}

MockQuerier_GetDatabaseSchema_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDatabaseSchema'

func (*MockQuerier_GetDatabaseSchema_Call) Return

func (*MockQuerier_GetDatabaseSchema_Call) Run

func (*MockQuerier_GetDatabaseSchema_Call) RunAndReturn

type MockQuerier_GetForeignKeyConstraints_Call

type MockQuerier_GetForeignKeyConstraints_Call struct {
	*mock.Call
}

MockQuerier_GetForeignKeyConstraints_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetForeignKeyConstraints'

func (*MockQuerier_GetForeignKeyConstraints_Call) Return

func (*MockQuerier_GetForeignKeyConstraints_Call) Run

func (*MockQuerier_GetForeignKeyConstraints_Call) RunAndReturn

type MockQuerier_GetMysqlRolePermissions_Call

type MockQuerier_GetMysqlRolePermissions_Call struct {
	*mock.Call
}

MockQuerier_GetMysqlRolePermissions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMysqlRolePermissions'

func (*MockQuerier_GetMysqlRolePermissions_Call) Return

func (*MockQuerier_GetMysqlRolePermissions_Call) Run

func (*MockQuerier_GetMysqlRolePermissions_Call) RunAndReturn

type MockQuerier_GetPrimaryKeyConstraints_Call

type MockQuerier_GetPrimaryKeyConstraints_Call struct {
	*mock.Call
}

MockQuerier_GetPrimaryKeyConstraints_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPrimaryKeyConstraints'

func (*MockQuerier_GetPrimaryKeyConstraints_Call) Return

func (*MockQuerier_GetPrimaryKeyConstraints_Call) Run

func (*MockQuerier_GetPrimaryKeyConstraints_Call) RunAndReturn

type MockQuerier_GetUniqueConstraints_Call

type MockQuerier_GetUniqueConstraints_Call struct {
	*mock.Call
}

MockQuerier_GetUniqueConstraints_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUniqueConstraints'

func (*MockQuerier_GetUniqueConstraints_Call) Return

func (*MockQuerier_GetUniqueConstraints_Call) Run

func (*MockQuerier_GetUniqueConstraints_Call) RunAndReturn

type Querier

type Querier interface {
	GetDatabaseSchema(ctx context.Context, db DBTX) ([]*GetDatabaseSchemaRow, error)
	GetForeignKeyConstraints(ctx context.Context, db DBTX, tableSchema string) ([]*GetForeignKeyConstraintsRow, error)
	GetMysqlRolePermissions(ctx context.Context, db DBTX) ([]*GetMysqlRolePermissionsRow, error)
	GetPrimaryKeyConstraints(ctx context.Context, db DBTX, tableSchema string) ([]*GetPrimaryKeyConstraintsRow, error)
	GetUniqueConstraints(ctx context.Context, db DBTX, tableSchema string) ([]*GetUniqueConstraintsRow, error)
}

type Queries

type Queries struct {
}

func New

func New() *Queries

func (*Queries) GetDatabaseSchema

func (q *Queries) GetDatabaseSchema(ctx context.Context, db DBTX) ([]*GetDatabaseSchemaRow, error)

func (*Queries) GetForeignKeyConstraints

func (q *Queries) GetForeignKeyConstraints(ctx context.Context, db DBTX, tableSchema string) ([]*GetForeignKeyConstraintsRow, error)

func (*Queries) GetMysqlRolePermissions

func (q *Queries) GetMysqlRolePermissions(ctx context.Context, db DBTX) ([]*GetMysqlRolePermissionsRow, error)

func (*Queries) GetPrimaryKeyConstraints

func (q *Queries) GetPrimaryKeyConstraints(ctx context.Context, db DBTX, tableSchema string) ([]*GetPrimaryKeyConstraintsRow, error)

func (*Queries) GetUniqueConstraints

func (q *Queries) GetUniqueConstraints(ctx context.Context, db DBTX, tableSchema string) ([]*GetUniqueConstraintsRow, error)

Jump to

Keyboard shortcuts

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