Documentation ¶
Index ¶
- func BuildMysqlTruncateStatement(schema string, table string) (string, error)
- func EscapeMysqlColumn(col string) string
- func EscapeMysqlColumns(cols []string) []string
- func GetMysqlColumnOverrideAndResetProperties(columnInfo *sqlmanager_shared.ColumnInfo) (needsOverride, needsReset bool)
- type MysqlManager
- func (m *MysqlManager) BatchExec(ctx context.Context, batchSize int, statements []string, ...) error
- func (m *MysqlManager) Close()
- func (m *MysqlManager) Exec(ctx context.Context, statement string) error
- func (m *MysqlManager) GetCreateTableStatement(ctx context.Context, schema, table string) (string, error)
- func (m *MysqlManager) GetDatabaseSchema(ctx context.Context) ([]*sqlmanager_shared.DatabaseSchemaRow, error)
- func (m *MysqlManager) GetRolePermissionsMap(ctx context.Context) (map[string][]string, error)
- func (m *MysqlManager) GetSchemaColumnMap(ctx context.Context) (map[string]map[string]*sqlmanager_shared.ColumnInfo, error)
- func (m *MysqlManager) GetSchemaInitStatements(ctx context.Context, tables []*sqlmanager_shared.SchemaTable) ([]*sqlmanager_shared.InitSchemaStatements, error)
- func (m *MysqlManager) GetSchemaTableDataTypes(ctx context.Context, tables []*sqlmanager_shared.SchemaTable) (*sqlmanager_shared.SchemaTableDataTypeResponse, error)
- func (m *MysqlManager) GetSchemaTableTriggers(ctx context.Context, tables []*sqlmanager_shared.SchemaTable) ([]*sqlmanager_shared.TableTrigger, error)
- func (m *MysqlManager) GetSequencesByTables(ctx context.Context, schema string, tables []string) ([]*sqlmanager_shared.DataType, error)
- func (m *MysqlManager) GetTableConstraintsBySchema(ctx context.Context, schemas []string) (*sqlmanager_shared.TableConstraints, error)
- func (m *MysqlManager) GetTableInitStatements(ctx context.Context, tables []*sqlmanager_shared.SchemaTable) ([]*sqlmanager_shared.TableInitStatement, error)
- func (m *MysqlManager) GetTableRowCount(ctx context.Context, schema, table string, whereClause *string) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeMysqlColumn ¶
func EscapeMysqlColumns ¶
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 (*MysqlManager) GetDatabaseSchema ¶
func (m *MysqlManager) GetDatabaseSchema(ctx context.Context) ([]*sqlmanager_shared.DatabaseSchemaRow, error)
func (*MysqlManager) GetRolePermissionsMap ¶
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 (m *MysqlManager) GetSchemaTableDataTypes(ctx context.Context, tables []*sqlmanager_shared.SchemaTable) (*sqlmanager_shared.SchemaTableDataTypeResponse, error)
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 ¶
Click to show internal directories.
Click to hide internal directories.