sqlite

package
v0.0.0-...-2532186 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindRoutes

func BindRoutes(router *gin.RouterGroup, connString string)

BindRoutes bind SQLite routes to REST client

Types

type BodyQuery

type BodyQuery struct {
	ID     string        `json:"id"` // For stored statement
	SQL    string        `json:"sql" binding:"required"`
	Params []interface{} `json:"params"`
}

BodyQuery request body of how it should queried

func (*BodyQuery) Prepare

func (body *BodyQuery) Prepare(s *StatementStore) *sqlx.Stmt

Prepare returns prepared statement If there is ID, add request body to the store

type StatementStore

type StatementStore struct {
	DB *sqlx.DB
	// contains filtered or unexported fields
}

StatementStore storage of SQL statements

func (*StatementStore) Free

func (s *StatementStore) Free()

Free free up all sql statements

func (*StatementStore) Get

func (s *StatementStore) Get(id string) *sqlx.Stmt

Get a statement from store. Return nil if not exists

Jump to

Keyboard shortcuts

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