database

package
v0.0.0-...-c0efb99 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

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 type for database

func NewDB

func NewDB(envConfig *config.Environment) *DB

NewDB creates a new database

func (*DB) Close

func (d *DB) Close() error

Close closes the database connection

func (*DB) Connect

func (d *DB) Connect() error

Connect connects to the database

func (*DB) Exec

func (d *DB) Exec(query string, args ...interface{}) (sql.Result, error)

Exec executes a query

func (*DB) Query

func (d *DB) Query(query string, args ...interface{}) (*sql.Rows, error)

Query executes a query that is expected to return rows

func (*DB) QueryRow

func (d *DB) QueryRow(query string, args ...interface{}) *sql.Row

QueryRow executes a query that is expected to return at most one row

type Migration

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

Migration type

func NewMigration

func NewMigration(envConfig *config.Environment) *Migration

NewMigration creates a new instance of the migration.

func (*Migration) Up

func (m *Migration) Up() error

Up executes the migrations

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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