utils

package
v1.127.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDatabase

func CreateDatabase(db *sqlx.DB, dbName string) error

func CreateOracleUser

func CreateOracleUser(db *sqlx.DB, userName string, password string) error

CreateOracleUser provisions an Oracle schema USER — Oracle's equivalent of "create database": one schema == one user inside the shared service/PDB, so there is no CREATE DATABASE. The name is emitted UNQUOTED and Oracle folds it to UPPERCASE, matching the quoted-UPPERCASE identifiers models.CreateDDL emits. Grants cover the object types the model DDL creates, plus quota. Requires an admin connection (e.g. SYSTEM) on the same service.

func DropDatabase

func DropDatabase(db *sqlx.DB, dbName string) (err error)

func DropOracleUser

func DropOracleUser(db *sqlx.DB, userName string) (err error)

DropOracleUser drops an Oracle schema user and every object it owns (the Oracle equivalent of DROP DATABASE). Sessions held by the user are killed first — DROP USER fails with ORA-01940 while the user is connected.

func FormatIdentifier

func FormatIdentifier(identifier string, driverName string) string

func KillConnections

func KillConnections(db *sqlx.DB, dbName string) (err error)

func PrepareArrayArgs

func PrepareArrayArgs(keyValues map[string]any, driverName string) (fieldNames string, fieldValues string, fieldArgs []any)

func ValidateDatabaseName

func ValidateDatabaseName(dbName string) error

ValidateDatabaseName reports whether a name may be embedded in the provisioning statements in this file. Callers that build their own DDL from a configured name should use it too.

Types

This section is empty.

Jump to

Keyboard shortcuts

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