database

package
v0.0.0-...-d9d2748 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseInfo

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

DatabaseInfo holds information about a specific database

type DatabaseManager

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

DatabaseManager manages a single PostgreSQL Docker container with multiple databases

func NewDatabaseManager

func NewDatabaseManager(projectName, dataDir string) (*DatabaseManager, error)

NewDatabaseManager creates a new database manager

func (*DatabaseManager) CreateDatabase

func (m *DatabaseManager) CreateDatabase(name string, intent schema.DatabaseIntent) error

CreateDatabase creates a new database in the PostgreSQL instance if it doesn't exist

func (*DatabaseManager) GetConnectionString

func (m *DatabaseManager) GetConnectionString(name string) string

GetConnectionString returns the PostgreSQL connection string for a specific database

func (*DatabaseManager) GetDatabases

func (m *DatabaseManager) GetDatabases() []string

GetDatabases returns all database names

func (*DatabaseManager) GetEnvVarKey

func (m *DatabaseManager) GetEnvVarKey(name string) string

GetEnvVarKey returns the environment variable key for a database

func (*DatabaseManager) GetPort

func (m *DatabaseManager) GetPort() int

GetPort returns the PostgreSQL port number

func (*DatabaseManager) RemoveVolume

func (m *DatabaseManager) RemoveVolume() error

RemoveVolume removes the Docker volume (data will be lost) This is useful for cleaning up or resetting the database

func (*DatabaseManager) Start

func (m *DatabaseManager) Start() error

Start initializes and starts the PostgreSQL Docker container

func (*DatabaseManager) Stop

func (m *DatabaseManager) Stop() error

Stop shuts down and removes the PostgreSQL container

Jump to

Keyboard shortcuts

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