database

package
v0.0.0-...-96720f7 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

File Path: monorepo/cloud/maplepress-backend/pkg/storage/database/cassandra/cassandra.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProvideCassandraSession

func ProvideCassandraSession(cfg *config.Config, logger *zap.Logger) (*gocql.Session, error)

ProvideCassandraSession creates a new Cassandra session

Types

type Migrator

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

Migrator handles database schema migrations This encapsulates all migration logic and makes it testable

func NewMigrator

func NewMigrator(cfg *config.Config, logger *zap.Logger) *Migrator

NewMigrator creates a new migration manager

func (*Migrator) Down

func (m *Migrator) Down() error

Down rolls back the last migration Useful for development and rollback scenarios

func (*Migrator) ForceVersion

func (m *Migrator) ForceVersion(version int) error

ForceVersion forces the migration version (useful for fixing dirty states)

func (*Migrator) Up

func (m *Migrator) Up() error

Up runs all pending migrations with dirty state recovery

func (*Migrator) Version

func (m *Migrator) Version() (uint, bool, error)

Version returns the current migration version

Jump to

Keyboard shortcuts

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