database

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	Close()
	Connect(dbFile string) error
	Exec(sql string, args ...interface{}) (sql.Result, error)
	Query(sql string, args ...interface{}) (rows.Rows, error)
}

Database Define a common interface for all database drivers

type PaginationInformation added in v0.4.1

type PaginationInformation struct {
	Page           int
	TotalPages     int
	ResultsPerPage int
	TotalResults   int
}

PaginationInformation is used to return information from a pagination query

type PaginationQuery added in v0.4.1

type PaginationQuery struct {
	Page           int
	ResultsPerPage int
}

PaginationQuery accepts current page and resuilts per page to generate a query

type PaginationResult added in v0.4.1

type PaginationResult struct {
	TotalResults int `json:"total"`
}

PaginationResult is used to return pagination details from a count query

type Sqlite

type Sqlite struct {
	Database
	// contains filtered or unexported fields
}

Sqlite Handle an Sqlite connection

func (*Sqlite) Close

func (s *Sqlite) Close()

Close Close open database

func (*Sqlite) Connect

func (s *Sqlite) Connect(dbFile string) error

Connect Connect/open the database

func (*Sqlite) Exec

func (s *Sqlite) Exec(sql string, args ...interface{}) (sql.Result, error)

Exec Execute a query on the database, returning a simple result

func (*Sqlite) Query

func (s *Sqlite) Query(sql string, args ...interface{}) (rows.Rows, error)

Query Query the database

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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