dbclient

package module
v0.0.0-...-7f566c5 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBClient

type DBClient struct {
	Type   string
	Conn   *sql.DB
	DBName string
	DBHost string
}

func NewDBClient

func NewDBClient(options ...DBOption) (*DBClient, error)

func (*DBClient) Close

func (c *DBClient) Close() error

func (*DBClient) CreateDatabase

func (c *DBClient) CreateDatabase(name string) error

func (*DBClient) CreateTable

func (c *DBClient) CreateTable(name string, fields ...map[string]string) error

func (*DBClient) ListDatabases

func (c *DBClient) ListDatabases() ([]string, error)

func (*DBClient) Ping

func (c *DBClient) Ping() error

type DBOption

type DBOption func(c *DBClient) error

func UsePostgres

func UsePostgres(user, pass, host, name string, useSSL bool) DBOption

func UseSQLite

func UseSQLite(filename string) DBOption

Jump to

Keyboard shortcuts

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