clonablesql

package
v1.0.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClonableSQLiteDatabase

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

ClonableSQLiteDatabase is a wrapper around a gorm database (SQLite) that allows to clone it.

func Clone

func Clone(logger log.Logger, source *ClonableSQLiteDatabase, directory string, filename string, errorHandler func(error)) (*ClonableSQLiteDatabase, error)

Clone creates a new ClonableSQLDatabase instance by copying the SQLite database to a new location.

func NewClonableSQLiteDatabase

func NewClonableSQLiteDatabase(logger log.Logger, directory string, filename string, errorHandler func(error)) *ClonableSQLiteDatabase

NewClonableSQLiteDatabase creates a new ClonableSQLDatabase instance.

func (*ClonableSQLiteDatabase) ExecDBFunc

func (p *ClonableSQLiteDatabase) ExecDBFunc() func(func(*gorm.DB) error) error

ExecDBFunc executes a function with the DB as argument. The DB is locked during the execution of the function.

func (*ClonableSQLiteDatabase) Shutdown

func (p *ClonableSQLiteDatabase) Shutdown()

Shutdown closes the database.

func (*ClonableSQLiteDatabase) Size

func (p *ClonableSQLiteDatabase) Size() int64

Size returns the size of the underlying database.

Jump to

Keyboard shortcuts

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