Documentation
¶
Overview ¶
Package sqlite is the SQLite dialect: positional placeholders and double-quoted identifiers.
It imports the render layer and nothing else. See the postgres package in this directory for why each dialect is its own package.
The constructs that only SQLite has live in github.com/ubgo/sqlb/sqlite.
Index ¶
Constants ¶
const Name = render.DialectSQLite
Name is the engine name this dialect reports. Engine packages guard on it.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dialect ¶
type Dialect struct{}
Dialect renders ? placeholders and double-quoted identifiers.
func (Dialect) Placeholder ¶
Placeholder renders ?. SQLite placeholders are positional, so the argument order is the only thing that binds a value to a position.
func (Dialect) QuoteIdent ¶
QuoteIdent double-quotes an identifier, doubling any embedded quote.
func (Dialect) QuoteLiteral ¶
QuoteLiteral writes v as a SQLite literal that reads back as exactly v.
SQLite has no escape character in string literals at all, so doubling the single quote is the whole rule and a backslash is an ordinary character.
The value set is closed: strings, bools, every integer and float kind, []byte, nil, a pointer to any of those, and named types whose underlying type is one of them. time.Time is deliberately absent. SQLite has no time type, and the modernc driver stores a bound time.Time as Go's String form, "2026-09-01 12:30:45.123456789 +0000 UTC", which it then cannot scan back into a time.Time from a TEXT column; a literal in any other spelling would not compare equal to a bound value, and there is no spelling that is right. A NUL in a string, a NaN or an infinity, and every other type are ErrNotInlinable.
func (Dialect) SupportsLikeEscape ¶
SupportsLikeEscape reports true: SQLite accepts an ESCAPE clause on LIKE.
SQLite has no default escape character, so the clause is not optional: a pattern escaped with backslashes matches nothing without it.
func (Dialect) SupportsReturning ¶
SupportsReturning reports true. SQLite has had RETURNING since 3.35, and the driver in contrib/driver-sqlite is well past that.