database

package
v0.5.10 Latest Latest
Warning

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

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

Documentation

Overview

Package database provides low level operations with database.

Package database provides low level operations with database.

Index

Constants

View Source
const (
	DefaultMigrationsDir = "migrations"
	MigrationsTable      = "schema_migrations"
	SQLiteDriver         = "sqlite3"
)

constants for database package.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetDirFunc

type AssetDirFunc func(name string) ([]string, error)

AssetDirFunc returns names files in migrations directory.

type BinDataConfig

type BinDataConfig struct {
	AssetDirFunc AssetDirFunc
	Dir          string
	AssetFunc    bin.AssetFunc
}

BinDataConfig configuration for golang-migrate bindata migrating.

type Database

type Database struct {
	Connector *sqlx.DB
	// contains filtered or unexported fields
}

Database object capable of interacting with Database.

func NewConnector

func NewConnector(cfg *entity.DatabaseConfig, binDataConfig *BinDataConfig, log *logger.Zerolog) (*Database, error)

NewConnector creates a new Database.

func (*Database) Close

func (db *Database) Close()

Close closes database connection.

Directories

Path Synopsis
Package types provides basic operations with SQL types
Package types provides basic operations with SQL types

Jump to

Keyboard shortcuts

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