Documentation
¶
Index ¶
- func Version() string
- type Dialect
- func (d *Dialect) AppendBytes(b []byte, bs []byte) []byte
- func (d *Dialect) AppendSequence(b []byte, table *schema.Table, field *schema.Field) []byte
- func (d *Dialect) DefaultSchema() string
- func (d *Dialect) DefaultVarcharLen() int
- func (d *Dialect) Features() feature.Feature
- func (d *Dialect) IdentQuote() byte
- func (d *Dialect) Init(*sql.DB)
- func (d *Dialect) Name() dialect.Name
- func (d *Dialect) OnTable(table *schema.Table)
- func (d *Dialect) Tables() *schema.Tables
- type DialectOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 (*Dialect) AppendSequence ¶ added in v1.1.17
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
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 (*Dialect) IdentQuote ¶
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
Click to show internal directories.
Click to hide internal directories.