Documentation
¶
Overview ¶
internal/services/postgres/client.go
internal/services/postgres/migrations.go
internal/services/postgres/postgres.go
Index ¶
- type Client
- func (c *Client) Backup(outputPath string) error
- func (c *Client) Connect() error
- func (c *Client) Exec(query string, args ...interface{}) (sql.Result, error)
- func (c *Client) ExecuteFile(filePath string) error
- func (c *Client) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (c *Client) QueryRow(query string, args ...interface{}) *sql.Row
- func (c *Client) Restore(inputPath string) error
- func (c *Client) Transaction() (*sql.Tx, error)
- type Migration
- type MigrationManager
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides database operations
func (*Client) ExecuteFile ¶
ExecuteFile executes a SQL file
type MigrationManager ¶
type MigrationManager struct {
// contains filtered or unexported fields
}
MigrationManager handles database migrations
func NewMigrationManager ¶
func NewMigrationManager(client *Client) *MigrationManager
NewMigrationManager creates a new migration manager
func (*MigrationManager) Initialize ¶
func (m *MigrationManager) Initialize() error
Initialize creates the migration tracking table
func (*MigrationManager) Migrate ¶
func (m *MigrationManager) Migrate(migrationsPath string) error
Migrate runs all pending migrations
func (*MigrationManager) Status ¶
func (m *MigrationManager) Status() error
Status shows migration status
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service represents PostgreSQL service
func NewService ¶
func NewService(cfg *config.DatabaseConfig) *Service
NewService creates a new PostgreSQL service
func (*Service) GetConnectionString ¶
GetConnectionString returns the connection string
func (*Service) HasExtension ¶
HasExtension checks if an extension is available
func (*Service) Initialize ¶
Initialize initializes the PostgreSQL service
Click to show internal directories.
Click to hide internal directories.