sqlite

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 5 Imported by: 0

README

sqlite

Provides an easy-to-use library for sqlite3 on top of modernc.org/sqlite

  • Easy calls for
    • Create
      • sqlite.DB(dbPath)
    • Close
      • sqlite.DB().Close()
    • Execute
      • sqlite.DB().Execute("drop table if exists tests;")
    • Query
      • Returns an array map of keyed columns as strings and values as interfaces
      • dat, err := sqlite.DB().Query("select id,name from tests order by id;")
      • Types mapped to Go
        • int -> int64
        • float -> float64
        • date as numeric -> int64, string
        • blob -> stored as input
        • null -> nil

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBCon

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

func DB

func DB(args ...string) *DBCon

func (*DBCon) Close

func (d *DBCon) Close() error

func (*DBCon) Execute

func (d *DBCon) Execute(query string) error

func (*DBCon) Query

func (d *DBCon) Query(query string) ([]map[string]interface{}, error)

Jump to

Keyboard shortcuts

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