Documentation
¶
Overview ¶
Package dialect abstracts SQL dialect differences: identifier quoting, parameter placeholders, EXPLAIN wrapping, and capability negotiation.
Concrete dialect implementations live in x/providers alongside each database adapter. The heavier EXPLAIN-result parsing (cost.Explainer) and schema introspection (introspect.Introspector) also stay in x/providers because they require live database access. Capabilities drive both codegen rendering and which Gate layers are assembled per database.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capabilities ¶
type Capabilities struct {
// Rendering.
Returning bool // INSERT ... RETURNING (PG/OB-Oracle have; MySQL lacks -> second SELECT for last id)
Savepoint bool
KeysetCursor bool // keyset pagination needs no degradation
// Gate layers (see cost.Gate assembly).
ExplainJSON bool // supports EXPLAIN ... JSON output
ExplainCost bool // EXPLAIN yields a numeric cost (SQLite does not)
ExplainAccurate bool // estimate trustworthiness (PG high; MySQL/OB medium; SQLite low)
StatementTimeout bool // native timeout exists; core does not SET it across pooled connections
ScanRowCap bool // ob max_read_size / mysql max_join_size (runtime scan-row hard cap)
SQLSafeUpdates bool // mysql/ob sql_safe_updates (prevents full-table writes)
ResourceManager bool // ob tenant / oracle resource isolation
}
Capabilities declares what a database supports. It drives codegen rendering (e.g. RETURNING fallback) and which Gate layers are assembled (e.g. whether the Estimate layer is enabled, which DB-native limits apply). See the cost gate design.