atlasdb

package
v0.0.0-...-8e88d4a Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package atlasdb implements sqlite3 database storage for accounts and other atlas data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB stores atlas data in a sqlite3 database.

func Open

func Open(name string) (*DB, error)

Open opens a DB from the provided sqlite3 filename.

func (*DB) Close

func (db *DB) Close() error

func (*DB) GetAccount

func (db *DB) GetAccount(uid uint64) (*api0.Account, error)

func (*DB) GetUIDsByUsername

func (db *DB) GetUIDsByUsername(username string) ([]uint64, error)

func (*DB) MigrateDown

func (db *DB) MigrateDown(ctx context.Context, to uint64) error

MigrateDown migrates the database down to the provided version. This will probably eat your data.

func (*DB) MigrateUp

func (db *DB) MigrateUp(ctx context.Context, to uint64) error

MigrateUp migrates the database to the provided version.

func (*DB) SaveAccount

func (db *DB) SaveAccount(a *api0.Account) error

func (*DB) Version

func (db *DB) Version() (current, required uint64, err error)

Version gets the current and required database versions. It should be checked before using the database.

Jump to

Keyboard shortcuts

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