db

package
v0.0.0-...-be882d2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URI    string `json:"uri" yaml:"uri"`
	Driver string `json:"driver" yaml:"driver"`
}

Config is the config of database

type SQLStore

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

SQLStore is local sqlite3

func NewStore

func NewStore(cfg Config) *SQLStore

NewStore instantiates a store

func (*SQLStore) DB

func (s *SQLStore) DB() *sql.DB

DB returns the sql db

func (*SQLStore) DriverName

func (s *SQLStore) DriverName() string

DriverName returns the name of the driver

func (*SQLStore) Start

func (s *SQLStore) Start(_ context.Context) error

Start opens the SQL (creates new file if not existing yet)

func (*SQLStore) Stop

func (s *SQLStore) Stop(_ context.Context) error

Stop closes the SQL

Jump to

Keyboard shortcuts

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