Documentation
¶
Overview ¶
Package rovadb is the root API layer: it owns the public embedded API surface and contains no engine logic.
Index ¶
- Variables
- func Version() string
- type ColumnInfo
- type DB
- func (db *DB) Begin() (*Tx, error)
- func (db *DB) CheckEngineConsistency() (EngineCheckResult, error)
- func (db *DB) Close() error
- func (db *DB) EngineReport() (string, error)
- func (db *DB) EngineSnapshot() (EngineSnapshot, error)
- func (db *DB) EngineStatus() (EngineStatus, error)
- func (db *DB) Exec(query string, args ...any) (Result, error)
- func (db *DB) ExplainQueryPath(sql string, args ...any) (QueryExecutionTrace, error)
- func (db *DB) GetTableSchema(table string) (TableInfo, error)
- func (db *DB) ListTables() ([]TableInfo, error)
- func (db *DB) PageUsage() (EnginePageUsage, error)
- func (db *DB) Query(query string, args ...any) (*Rows, error)
- func (db *DB) QueryRow(query string, args ...any) *Row
- func (db *DB) SchemaDigest() (string, error)
- func (db *DB) SchemaDigestFromSystemCatalog() (string, error)
- func (db *DB) SchemaInventory() (EngineSchemaInventory, error)
- func (db *DB) VerifySystemCatalogDigest() error
- type DBError
- type EngineCheckResult
- type EngineIndexInfo
- type EnginePageUsage
- type EngineSchemaInventory
- type EngineSnapshot
- type EngineStatus
- type EngineTableInfo
- type ErrorKind
- type OpenOptions
- type QueryExecutionTrace
- type Result
- type Row
- type Rows
- type TableInfo
- type Time
- type Tx
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotImplemented marks API surface that exists before engine behavior does. ErrNotImplemented = errors.New("rovadb: not implemented") // ErrClosed reports use of a closed database handle. ErrClosed = errors.New("rovadb: closed") // ErrInvalidArgument reports invalid input provided to the API. ErrInvalidArgument = errors.New("rovadb: invalid argument") // ErrQueryRequiresSelect reports Query use with a non-SELECT statement. ErrQueryRequiresSelect = errors.New("rovadb: Query requires SELECT statement") // ErrExecDisallowsSelect reports Exec use with a SELECT statement. ErrExecDisallowsSelect = errors.New("rovadb: Exec disallows SELECT statement") // ErrScanMismatch reports that Scan destination count does not match the current row width. ErrScanMismatch = errors.New("rovadb: scan destination count mismatch") // ErrUnsupportedScanType reports unsupported or incompatible Scan destination/value types. ErrUnsupportedScanType = errors.New("rovadb: unsupported scan type") // ErrScanBeforeNext reports Scan without a current row selected by Next. ErrScanBeforeNext = errors.New("rovadb: Scan called before Next") // ErrRowsClosed reports Scan on a closed Rows value. ErrRowsClosed = errors.New("rovadb: rows closed") // ErrNoRows reports that QueryRow.Scan found no rows. ErrNoRows = errors.New("rovadb: no rows") // ErrMultipleRows reports that QueryRow.Scan found more than one row. ErrMultipleRows = errors.New("rovadb: multiple rows") // ErrTxNotActive reports use of a finished explicit transaction handle. ErrTxNotActive = errors.New("rovadb: transaction is not active") )
var ( ErrTxnAlreadyActive = errors.New("rovadb: transaction already active") ErrTxnCommitWithoutActive = errors.New("rovadb: commit requires active transaction") ErrTxnRollbackWithoutActive = errors.New("rovadb: rollback requires active transaction") ErrTxnInvariantViolation = errors.New("rovadb: transaction invariant violation") )
Functions ¶
Types ¶
type ColumnInfo ¶
ColumnInfo describes one column in the public catalog API.
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is the top-level handle for a RovaDB database. Mutating statements execute under an internal autocommit discipline.
func OpenWithOptions ¶
func OpenWithOptions(path string, opts OpenOptions) (*DB, error)
OpenWithOptions returns a database handle for the given path and validates any explicit open-time configuration that is available in this slice.
func (*DB) Begin ¶
Begin starts an explicit transaction.
Explicit transaction execution remains in-memory for now. Existing DB-level autocommit behavior remains unchanged until later slices wire commit and rollback through durable closeout semantics.
func (*DB) CheckEngineConsistency ¶
func (db *DB) CheckEngineConsistency() (EngineCheckResult, error)
CheckEngineConsistency runs a small read-only physical/control-plane check.
func (*DB) EngineReport ¶
EngineReport returns the formatted aggregate engine snapshot.
func (*DB) EngineSnapshot ¶
func (db *DB) EngineSnapshot() (EngineSnapshot, error)
EngineSnapshot returns one deterministic aggregate diagnostic snapshot.
func (*DB) EngineStatus ¶
func (db *DB) EngineStatus() (EngineStatus, error)
EngineStatus returns a stable in-memory status snapshot for diagnostics.
func (*DB) ExplainQueryPath ¶
func (db *DB) ExplainQueryPath(sql string, args ...any) (QueryExecutionTrace, error)
ExplainQueryPath reports the high-level planned execution shape for a query.
func (*DB) GetTableSchema ¶
GetTableSchema returns catalog metadata for one table in the open database.
func (*DB) ListTables ¶
ListTables returns catalog metadata for all tables in the open database.
func (*DB) PageUsage ¶
func (db *DB) PageUsage() (EnginePageUsage, error)
PageUsage returns a compact validated physical page breakdown.
func (*DB) QueryRow ¶
QueryRow executes Query and wraps the resulting row set for deferred handling.
func (*DB) SchemaDigest ¶
SchemaDigest returns a deterministic digest of the current logical schema.
func (*DB) SchemaDigestFromSystemCatalog ¶
SchemaDigestFromSystemCatalog returns the logical schema digest from __sys_* rows.
func (*DB) SchemaInventory ¶
func (db *DB) SchemaInventory() (EngineSchemaInventory, error)
SchemaInventory returns a compact deterministic inventory of user schema objects.
func (*DB) VerifySystemCatalogDigest ¶
VerifySystemCatalogDigest verifies that in-memory and SQL-visible schema digests match.
type EngineCheckResult ¶
type EngineCheckResult struct {
OK bool
CheckedTableRoots int
CheckedTableHeaders int
CheckedIndexRoots int
CheckedSpaceMapPages int
CheckedDataPages int
FreeListHead uint32
}
EngineCheckResult summarizes a small read-only consistency check.
type EngineIndexInfo ¶
type EngineIndexInfo struct {
IndexID uint32
TableName string
IndexName string
RootPageID uint32
IsUnique bool
}
EngineIndexInfo is a compact logical index inventory entry.
type EnginePageUsage ¶
type EnginePageUsage struct {
TotalPages int
HeaderPages int
SpaceMapPages int
TablePages int
IndexLeafPages int
IndexInternalPages int
FreePages int
DirectoryPages int
}
EnginePageUsage summarizes physical page usage by validated page type.
type EngineSchemaInventory ¶
type EngineSchemaInventory struct {
Tables []EngineTableInfo
Indexes []EngineIndexInfo
}
EngineSchemaInventory is a compact logical object inventory.
type EngineSnapshot ¶
type EngineSnapshot struct {
Status EngineStatus
Check EngineCheckResult
PageUsage EnginePageUsage
Inventory EngineSchemaInventory
}
EngineSnapshot aggregates the existing engine diagnostic helpers.
func (EngineSnapshot) String ¶
func (s EngineSnapshot) String() string
String formats the snapshot into a compact deterministic text block.
type EngineStatus ¶
type EngineStatus struct {
DBFormatVersion uint32
WALVersion uint32
LastCheckpointLSN uint64
LastCheckpointPageCount uint32
FreeListHead uint32
TableCount int
IndexCount int
}
EngineStatus is a cheap diagnostic snapshot of engine control-plane state.
type EngineTableInfo ¶
type EngineTableInfo struct {
TableID uint32
TableName string
RootPageID uint32
TableHeaderPageID uint32
FirstSpaceMapPageID uint32
OwnedSpaceMapPages uint32
EnumeratedSpaceMapPages uint32
OwnedDataPages uint32
EnumeratedDataPages uint32
PhysicalMetaPresent bool
PhysicalMetaValid bool
PhysicalInventoryMatch bool
IndexCount int
}
EngineTableInfo is a compact logical table inventory entry.
type OpenOptions ¶
type OpenOptions struct {
DefaultTimezone string
}
OpenOptions configures database open behavior.
type QueryExecutionTrace ¶
type QueryExecutionTrace struct {
ScanType string
TableName string
IndexName string
UsesBTree bool
}
QueryExecutionTrace is a compact read-only summary of planned query shape.
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result represents the outcome of a write operation.
func (Result) RowsAffected ¶
RowsAffected reports the number of rows changed by a write operation.
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
Row is a thin QueryRow wrapper over Rows.
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
Rows represents a fully materialized query result.
func (*Rows) Close ¶
Close marks the row set closed. Rows are fully in memory, so this is lifecycle hygiene only.
func (*Rows) ColumnTypes ¶
ColumnTypes reports the projected result types in query order, when available, using canonical engine type names such as INT, TEXT, DATE, TIME, and TIMESTAMP.
type TableInfo ¶
type TableInfo struct {
Name string
Columns []ColumnInfo
}
TableInfo describes one table in the public catalog API.
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
Time is the public SQL TIME scan value. It has no date or timezone component and is stored as seconds since midnight.
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
Tx is the public transaction handle reserved for explicit transaction support.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
rovadb
command
|
|
|
snapshot
command
|
|
|
examples
|
|
|
basic_usage
command
|
|
|
primary_foreign_keys
command
|
|
|
internal
|
|
|
bufferpool
Package bufferpool owns the in-memory committed/private page mediation layer used between runtime orchestration and durable storage access.
|
Package bufferpool owns the in-memory committed/private page mediation layer used between runtime orchestration and durable storage access. |
|
executor
Package executor is the execution layer: it runs plans and coordinates row flow using storage via narrow interfaces only.
|
Package executor is the execution layer: it runs plans and coordinates row flow using storage via narrow interfaces only. |
|
parser
Package parser is the parser layer: it owns SQL syntax only and has no execution or storage knowledge.
|
Package parser is the parser layer: it owns SQL syntax only and has no execution or storage knowledge. |
|
planner
Package planner is the planner layer: it builds execution plans from parsed structures and has no storage or page awareness.
|
Package planner is the planner layer: it builds execution plans from parsed structures and has no storage or page awareness. |
|
storage
Package storage is the storage layer: it owns pages, WAL, journals, and physical layout with no SQL or plan knowledge.
|
Package storage is the storage layer: it owns pages, WAL, journals, and physical layout with no SQL or plan knowledge. |
|
txn
Package txn owns transaction state transitions and durability-oriented boundary bookkeeping.
|
Package txn owns transaction state transitions and durability-oriented boundary bookkeeping. |