sqshared

package
v0.14.13 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package sqshared contains shared types for the sqlite3 and moderncsqlite drivers.

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

func ConvertBytes

func ConvertBytes(buf []byte, tfmt string) (string, error)

ConvertBytes is the byte formatter func for sqlite3 databases.

func NewMetadataReader

func NewMetadataReader(db drivers.DB, opts ...metadata.ReaderOption) metadata.Reader

NewMetadataReader creates the metadata reader for sqlite3 databases.

Types

type MetadataReader

type MetadataReader struct {
	metadata.LoggingReader
	// contains filtered or unexported fields
}

func (MetadataReader) Columns

Columns from selected catalog (or all, if empty), matching schemas and tables

func (MetadataReader) FunctionColumns

func (MetadataReader) Functions

func (MetadataReader) IndexColumns

func (MetadataReader) Indexes

func (MetadataReader) Schemas

func (*MetadataReader) SetLimit

func (r *MetadataReader) SetLimit(l int)

func (MetadataReader) Tables

type Time

type Time time.Time

Time provides a type that will correctly scan the various timestamps values stored by the github.com/mattn/go-sqlite3 driver for time.Time values, as well as correctly satisfying the sql/driver/Valuer interface.

func (*Time) Parse

func (t *Time) Parse(s string) error

Parse attempts to Parse string s to t.

func (*Time) Scan

func (t *Time) Scan(v interface{}) error

Scan satisfies the Scanner interface.

func (*Time) Value

func (t *Time) Value() (driver.Value, error)

Value satisfies the Valuer interface.

Jump to

Keyboard shortcuts

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