database

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Schema

type Schema struct {
	ID          string    `json:"id" db:"id"`
	Version     string    `json:"version" db:"version"`
	SDL         string    `json:"sdl" db:"sdl"`
	Status      string    `json:"status" db:"status"`
	Description string    `json:"description" db:"description"`
	CreatedAt   time.Time `json:"created_at" db:"created_at"`
	UpdatedAt   time.Time `json:"updated_at" db:"updated_at"`
	CreatedBy   string    `json:"created_by" db:"created_by"`
	Checksum    string    `json:"checksum" db:"checksum"`
	IsActive    bool      `json:"is_active" db:"is_active"`
}

Schema represents a database schema record

type SchemaDB

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

SchemaDB handles database operations for schemas

func NewSchemaDB

func NewSchemaDB(connectionString string) (*SchemaDB, error)

NewSchemaDB creates a new schema database connection

func (*SchemaDB) ActivateSchema

func (s *SchemaDB) ActivateSchema(version string) error

ActivateSchema activates a specific schema version

func (*SchemaDB) Close

func (s *SchemaDB) Close() error

Close closes the database connection

func (*SchemaDB) CreateSchema

func (s *SchemaDB) CreateSchema(schema *Schema) error

CreateSchema creates a new schema in the database

func (*SchemaDB) GetActiveSchema

func (s *SchemaDB) GetActiveSchema() (*Schema, error)

GetActiveSchema retrieves the currently active schema

func (*SchemaDB) GetAllSchemas

func (s *SchemaDB) GetAllSchemas() ([]*Schema, error)

GetAllSchemas retrieves all schemas

func (*SchemaDB) GetSchemaByVersion

func (s *SchemaDB) GetSchemaByVersion(version string) (*Schema, error)

GetSchemaByVersion retrieves a schema by version

Jump to

Keyboard shortcuts

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