Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
IsNotFound reports whether err means "no such row" in this backend. GORM already has a single canonical sentinel, so there is nothing to wrap — the bare driver error returned by First()/Take() is matched directly.
Types ¶
type Dependencies ¶
Dependencies struct the sql data store provider
type Options ¶
type Options struct {
// Migrate replaces GORM AutoMigrate. SereneDB rejects the
// ALTER COLUMN ... TYPE that AutoMigrate re-issues on every boot, so it
// supplies its own hand-written, versioned DDL instead.
Migrate func(*gorm.DB) error
// WrapPool wraps the connection pool before GORM sees it. SereneDB uses it
// to retry write conflicts its optimistic MVCC raises. PostgreSQL family
// only.
WrapPool func(*stdsql.DB) gorm.ConnPool
// SkipDefaultTransaction turns off the transaction GORM wraps around every
// single Create/Update/Delete. Only SereneDB sets it: that implicit
// transaction routes every write through BeginTx, where a conflict aborts
// the whole transaction and cannot be retried statement-by-statement. The
// schemas here carry no GORM associations, so one write is one statement
// and the wrapper buys nothing to begin with. Explicit Transaction() blocks
// are unaffected.
SkipDefaultTransaction bool
// RetryTransactions replays an explicit transaction from the start when it
// aborts with a serialization failure (SQLSTATE 40001). Only SereneDB sets
// it: its optimistic MVCC aborts contended transactions instead of making
// them wait, and a statement cannot be retried inside an aborted
// transaction — only the whole block can. Every other backend keeps a
// single attempt, exactly as before.
RetryTransactions bool
}
Options customise how the provider is built. They exist for engines that speak a supported wire protocol but differ underneath; all are zero for every database type this package handles directly, so the default path is unchanged.
type Provider ¶
type Provider = provider
Provider is the SQL storage provider. It is exported so wire-compatible engines that need to override a handful of methods (see internal/storage/db/serenedb) can embed it instead of duplicating the whole backend.
func NewProvider ¶
func NewProvider( config *config.Config, deps *Dependencies, ) (*Provider, error)
NewProvider returns a new SQL provider
func NewProviderWithOptions ¶
func NewProviderWithOptions( config *config.Config, deps *Dependencies, opts Options, ) (*Provider, error)
NewProviderWithOptions returns a new SQL provider with the given hooks applied. See Options.
Source Files
¶
- audit_log.go
- authenticator.go
- client.go
- cockroachdb.go
- email_template.go
- env.go
- errors.go
- federated_identity.go
- gorm_logger.go
- health_check.go
- mfa_session.go
- migrator.go
- mysql.go
- oauth_state.go
- org_domain.go
- org_membership.go
- organization.go
- otp.go
- provider.go
- saml_idp.go
- scim_endpoint.go
- scim_group.go
- session.go
- session_token.go
- sqlserver.go
- transaction.go
- trusted_issuer.go
- user.go
- verification_requests.go
- webauthn_credential.go
- webhook.go
- webhook_log.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package sqlitedialect is a pure-Go GORM SQLite dialector.
|
Package sqlitedialect is a pure-Go GORM SQLite dialector. |