sqlmanager_mysql

package
v0.4.76 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildMysqlTruncateStatement

func BuildMysqlTruncateStatement(
	schema string,
	table string,
) (string, error)

func EscapeMysqlColumn

func EscapeMysqlColumn(col string) string

func EscapeMysqlColumns

func EscapeMysqlColumns(cols []string) []string

func GetMysqlColumnOverrideAndResetProperties added in v0.4.70

func GetMysqlColumnOverrideAndResetProperties(columnInfo *sqlmanager_shared.ColumnInfo) (needsOverride, needsReset bool)

Types

type MysqlManager

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

func NewManager

func NewManager(querier mysql_queries.Querier, pool mysql_queries.DBTX, closer func()) *MysqlManager

func (*MysqlManager) BatchExec

func (m *MysqlManager) BatchExec(ctx context.Context, batchSize int, statements []string, opts *sqlmanager_shared.BatchExecOpts) error

func (*MysqlManager) Close

func (m *MysqlManager) Close()

func (*MysqlManager) Exec

func (m *MysqlManager) Exec(ctx context.Context, statement string) error

func (*MysqlManager) GetCreateTableStatement

func (m *MysqlManager) GetCreateTableStatement(ctx context.Context, schema, table string) (string, error)

func (*MysqlManager) GetDatabaseSchema

func (m *MysqlManager) GetDatabaseSchema(ctx context.Context) ([]*sqlmanager_shared.DatabaseSchemaRow, error)

func (*MysqlManager) GetRolePermissionsMap

func (m *MysqlManager) GetRolePermissionsMap(ctx context.Context) (map[string][]string, error)

func (*MysqlManager) GetSchemaColumnMap

func (m *MysqlManager) GetSchemaColumnMap(ctx context.Context) (map[string]map[string]*sqlmanager_shared.ColumnInfo, error)

returns: {public.users: { id: struct{}{}, created_at: struct{}{}}}

func (*MysqlManager) GetSchemaInitStatements added in v0.4.30

func (m *MysqlManager) GetSchemaInitStatements(
	ctx context.Context,
	tables []*sqlmanager_shared.SchemaTable,
) ([]*sqlmanager_shared.InitSchemaStatements, error)

func (*MysqlManager) GetSchemaTableDataTypes

func (*MysqlManager) GetSchemaTableTriggers

func (m *MysqlManager) GetSchemaTableTriggers(ctx context.Context, tables []*sqlmanager_shared.SchemaTable) ([]*sqlmanager_shared.TableTrigger, error)

func (*MysqlManager) GetSequencesByTables added in v0.4.73

func (m *MysqlManager) GetSequencesByTables(ctx context.Context, schema string, tables []string) ([]*sqlmanager_shared.DataType, error)

func (*MysqlManager) GetTableConstraintsBySchema

func (m *MysqlManager) GetTableConstraintsBySchema(ctx context.Context, schemas []string) (*sqlmanager_shared.TableConstraints, error)

func (*MysqlManager) GetTableInitStatements

func (m *MysqlManager) GetTableInitStatements(ctx context.Context, tables []*sqlmanager_shared.SchemaTable) ([]*sqlmanager_shared.TableInitStatement, error)

func (*MysqlManager) GetTableRowCount

func (m *MysqlManager) GetTableRowCount(
	ctx context.Context,
	schema, table string,
	whereClause *string,
) (int64, error)

Jump to

Keyboard shortcuts

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