database

package
v0.0.0-...-8a0222f Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: AGPL-3.0, GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanDatabase

func CleanDatabase(db *sql.DB) error

CleanDatabase drops all tables in reverse order

func ConnectToWorkspace

func ConnectToWorkspace(cfg *config.DatabaseConfig, workspaceID string) (*sql.DB, error)

ConnectToWorkspace creates a new database connection for a workspace

func EnsureSystemDatabaseExists

func EnsureSystemDatabaseExists(dsn string, dbName string) error

EnsureSystemDatabaseExists creates the system database if it doesn't exist

func EnsureWorkspaceDatabaseExists

func EnsureWorkspaceDatabaseExists(cfg *config.DatabaseConfig, workspaceID string) error

EnsureWorkspaceDatabaseExists creates the workspace database if it doesn't exist

func GetConnectionPoolSettings

func GetConnectionPoolSettings() (maxOpen, maxIdle int, maxLifetime time.Duration)

GetConnectionPoolSettings returns connection pool settings based on environment

func GetPostgresDSN

func GetPostgresDSN(cfg *config.DatabaseConfig) string

GetPostgresDSN returns the DSN for connecting to PostgreSQL server without specifying a database

func GetSystemDSN

func GetSystemDSN(cfg *config.DatabaseConfig) string

GetSystemDSN returns the DSN for the system database

func GetWorkspaceDSN

func GetWorkspaceDSN(cfg *config.DatabaseConfig, workspaceID string) string

GetWorkspaceDSN returns the DSN for a workspace database

func InitializeDatabase

func InitializeDatabase(db *sql.DB, rootEmail string) error

InitializeDatabase creates all necessary database tables if they don't exist

func InitializeWorkspaceDatabase

func InitializeWorkspaceDatabase(db *sql.DB) error

InitializeWorkspaceDatabase creates the necessary tables for a workspace database

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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