sqlitedialect

package module
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: BSD-2-Clause Imports: 8 Imported by: 131

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Version added in v1.0.22

func Version() string

Version is the current release version.

Types

type Dialect

type Dialect struct {
	schema.BaseDialect
	// contains filtered or unexported fields
}

func New

func New(opts ...DialectOption) *Dialect

func (*Dialect) AppendBytes added in v1.0.14

func (d *Dialect) AppendBytes(b []byte, bs []byte) []byte

func (*Dialect) AppendSequence added in v1.1.17

func (d *Dialect) AppendSequence(b []byte, table *schema.Table, field *schema.Field) []byte

AppendSequence adds AUTOINCREMENT keyword to the column definition. As per documentation, AUTOINCREMENT is only valid for INTEGER PRIMARY KEY, and this method will be a noop for other columns.

Because this is a valid construct:

CREATE TABLE ("id" INTEGER PRIMARY KEY AUTOINCREMENT);

and this is not:

CREATE TABLE ("id" INTEGER AUTOINCREMENT, PRIMARY KEY ("id"));

AppendSequence adds a primary key constraint as a *side-effect*. Callers should expect it to avoid building invalid SQL. SQLite also does not support AUTOINCREMENT column in composite primary keys.

func (*Dialect) DefaultSchema added in v1.2.6

func (d *Dialect) DefaultSchema() string

DefaultSchemaName is the "schema-name" of the main database. The details might differ from other dialects, but for all means and purposes "main" is the default schema in an SQLite database.

func (*Dialect) DefaultVarcharLen added in v1.1.10

func (d *Dialect) DefaultVarcharLen() int

func (*Dialect) Features

func (d *Dialect) Features() feature.Feature

func (*Dialect) IdentQuote

func (d *Dialect) IdentQuote() byte

func (*Dialect) Init added in v0.2.14

func (d *Dialect) Init(*sql.DB)

func (*Dialect) Name

func (d *Dialect) Name() dialect.Name

func (*Dialect) OnTable

func (d *Dialect) OnTable(table *schema.Table)

func (*Dialect) Tables

func (d *Dialect) Tables() *schema.Tables

type DialectOption added in v1.2.7

type DialectOption func(d *Dialect)

func WithoutFeature added in v1.2.7

func WithoutFeature(other feature.Feature) DialectOption

Jump to

Keyboard shortcuts

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