utils

package
v1.135.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 8 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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