sqlite

package
v0.0.0-...-805313b Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	Connect() error
	Migrate() error
	GetDB() *gorm.DB
}

func NewDatabaseProvider

func NewDatabaseProvider(osWrapper oswrapper.OS, databaseFile string) Database

NewDatabaseProvider returns an instance of DatabaseProvider implementing the Database interface.

type DatabaseProvider

type DatabaseProvider struct {
	DB *gorm.DB
	// contains filtered or unexported fields
}

DatabaseProvider is a struct that holds the database connection.

func (*DatabaseProvider) Connect

func (s *DatabaseProvider) Connect() error

Connect initializes the SQLite database connection.

func (*DatabaseProvider) GetDB

func (s *DatabaseProvider) GetDB() *gorm.DB

GetDB returns the database connection.

func (*DatabaseProvider) Migrate

func (s *DatabaseProvider) Migrate() error

Migrate performs the database schema migration for the Block model.

Jump to

Keyboard shortcuts

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