tiny.sql.FileSparseReadOnlyDatabase
Defined in tiny.sql.
API (5)
Actions
Public operations.
Fields and members
Public fields and members.
Source
Source: lib/sql/src/file.zig:2964
zig
pub const SparseReadOnlyDatabase = struct { storage: [@sizeOf(SparseReadOnlyState)]u8 align(@alignOf(SparseReadOnlyState)), pub fn openExisting( dir: std.Io.Dir, options: SparseReadOptions, ) Error!SparseReadOpenResult { var database: SparseReadOnlyDatabase = undefined; database.impl().* = .{ .io = options.io, .scanner = try wal.Scanner.init(options.workspace), .frame_capacity = options.workspace.refs.len, .probe = options.probe, }; errdefer database.deinit(); if (try database.impl().activate(dir, options.paths, options.control)) |reason| { database.deinit(); return .{ .repair_required = reason }; } return .{ .ready = database }; } pub fn deinit(self: *SparseReadOnlyDatabase) void { self.impl().deinit(); self.* = undefined; } pub fn refresh( self: *SparseReadOnlyDatabase, dir: std.Io.Dir, options: SparseRefreshOptions, ) Error!SparseRefreshResult { return try self.impl().refresh(dir, options); } pub fn snapshot(self: *SparseReadOnlyDatabase) Snapshot { const state = self.impl(); std.debug.assert(state.active); return .{ .source = .{ .sparse = .{ .database = self, .generation = state.generation, } }, .view = .{ .base_generation = state.generation, .end_mark = state.scanner.progress().committed_end_mark, }, }; } fn impl(self: *SparseReadOnlyDatabase) *SparseReadOnlyState { return @ptrCast(&self.storage); }};Source: lib/sql/src/root.zig:181
zig
pub const FileSparseReadOnlyDatabase = file.SparseReadOnlyDatabase;Audit
| Definitions | 5 |
|---|---|
| Public names | 5 |
| Members | 1 |
| Version | 26.7.0 |
| Revision | daab053ee433 |