sqlite3

package module
v0.0.0-...-cb542a7 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 5 Imported by: 0

README

sqlite3

pure go for sqlite3

Install

go get github.com/seasonjs/sqlite3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SQLiteTimestampFormats = []string{

	"2006-01-02 15:04:05.999999999-07:00",
	"2006-01-02T15:04:05.999999999-07:00",
	"2006-01-02 15:04:05.999999999",
	"2006-01-02T15:04:05.999999999",
	"2006-01-02 15:04:05",
	"2006-01-02T15:04:05",
	"2006-01-02 15:04",
	"2006-01-02T15:04",
	"2006-01-02",
}

SQLiteTimestampFormats is timestamp formats understood by both this module and SQLite. The first format in the slice will be used when saving time values into the database. When parsing a string from a timestamp or datetime column, the formats are tried in order.

Functions

This section is empty.

Types

type CSQLite

type CSQLite interface {
	SQLiteInit(path string) *CSQLiteCtx
	SQLiteExec(ctx *CSQLiteCtx, sql string) string
	SQLiteClose(ctx *CSQLiteCtx) int
	SQLiteErrMsg(ctx *CSQLiteCtx) string
	SQLiteErrCode(ctx *CSQLiteCtx) int
	Close() error

	SQLitePrepare(ctx *CSQLiteCtx, zSql string) *CSQLiteStmt
	SQLiteFinalize(stmt *CSQLiteStmt) int
	SQLiteReset(stmt *CSQLiteStmt) int
	SQLiteStep(stmt *CSQLiteStmt) int

	SQLiteBindBlob(stmt *CSQLiteStmt, index int, zData []byte) int
	SQLiteBindBlob64(stmt *CSQLiteStmt, index int, zData []byte) int
	SQLiteBindDouble(stmt *CSQLiteStmt, index int, zData float64) int
	SQLiteBindInt(stmt *CSQLiteStmt, index int, zData int) int
	SQLiteBindInt64(stmt *CSQLiteStmt, index int, zData int64) int
	SQLiteBindNull(stmt *CSQLiteStmt, index int) int
	SQLiteBindText(stmt *CSQLiteStmt, index int, zData string) int

	SQLiteColumnName(stmt *CSQLiteStmt, index int) string
	SQLiteColumnText(stmt *CSQLiteStmt, index int) string
}

func NewCSQLite

func NewCSQLite(libraryPath string) (CSQLite, error)

type CSQLiteCtx

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

type CSQLiteImpl

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

func (*CSQLiteImpl) Close

func (c *CSQLiteImpl) Close() error

func (*CSQLiteImpl) SQLiteBindBlob

func (c *CSQLiteImpl) SQLiteBindBlob(stmt *CSQLiteStmt, index int, zData []byte) int

func (*CSQLiteImpl) SQLiteBindBlob64

func (c *CSQLiteImpl) SQLiteBindBlob64(stmt *CSQLiteStmt, index int, zData []byte) int

func (*CSQLiteImpl) SQLiteBindDouble

func (c *CSQLiteImpl) SQLiteBindDouble(stmt *CSQLiteStmt, index int, zData float64) int

func (*CSQLiteImpl) SQLiteBindInt

func (c *CSQLiteImpl) SQLiteBindInt(stmt *CSQLiteStmt, index int, zData int) int

func (*CSQLiteImpl) SQLiteBindInt64

func (c *CSQLiteImpl) SQLiteBindInt64(stmt *CSQLiteStmt, index int, zData int64) int

func (*CSQLiteImpl) SQLiteBindNull

func (c *CSQLiteImpl) SQLiteBindNull(stmt *CSQLiteStmt, index int) int

func (*CSQLiteImpl) SQLiteBindText

func (c *CSQLiteImpl) SQLiteBindText(stmt *CSQLiteStmt, index int, zData string) int

func (*CSQLiteImpl) SQLiteClose

func (c *CSQLiteImpl) SQLiteClose(ctx *CSQLiteCtx) int

func (*CSQLiteImpl) SQLiteColumnName

func (c *CSQLiteImpl) SQLiteColumnName(stmt *CSQLiteStmt, index int) string

func (*CSQLiteImpl) SQLiteColumnText

func (c *CSQLiteImpl) SQLiteColumnText(stmt *CSQLiteStmt, index int) string

func (*CSQLiteImpl) SQLiteErrCode

func (c *CSQLiteImpl) SQLiteErrCode(ctx *CSQLiteCtx) int

func (*CSQLiteImpl) SQLiteErrMsg

func (c *CSQLiteImpl) SQLiteErrMsg(ctx *CSQLiteCtx) string

func (*CSQLiteImpl) SQLiteExec

func (c *CSQLiteImpl) SQLiteExec(ctx *CSQLiteCtx, sql string) string

func (*CSQLiteImpl) SQLiteFinalize

func (c *CSQLiteImpl) SQLiteFinalize(stmt *CSQLiteStmt) int

func (*CSQLiteImpl) SQLiteInit

func (c *CSQLiteImpl) SQLiteInit(path string) *CSQLiteCtx

func (*CSQLiteImpl) SQLitePrepare

func (c *CSQLiteImpl) SQLitePrepare(ctx *CSQLiteCtx, zSql string) *CSQLiteStmt

func (*CSQLiteImpl) SQLiteReset

func (c *CSQLiteImpl) SQLiteReset(stmt *CSQLiteStmt) int

func (*CSQLiteImpl) SQLiteStep

func (c *CSQLiteImpl) SQLiteStep(stmt *CSQLiteStmt) int

type CSQLiteStmt

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

type Col

type Col struct {
	Name  string
	Value string
}

type Connect

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

func (*Connect) Close

func (c *Connect) Close() error

func (*Connect) Exec

func (c *Connect) Exec(sql string) (string, error)

func (*Connect) Prepare

func (c *Connect) Prepare(sql string) (*Stmt, error)

type Result

type Result struct {
	Rows []Col
	// contains filtered or unexported fields
}

type SQLite3

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

func NewSQLite3

func NewSQLite3(dylibPath string) (*SQLite3, error)

func NewSQLite3Auto

func NewSQLite3Auto() (*SQLite3, error)

func (*SQLite3) Close

func (s *SQLite3) Close() error

func (*SQLite3) Open

func (s *SQLite3) Open(path string) (*Connect, error)

type Stmt

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

func (*Stmt) Exec

func (s *Stmt) Exec(args ...any) ([]Result, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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