database

package
v0.0.0-...-232ca4f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildWhereClause

func BuildWhereClause(clauses ...Clause) string

BuildWhereClause is deprecated, use individual Where clauses instead

func NewClient

func NewClient(dbManager *Manager) dbpkg.Client

Types

type Clause

type Clause struct {
	Key   string
	Value any
}

type Config

type Config struct {
	DatabaseType   DatabaseType
	SqliteConfig   *SqliteConfig
	PostgresConfig *PostgresConfig
}

type DatabaseType

type DatabaseType string
const (
	DatabaseTypeSqlite   DatabaseType = "sqlite"
	DatabaseTypePostgres DatabaseType = "postgres"
)

type Manager

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

Manager handles database connection and initialization

func NewManager

func NewManager(config *Config) (*Manager, error)

NewManager creates a new database manager

func (*Manager) Close

func (m *Manager) Close() error

Close closes the database connection

func (*Manager) Initialize

func (m *Manager) Initialize() error

Initialize sets up the database tables

func (*Manager) Reset

func (m *Manager) Reset(recreateTables bool) error

Reset drops all tables and optionally recreates them

type Model

type Model interface {
	TableName() string
}

type PostgresConfig

type PostgresConfig struct {
	URL           string
	URLFile       string
	VectorEnabled bool
}

type SqliteConfig

type SqliteConfig struct {
	DatabasePath  string
	VectorEnabled bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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