tools

package
v0.0.0-...-340686f Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compact

func Compact(dbfile string) (nTables, nViews int, oldSize, newSize uint64, err error)

Compact cleans up old records and index nodes that are no longer in use. It does this by copying live data to a new database file. In the process it concurrently does a full check of the database.

func Dump

func Dump(db *Database, to, publicKey string) (nTables, nViews int, err error)

Dump checks and exports the entire database to a file

func DumpDatabase

func DumpDatabase(dbfile, to string) (nTables, nViews int, err error)

DumpDatabase exports the entire database to a file. In the process it concurrently does a full check of the database.

func DumpDbTable

func DumpDbTable(db *Database, table, to, publicKey string) (nrecs int, err error)

func DumpTable

func DumpTable(dbfile, table, to string) (nrecs int, err error)

DumpTable exports a dumped table to a file. It returns the number of records dumped or panics on error.

func LoadDatabase

func LoadDatabase(from, dbfile, privateKey, passphrase string) (
	nTables, nViews int, err error)

LoadDatabase imports a dumped database from a file using a worker pool. It returns the number of tables loaded. Errors are fatal. It does NOT check foreign key data because it assumes the dump was from a valid database.

func LoadDbTable

func LoadDbTable(table, from, privateKey, passphrase string,
	db *Database) (n int, err error)

LoadDbTable loads a single table. It is use by dbms.Load / Database.Load It will replace an already existing table. It returns the number of records loaded.

func LoadTable

func LoadTable(table, dbfile string) (int, error)

LoadTable is used by -load <table>.

Types

type WriterPlus

type WriterPlus interface {
	io.Writer
	WriteString(s string) (n int, err error)
	WriteByte(b byte) error
	Flush() error
}

Jump to

Keyboard shortcuts

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