Documentation
¶
Index ¶
- func DecodeConfig(input any) (database.Dialect, error)
- type Config
- type Pool
- func (p *Pool) Close(_ context.Context) error
- func (s Pool) IsStatements()
- func (p *Pool) Migrate(ctx context.Context) error
- func (s Pool) NewManagedID(prefix string) (string, error)
- func (p *Pool) Ping(ctx context.Context) error
- func (p *Pool) Statements() service.AllStatements
- func (p *Pool) Transaction(ctx context.Context, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Path is a filesystem path to the database file, or ":memory:" for an
// in-memory database. Directories are created on Connect (0o700); the DB
// file and WAL/SHM siblings are tightened to 0o600 after open.
// ":memory:" is process-local: each Connect gets an isolated shared-cache
// database (unique URI name), not a process-wide singleton.
Path string
// DSN is a full modernc.org/sqlite DSN. When set, it takes precedence over
// Path. Required pragmas from Path mode (_txlock, foreign_keys,
// case_sensitive_like, …) are merged into the DSN when missing so callers
// do not silently get SQLite defaults (FK off, case-insensitive LIKE).
DSN string
}
Config holds the SQLite database path (or DSN).
func (Config) Connect ¶
Connect implements database.Dialect.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool wraps a *sql.DB and implements database.Pool and service.Pool.
func (*Pool) Migrate ¶
Migrate implements database.Pool.
func (Pool) NewManagedID ¶
func (*Pool) Statements ¶
func (p *Pool) Statements() service.AllStatements
Statements implements service.Statementer.
func (*Pool) Transaction ¶
func (p *Pool) Transaction(ctx context.Context, fn func(ctx context.Context, tx service.Statementer[service.AllStatements]) error) error
Transaction implements service.Transactioner.
Source Files
¶
- auth_attempt.go
- authz_assignment.go
- authz_catalog.go
- authz_list_predicate.go
- authz_membership_edge.go
- authz_resolver.go
- branding.go
- claim.go
- compiler.go
- crypto_keys.go
- db.go
- deployment.go
- dialect.go
- environment.go
- error.go
- event.go
- flow_definition.go
- idp_connection.go
- idp_identity_link.go
- json.go
- json_schema.go
- managed_id.go
- pool.go
- project.go
- release.go
- resource_scope_index.go
- rows.go
- session.go
- statement.go
- team.go
- team_membership.go
- time.go
- token.go
- user.go
- user_passkey.go
- user_password.go
- user_recovery_codes.go
- user_totp.go
- variable.go
- with_transaction.go
Click to show internal directories.
Click to hide internal directories.