sqlitedialect

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2025 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Version

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

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

func (*Dialect) AppendSequence

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

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

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

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

type DialectOption func(d *Dialect)

func WithoutFeature

func WithoutFeature(other feature.Feature) DialectOption

Jump to

Keyboard shortcuts

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