sqlmanager_mssql

package
v0.4.73 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildMssqlDeleteStatement added in v0.4.60

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

func BuildMssqlIdentityColumnResetCurrent added in v0.4.66

func BuildMssqlIdentityColumnResetCurrent(
	schema, table string,
) string

If the current identity value for a table is less than the maximum identity value stored in the identity column It is reset using the maximum value in the identity column.

func BuildMssqlIdentityColumnResetStatement added in v0.4.60

func BuildMssqlIdentityColumnResetStatement(
	schema, table, identityGeneration string,
) string

Resets current identity value back to the initial count

func BuildMssqlSetIdentityInsertStatement added in v0.4.66

func BuildMssqlSetIdentityInsertStatement(
	schema, table string,
	enable bool,
) string

Allows explicit values to be inserted into the identity column of a table.

func GetMssqlColumnOverrideAndResetProperties added in v0.4.70

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

Types

type Manager

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

func NewManager

func NewManager(querier mssql_queries.Querier, db mysql_queries.DBTX, closer func()) *Manager

func (*Manager) BatchExec

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

func (*Manager) Close

func (m *Manager) Close()

func (*Manager) Exec

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

func (*Manager) GetCreateTableStatement

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

func (*Manager) GetDatabaseSchema

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

func (*Manager) GetRolePermissionsMap

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

func (*Manager) GetSchemaColumnMap

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

func (*Manager) GetSchemaInitStatements

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

func (*Manager) GetSchemaTableTriggers

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

func (*Manager) GetSequencesByTables added in v0.4.73

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

func (*Manager) GetTableConstraintsBySchema

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

func (*Manager) GetTableInitStatements

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

func (*Manager) GetTableRowCount

func (m *Manager) 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