sqlite

package
v0.0.0-...-fc2d520 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2018 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package sqlite implements a Qlbridge Datasource interface around sqlite that translates mysql syntax to sqlite.

sqlite implements a Qlbridge Datasource interface around sqlite.

Index

Constants

View Source
const (
	// SourceType "sqlite" is the registered Source name in the qlbridge source registry
	SourceType = "sqlite"
)

Variables

This section is empty.

Functions

func MakeId

func MakeId(dv driver.Value) uint64

func TableToString

func TableToString(tbl *schema.Table) string

TableToString Table output a CREATE TABLE statement using mysql dialect.

func TypeFromString

func TypeFromString(t string) value.ValueType

TypeFromString given a string, return data type

func ValueString

func ValueString(t value.ValueType) string

ValueString convert a value.ValueType into a sqlite type descriptor

func WriteField

func WriteField(w *bytes.Buffer, fld *schema.Field)

WriteField write a schema.Field as string output for sqlite create statement

https://www.sqlite.org/datatype3.html

Types

type Key

type Key struct {
	Id uint64
}

Key implements Key and Sort interfaces.

func NewKey

func NewKey(key uint64) *Key

func (*Key) Key

func (m *Key) Key() driver.Value

func (*Key) Less

func (m *Key) Less(than btree.Item) bool

type Source

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

Source implements qlbridge DataSource to a sqlite file based source.

Features - Support full predicate push down to SqlLite. - Support Thread-Safe wrapper around sqlite file.

func (*Source) Close

func (m *Source) Close() error

Close this source, closing the underlying sqlite db file

func (*Source) Init

func (m *Source) Init()

Init the source

func (*Source) Open

func (m *Source) Open(table string) (schema.Conn, error)

Open a connection, since sqlite is not threadsafe, this is locked.

func (*Source) Setup

func (m *Source) Setup(s *schema.Schema) error

Setup this source with schema from parent.

func (*Source) Table

func (m *Source) Table(table string) (*schema.Table, error)

Table gets table schema for given table

func (*Source) Tables

func (m *Source) Tables() []string

Tables gets list of tables

Jump to

Keyboard shortcuts

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