dbconnection

package
v0.4.33 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DriverSQLite3 = "sqlite3"

DriverSQLite3 defines SQLite driver name

Variables

This section is empty.

Functions

This section is empty.

Types

type GeneralParams

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

GeneralParams hold connection parameters

func NewConnectionString

func NewConnectionString(driver, server, user, password, database string, options ...string) (connectionString GeneralParams, err error)

NewConnectionString creates new connection parameters

func (GeneralParams) Catalog

func (v GeneralParams) Catalog() string

Catalog returns catalog

func (GeneralParams) ConnectionString

func (v GeneralParams) ConnectionString() string

ConnectionString returns ConnectionString

func (GeneralParams) Database

func (v GeneralParams) Database() string

Database returns DB

func (GeneralParams) Driver

func (v GeneralParams) Driver() string

Driver returns DB

func (GeneralParams) Mode

func (v GeneralParams) Mode() Mode

Mode returns mode

func (GeneralParams) Path

func (v GeneralParams) Path() string

Path returns path to file (for SQLite3)

func (GeneralParams) Port

func (v GeneralParams) Port() int

Port returns port

func (GeneralParams) Server

func (v GeneralParams) Server() string

Server returns server

func (GeneralParams) String

func (v GeneralParams) String() string

String serializes connection parameters to a string

func (GeneralParams) User

func (v GeneralParams) User() string

User returns user

type Mode

type Mode = string

Mode holds read/write mode

const (
	// ModeReadOnly specifies a read-only mode
	ModeReadOnly Mode = "ro"
	// ModeReadWrite specifies read-write mode
	ModeReadWrite Mode = "rw"
)

type Params

type Params interface {
	Driver() string
	Mode() Mode
	Server() string
	Port() int
	Catalog() string
	User() string
	ConnectionString() string
	String() string
}

Params holds params

type SQLite3ConnectionParams

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

SQLite3ConnectionParams defines SQLite connection params

func NewSQLite3ConnectionParams

func NewSQLite3ConnectionParams(path, catalog string, mode Mode) SQLite3ConnectionParams

NewSQLite3ConnectionParams creates new SQLite connection params

func (SQLite3ConnectionParams) Catalog

func (v SQLite3ConnectionParams) Catalog() string

Catalog returns catalog

func (SQLite3ConnectionParams) ConnectionString

func (v SQLite3ConnectionParams) ConnectionString() string

ConnectionString returns connection string

func (SQLite3ConnectionParams) Driver

Driver returns driver

func (SQLite3ConnectionParams) Mode

Mode returns mode

func (SQLite3ConnectionParams) Path

Path returns path

func (SQLite3ConnectionParams) Port

Port returns port

func (SQLite3ConnectionParams) Server

Server returns server

func (SQLite3ConnectionParams) String

func (v SQLite3ConnectionParams) String() string

String serializes to string

func (SQLite3ConnectionParams) User

User returns user

Jump to

Keyboard shortcuts

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