tiny.sql.FileDatabase
Defined in tiny.sql.
An open database over its two files, held for as long as a caller uses the database to read and write through the scopes it hands out.
API (57)
Actions
Public operations.
beginCoordinatorbeginReadbeginWrite: Opens the database's single write transaction so that a caller can stage pages inside that write scope, reserving the configured write capacity on first use and giving the transaction its staging area.checkpoint: Copies committed pages from the write-ahead log into the base file, which keeps the log from growing without bound.deinit: Closes the database and returns everything it borrowed back to the workspace, releasing the read lease registry, closing the base file, the log file, and the directory handle, and returning the pager, the read cache, the transaction staging area, and the path storage.endCoordinatorflushopen: Opens the configured database so that a caller gets a usable database whether the files are new, intact, or left mid-write by an earlier run, recovering whatever the last run left behind by replaying the write-ahead log and rewriting the base file or the log when recovery calls for it.openForTestingopenPublishedReadOnlyopenPublishedReadOnlyForTestingopenReadOnlyopenReadOnlyForTestingownWorkspaceForTestingpoisonpreparePublicationpublicationCommittedrequiresRecoveryreserverestorerestoreWritessavepointsyncWalwalCapacityByteswalIowalSynced
Types and contracts
Public types and contracts.
Fields and members
Public fields and members.
allocatorbase_epochbase_filebase_loadedcoordinator_activedigest_memodiriomax_wal_bytespagerpath_storagepathspublication_stateread_cacheread_leasesrecovery_requiredstate_serialtesting_workspace_ownedtransaction_stagingtree_rootswal_filewal_iowal_syncedwal_writtenworkspacewritablewrite_capacitywrite_reservedwrite_serialwrite_transaction_open
Source
Source: lib/sql/src/file.zig:1746
zig
/// An open database over its two files, held for as long as a caller uses the/// database to read and write through the scopes it hands out. The database/// owns its own directory handle, the base file, the write-ahead log file, and/// the copies of both paths it took at open time, while holding the pager, the/// read cache, digest memo, transaction staging area, and registry of live read/// leases, all borrowed from the workspace. The database allows one write/// transaction at a time, tracks whether one is open, and carries a recovery/// flag that a failed write sets, after which every operation refuses with/// `RecoveryRequired`. Releasing the database with `deinit` is correct only/// once every read lease and the write transaction have ended, which `deinit`/// asserts.pub const Database = struct { pub const Workspace = DatabaseWorkspace; allocator: Allocator, workspace: *Workspace, io: std.Io, dir: std.Io.Dir, path_storage: PathStorage.Loan, paths: Paths, base_file: std.Io.File, wal_file: std.Io.File, pager: pager.Pager, /// The length of the log file. Every write, truncation and /// replacement of the file sets it, so an append that starts here /// ends the file where its write stops. wal_written: usize, wal_synced: bool = true, max_wal_bytes: usize, wal_io: WalIo = .{}, base_loaded: bool, read_cache: ReadCache, digest_memo: DigestMemo, read_leases: ReadLeaseRegistry, base_epoch: u64 = 1, tree_roots: tree.RootCache = .{}, transaction_staging: TransactionStaging, write_capacity: pager.Capacity = .{}, write_reserved: bool = false, write_transaction_open: bool = false, coordinator_active: bool = false, recovery_required: bool = false, writable: bool = true, state_serial: u64 = 0, write_serial: u64 = 0, publication_state: ?PublicationState = null, testing_workspace_owned: if (builtin.is_test) bool else void = if (builtin.is_test) false else {}, pub fn openForTesting( allocator: Allocator, dir: std.Io.Dir, options: OpenOptions, ) Error!Database { if (!builtin.is_test) @compileError("openForTesting is available only in tests"); const workspace = try allocator.create(Workspace); errdefer allocator.destroy(workspace); const path_storage_limits = try PathStorage.Limits.forOpen(options); workspace.* = try Workspace.allocate(allocator, .{ .header = options.header, .max_wal_bytes = options.wal_capacity_bytes orelse options.max_wal_bytes, .path_storage = path_storage_limits, .read_cache_pages = options.read_cache_capacity, }); errdefer workspace.deallocate(allocator); var database = try open(allocator, workspace, dir, options); database.testing_workspace_owned = true; return database; } pub fn ownWorkspaceForTesting(self: *Database) void { if (!builtin.is_test) @compileError("ownWorkspaceForTesting is available only in tests"); std.debug.assert(!self.testing_workspace_owned); self.testing_workspace_owned = true; } /// Opens the configured database so that a caller gets a usable database /// whether the files are new, intact, or left mid-write by an earlier run, /// recovering whatever the last run left behind by replaying the /// write-ahead log and rewriting the base file or the log when recovery /// calls for it. The call borrows the path storage, the read cache, and the /// transaction staging area from the workspace, and takes its own handle on /// the directory and its own copies of both paths so that the caller's /// handle and path strings can go. A failure at any step gives every /// borrowed region and every opened handle back before it returns, so the /// workspace is reusable, while a failure to read or write the files after /// the database is open poisons it with `RecoveryRequired`, and the caller /// reopens. pub fn open( allocator: Allocator, workspace: *Workspace, dir: std.Io.Dir, options: OpenOptions, ) Error!Database { const phase = trace.scope("file.database.open"); defer phase.end(); const wal_capacity_bytes = options.wal_capacity_bytes orelse options.max_wal_bytes; if (wal_capacity_bytes > options.max_wal_bytes) return error.InvalidWalLimit; const path_storage_limits = try PathStorage.Limits.forOpen(options); var path_storage = try workspace.acquirePathStorage(path_storage_limits); errdefer workspace.releasePathStorage(&path_storage) catch unreachable; var read_cache = try workspace.acquireReadCache(.{ .pages = options.read_cache_capacity, }); errdefer workspace.releaseReadCache(&read_cache); read_cache.activate(); var digest_memo = try workspace.acquireDigestMemo(); errdefer workspace.releaseDigestMemo(&digest_memo); try options.control.check(); var publication_state = try PublicationState.init( &path_storage, options.publication, ); errdefer if (publication_state) |*state| state.deinit(); var active_paths = options.paths; var active_lane: ?publication.Lane = null; if (publication_state) |*state| { try options.control.check(); if (state.selected) |token| { var source = try publication.openSelected( options.io, dir, state.basePair(), token, ); defer source.deinit(options.io); state.candidate_lane = source.lane ^ 1; active_lane = try publication.Lane.init( state.basePair(), state.candidate_lane, ); try publication.prepareOpened(options.io, dir, &source, &active_lane.?); } else { try publication.reset(options.io, dir, state.basePair()); active_lane = try publication.Lane.init( state.basePair(), state.candidate_lane, ); } const pair = active_lane.?.pair(); active_paths = .{ .database = pair.database, .wal = pair.wal }; state.phase = .candidate; } try options.control.check(); var recovered = try recoverState(allocator, workspace, dir, .{ .io = options.io, .paths = active_paths, .header = options.header, .max_wal_bytes = options.max_wal_bytes, .wal_capacity_bytes = wal_capacity_bytes, .control = options.control, }); errdefer recovered.deinit(); try options.control.check(); if (recovered.rewrite_base) { try writeBase(options.io, dir, active_paths.database, &recovered.pager); recovered.pager.releaseDurableBase(); recovered.base_loaded = false; } if (recovered.rewrite_wal) try writeWal(options.io, dir, active_paths.wal, &recovered.pager); try options.control.check(); var owned_dir = try dir.openDir(options.io, ".", .{}); errdefer owned_dir.close(options.io); var base_file = try dir.createFile(options.io, active_paths.database, .{ .read = true, .truncate = false }); errdefer base_file.close(options.io); var wal_file = try dir.createFile(options.io, active_paths.wal, .{ .read = true, .truncate = false }); errdefer wal_file.close(options.io); const stored_paths = path_storage.storeCurrent(active_paths) catch unreachable; var transaction_staging = try workspace.acquireTransactionStaging(.{ .frames = try walFrameCapacity(wal_capacity_bytes), }); errdefer workspace.releaseTransactionStaging(&transaction_staging); transaction_staging.activate(); trace.progress("file.database.open.complete"); return .{ .allocator = allocator, .workspace = workspace, .io = options.io, .dir = owned_dir, .path_storage = path_storage, .paths = stored_paths, .base_file = base_file, .wal_file = wal_file, .pager = recovered.pager, .wal_written = recovered.pager.walBytes().len, .max_wal_bytes = options.max_wal_bytes, .base_loaded = recovered.base_loaded, .read_cache = read_cache, .digest_memo = digest_memo, .read_leases = try ReadLeaseRegistry.init(.{ .leases = options.read_lease_limit, }), .transaction_staging = transaction_staging, .write_capacity = options.write_capacity, .publication_state = publication_state, }; } pub fn openPublishedReadOnly( allocator: Allocator, workspace: *Workspace, dir: std.Io.Dir, options: PublishedReadOpenOptions, ) Error!Database { const path_storage_limits = try PathStorage.Limits.forPublished(options.base_paths); var path_storage = try workspace.acquirePathStorage(path_storage_limits); errdefer workspace.releasePathStorage(&path_storage) catch unreachable; var read_cache = try workspace.acquireReadCache(.{ .pages = options.read_cache_capacity, }); errdefer workspace.releaseReadCache(&read_cache); read_cache.activate(); var digest_memo = try workspace.acquireDigestMemo(); errdefer workspace.releaseDigestMemo(&digest_memo); var opened = try publication.openSelected(options.io, dir, .{ .database = options.base_paths.database, .wal = options.base_paths.wal, }, options.token); var opened_owned = true; errdefer if (opened_owned) opened.deinit(options.io); const lane = try publication.Lane.init(.{ .database = options.base_paths.database, .wal = options.base_paths.wal, }, opened.lane); const pair = lane.pair(); var recovered = switch (try recoverReadOnlyFiles( allocator, workspace, opened.database, opened.wal, .{ .io = options.io, .paths = .{ .database = pair.database, .wal = pair.wal }, .header = options.header, .max_wal_bytes = options.max_wal_bytes, .read_cache_capacity = options.read_cache_capacity, }, )) { .ready => |ready| ready, .repair_required => return error.InvalidPublication, }; errdefer workspace.release(&recovered); var owned_dir = try dir.openDir(options.io, ".", .{}); errdefer owned_dir.close(options.io); const stored_paths = path_storage.storeCurrent(.{ .database = pair.database, .wal = pair.wal, }) catch unreachable; var transaction_staging = try workspace.acquireTransactionStaging(.{ .frames = 0 }); errdefer workspace.releaseTransactionStaging(&transaction_staging); transaction_staging.activate(); opened_owned = false; return .{ .allocator = allocator, .workspace = workspace, .io = options.io, .dir = owned_dir, .path_storage = path_storage, .paths = stored_paths, .base_file = opened.database, .wal_file = opened.wal, .pager = recovered, .wal_written = recovered.walBytes().len, .max_wal_bytes = options.max_wal_bytes, .base_loaded = false, .read_cache = read_cache, .digest_memo = digest_memo, .read_leases = try ReadLeaseRegistry.init(.{ .leases = options.read_lease_limit, }), .transaction_staging = transaction_staging, .writable = false, }; } pub fn openPublishedReadOnlyForTesting( allocator: Allocator, dir: std.Io.Dir, options: PublishedReadOpenOptions, ) Error!Database { if (!builtin.is_test) @compileError("openPublishedReadOnlyForTesting is available only in tests"); const workspace = try allocator.create(Workspace); errdefer allocator.destroy(workspace); const path_storage_limits = try PathStorage.Limits.forPublished(options.base_paths); workspace.* = try Workspace.allocate(allocator, .{ .header = options.header, .max_wal_bytes = options.max_wal_bytes, .path_storage = path_storage_limits, .read_cache_pages = options.read_cache_capacity, }); errdefer workspace.deallocate(allocator); var database = try openPublishedReadOnly(allocator, workspace, dir, options); database.ownWorkspaceForTesting(); return database; } pub fn openReadOnly( allocator: Allocator, workspace: *Workspace, dir: std.Io.Dir, options: ReadOpenOptions, ) Error!Database { const path_storage_limits = PathStorage.Limits.forDirect(options.paths); var path_storage = try workspace.acquirePathStorage(path_storage_limits); errdefer workspace.releasePathStorage(&path_storage) catch unreachable; var read_cache = try workspace.acquireReadCache(.{ .pages = options.read_cache_capacity, }); errdefer workspace.releaseReadCache(&read_cache); read_cache.activate(); var digest_memo = try workspace.acquireDigestMemo(); errdefer workspace.releaseDigestMemo(&digest_memo); var base_file = try dir.openFile(options.io, options.paths.database, .{ .allow_directory = false, }); errdefer base_file.close(options.io); var wal_file = try dir.openFile(options.io, options.paths.wal, .{ .allow_directory = false, }); errdefer wal_file.close(options.io); var recovered = switch (try recoverReadOnlyFiles( allocator, workspace, base_file, wal_file, options, )) { .ready => |ready| ready, .repair_required => return error.InvalidDatabaseFile, }; errdefer workspace.release(&recovered); var owned_dir = try dir.openDir(options.io, ".", .{}); errdefer owned_dir.close(options.io); const stored_paths = path_storage.storeCurrent(options.paths) catch unreachable; var transaction_staging = try workspace.acquireTransactionStaging(.{ .frames = 0 }); errdefer workspace.releaseTransactionStaging(&transaction_staging); transaction_staging.activate(); return .{ .allocator = allocator, .workspace = workspace, .io = options.io, .dir = owned_dir, .path_storage = path_storage, .paths = stored_paths, .base_file = base_file, .wal_file = wal_file, .pager = recovered, .wal_written = recovered.walBytes().len, .max_wal_bytes = options.max_wal_bytes, .base_loaded = false, .read_cache = read_cache, .digest_memo = digest_memo, .read_leases = try ReadLeaseRegistry.init(.{ .leases = options.read_lease_limit, }), .transaction_staging = transaction_staging, .writable = false, }; } pub fn openReadOnlyForTesting( allocator: Allocator, dir: std.Io.Dir, options: ReadOpenOptions, ) Error!Database { if (!builtin.is_test) @compileError("openReadOnlyForTesting is available only in tests"); const workspace = try allocator.create(Workspace); errdefer allocator.destroy(workspace); workspace.* = try Workspace.allocate(allocator, .{ .header = options.header, .max_wal_bytes = options.max_wal_bytes, .path_storage = PathStorage.Limits.forDirect(options.paths), .read_cache_pages = options.read_cache_capacity, }); errdefer workspace.deallocate(allocator); var database = try openReadOnly(allocator, workspace, dir, options); database.ownWorkspaceForTesting(); return database; } /// Closes the database and returns everything it borrowed back to the /// workspace, releasing the read lease registry, closing the base file, the /// log file, and the directory handle, and returning the pager, the read /// cache, the transaction staging area, and the path storage. The call /// frees the cached tree roots through the allocator that `open` was given, /// and requires that no write transaction is open, which it asserts. pub fn deinit(self: *Database) void { const allocator = self.allocator; const workspace = self.workspace; const testing_workspace_owned = if (builtin.is_test) self.testing_workspace_owned else false; std.debug.assert(!self.write_transaction_open); self.read_leases.deinit(); self.base_file.close(self.io); self.wal_file.close(self.io); self.dir.close(self.io); self.workspace.release(&self.pager); self.workspace.releaseReadCache(&self.read_cache); self.workspace.releaseDigestMemo(&self.digest_memo); self.workspace.releaseTransactionStaging(&self.transaction_staging); self.tree_roots.deinit(self.allocator); if (self.publication_state) |*state| state.deinit(); self.workspace.releasePathStorage(&self.path_storage) catch @panic("invalid database path-storage loan"); self.* = undefined; if (testing_workspace_owned) { workspace.deallocate(allocator); allocator.destroy(workspace); } } pub fn reserve(self: *Database, capacity: pager.Capacity) Error!void { try self.ensureUsable(); try self.ensureMutable(); try self.pager.reserve(capacity); } pub fn beginRead(self: *Database) Error!ReadLease { try self.ensureUsable(); const index = try self.read_leases.available(); var base_file = try self.leaseBaseFile(); errdefer base_file.deinit(self.io); const view = (try self.pager.beginRead()).view; const serial = try self.read_leases.install( index, base_file, view, self.base_epoch, ); return .{ .database = self, .index = index, .serial = serial }; } /// Returns the base file handle for a new read lease. A lane switch /// closes `base_file` while older leases still read, so a database that /// publishes through lanes gives each lease its own handle. Any other /// database keeps `base_file` open until `deinit`, which every lease ends /// before, so its leases share it. fn leaseBaseFile(self: *Database) Error!ReadLeaseFile { if (self.publication_state == null) return .{ .borrowed = &self.base_file }; return .{ .owned = try self.dir.openFile(self.io, self.paths.database, .{}) }; } pub fn savepoint(self: *Database) Error!Savepoint { try self.ensureUsable(); if (self.write_transaction_open) return error.WriteTransactionOpen; return .{ .database = self, .position = self.pager.position(), .epoch = self.pager.restoreEpoch(), .wal_written = self.wal_written, .state_serial = self.state_serial, .write_serial = self.write_serial, }; } pub fn restore(self: *Database, point: Savepoint) Error!void { try self.ensureUsable(); try self.ensureMutable(); if (point.database != self) return error.TransactionConflict; if (self.write_transaction_open) return error.WriteTransactionOpen; if (self.state_serial == point.state_serial) { if (self.write_serial != point.write_serial) { return error.TransactionConflict; } if (!std.meta.eql(self.pager.position(), point.position)) { return error.TransactionConflict; } if (self.wal_written != point.wal_written) return error.TransactionConflict; return; } const expected_serial = std.math.add(u64, point.state_serial, 1) catch return error.TransactionConflict; const expected_write = std.math.add(u64, point.write_serial, 1) catch return error.TransactionConflict; if (self.state_serial != expected_serial) return error.TransactionConflict; if (self.write_serial != expected_write) return error.TransactionConflict; if (!self.pager.canRestore(point.position, point.epoch)) { return error.TransactionConflict; } try self.restoreTo(point); } pub fn restoreWrites( self: *Database, before: Savepoint, after: Savepoint, ) Error!void { try self.ensureUsable(); try self.ensureMutable(); if (before.database != self or after.database != self) { return error.TransactionConflict; } if (self.write_transaction_open) return error.WriteTransactionOpen; if (self.state_serial != after.state_serial or self.write_serial != after.write_serial or !std.meta.eql(self.pager.position(), after.position) or !std.meta.eql(self.pager.restoreEpoch(), after.epoch) or self.wal_written != after.wal_written) { return error.TransactionConflict; } const state_delta = std.math.sub( u64, after.state_serial, before.state_serial, ) catch return error.TransactionConflict; const write_delta = std.math.sub( u64, after.write_serial, before.write_serial, ) catch return error.TransactionConflict; if (state_delta == 0 or state_delta != write_delta) { return error.TransactionConflict; } if (!self.pager.canRestore(before.position, before.epoch)) { return error.TransactionConflict; } try self.restoreTo(before); } fn restoreTo(self: *Database, point: Savepoint) Error!void { if (self.read_leases.active != 0) return error.ActiveReaders; try self.ensurePublicationCandidate(); self.wal_synced = false; self.wal_file.setLength(self.io, point.position.journal.len) catch |err| return self.ioFailure(err); self.wal_io.resizes += 1; self.wal_file.sync(self.io) catch |err| return self.ioFailure(err); self.wal_synced = true; self.pager.restore(point.position); self.wal_written = point.wal_written; self.state_serial = point.state_serial; self.write_serial = point.write_serial; self.read_cache.clearRetainingCapacity(); } pub fn walCapacityBytes(self: *const Database) usize { return self.pager.walCapacityBytes(); } pub fn walIo(self: *const Database) WalIo { return self.wal_io; } /// Opens the database's single write transaction so that a caller can stage /// pages inside that write scope, reserving the configured write capacity /// on first use and giving the transaction its staging area. The call /// reports `WriteTransactionOpen` when one is already open, and reports /// `UncommittedWalTail` when the log holds frames past the committed end, /// which an interrupted write leaves. A refusal for capacity or for an /// uncommitted tail leaves no transaction open, so the caller is free to /// checkpoint, raise the configured capacity, or reopen and try again. pub fn beginWrite(self: *Database) Error!Transaction { const phase = trace.scope("file.database.begin_write"); defer phase.end(); try self.ensureUsable(); try self.ensureMutable(); try self.ensurePublicationCandidate(); if (self.write_transaction_open) return error.WriteTransactionOpen; if (!self.write_reserved) { try self.pager.reserve(self.write_capacity); self.write_reserved = true; } const view = try self.pager.currentView(); if (view.end_mark != self.pager.frameCount()) return error.UncommittedWalTail; const position = self.pager.position(); self.transaction_staging.begin(self.pager.walStagingCapacity(position)); errdefer self.transaction_staging.end(); self.write_transaction_open = true; return .{ .database = self, .start_position = position, .start_generation = self.pager.baseGeneration(), .staging = &self.transaction_staging, }; } fn appendWal(self: *Database, page_id: u32, db_page_count: u32, image: *const [page.size]u8) Error!void { const phase = trace.scope("file.database.append_wal"); defer phase.end(); try self.ensureWalFrames(1); const position = self.pager.position(); const wal_written = self.wal_written; errdefer self.restoreAppendState(position, wal_written) catch self.poison(); try self.pager.appendWal(page_id, db_page_count, image); self.persistWal(position.journal.len) catch |err| return self.ioFailure(err); trace.progress("file.database.append_wal.complete"); } fn appendWalSync(self: *Database, page_id: u32, db_page_count: u32, image: *const [page.size]u8) Error!void { try self.appendWal(page_id, db_page_count, image); try self.syncWal(); } pub fn syncWal(self: *Database) Error!void { const phase = trace.scope("file.database.sync_wal"); defer phase.end(); try self.ensureUsable(); if (self.wal_synced) return; try self.ensureMutable(); self.wal_file.sync(self.io) catch |err| return self.ioFailure(err); self.wal_io.syncs += 1; self.wal_synced = true; trace.progress("file.database.sync_wal.complete"); } pub fn walSynced(self: *const Database) bool { return self.wal_synced; } /// Copies committed pages from the write-ahead log into the base file, /// which keeps the log from growing without bound. The call reports /// `RecoveryRequired` while a coordinator holds the database, and reports /// `ActiveReaders` when a read lease is still holding the current base /// generation, checking that condition before anything is written. When /// leases from earlier generations are live, the checkpoint keeps older /// readers working by holding back the pages they still need. The operation /// rewrites the log when the checkpoint restarted it. A failure to write /// the files poisons the database with `RecoveryRequired`. pub fn checkpoint(self: *Database, options: CheckpointOptions) Error!pager.Checkpoint { const phase = trace.scope("file.database.checkpoint"); defer phase.end(); try self.ensureUsable(); try options.control.check(); try self.ensureMutable(); try self.ensurePublicationCandidate(); if (self.coordinator_active) return error.RecoveryRequired; if (self.read_leases.hasEpoch(self.base_epoch)) return error.ActiveReaders; const oldest = self.read_leases.oldest(); try self.advanceStateSerial(); var prepared = try self.pager.prepareCheckpoint(.{ .readers = if (oldest) |view| .{ .oldest = view } else .none, .restart_header = options.restart_header, }); defer prepared.deinit(); try options.control.check(); const has_readers = oldest != null; const result = if (has_readers) result: { const committed = try self.pager.commitCheckpoint(prepared); self.writePreparedCheckpoint(prepared) catch |err| return self.ioFailure(err); try options.control.check(); break :result committed; } else result: { self.writePreparedCheckpoint(prepared) catch |err| return self.ioFailure(err); try options.control.check(); const committed = self.pager.commitDurableCheckpoint(prepared) catch |err| return self.ioFailure(err); self.base_loaded = false; break :result committed; }; try options.control.check(); if (result.restarted) { self.rewriteWal() catch |err| return self.ioFailure(err); } try options.control.check(); trace.progress("file.database.checkpoint.complete"); return result; } fn writePreparedCheckpoint(self: *Database, prepared: pager.PreparedCheckpoint) Error!void { const result = prepared.result(); if (result.pages == 0) return; std.debug.assert(prepared.checkpointPageCount() == result.pages); try writeCheckpointPages(self.io, self.base_file, prepared, self.pager.databasePageCount()); self.read_cache.clearRetainingCapacity(); } pub fn flush(self: *Database) Error!void { const phase = trace.scope("file.database.flush"); defer phase.end(); try self.ensureUsable(); try self.ensureMutable(); if (self.read_leases.active != 0) return error.ActiveReaders; try self.ensurePublicationCandidate(); if (self.coordinator_active) return error.RecoveryRequired; try self.advanceStateSerial(); try self.ensureBaseLoaded(); writeBaseFile(self.io, self.base_file, &self.pager) catch |err| return self.ioFailure(err); self.rewriteWal() catch |err| return self.ioFailure(err); self.pager.releaseDurableBase(); self.base_loaded = false; self.read_cache.clearRetainingCapacity(); trace.progress("file.database.flush.complete"); } pub fn beginCoordinator(self: *Database) Error!void { try self.ensureUsable(); try self.ensureMutable(); if (self.coordinator_active or self.write_transaction_open) { return error.RecoveryRequired; } try self.ensurePublicationCandidate(); self.coordinator_active = true; } pub fn endCoordinator(self: *Database) void { std.debug.assert(self.coordinator_active); self.coordinator_active = false; } pub fn poison(self: *Database) void { self.recovery_required = true; } pub fn requiresRecovery(self: *const Database) bool { return self.recovery_required; } pub fn preparePublication(self: *Database) Error!publication.Token { try self.ensureUsable(); try self.ensureMutable(); if (self.write_transaction_open or self.coordinator_active) { return error.RecoveryRequired; } const state = if (self.publication_state) |*value| value else return error.InvalidPublication; if (state.phase != .candidate) return error.InvalidPublication; self.syncWal() catch |err| return self.ioFailure(err); self.base_file.sync(self.io) catch |err| return self.ioFailure(err); const lane = try publication.Lane.init(state.basePair(), state.candidate_lane); if (!std.mem.eql(u8, self.paths.database, lane.pair().database) or !std.mem.eql(u8, self.paths.wal, lane.pair().wal)) { return error.InvalidPublication; } publication.seal(self.io, self.dir, &lane, state.candidate) catch |err| return self.ioFailure(err); state.phase = .sealed; return state.candidate; } pub fn publicationCommitted(self: *Database, next: publication.Token) void { std.debug.assert(self.writable); std.debug.assert(!self.recovery_required); const state = if (self.publication_state) |*value| value else unreachable; std.debug.assert(state.phase == .sealed); std.debug.assert(next != 0); std.debug.assert(next != state.candidate); state.selected = state.candidate; state.candidate = next; state.candidate_lane ^= 1; state.phase = .selected; } fn ensureUsable(self: *const Database) Error!void { if (self.recovery_required) return error.RecoveryRequired; } fn ensureMutable(self: *const Database) Error!void { if (!self.writable) return error.ReadOnlyDatabase; } fn ioFailure(self: *Database, err: Error) Error { if (!self.coordinator_active) self.poison(); return err; } fn ensurePublicationCandidate(self: *Database) Error!void { const state = if (self.publication_state) |*value| value else return; switch (state.phase) { .candidate => return, .sealed => return error.RecoveryRequired, .selected => {}, } if (self.write_transaction_open or self.coordinator_active) { return error.RecoveryRequired; } const lane = try publication.Lane.init(state.basePair(), state.candidate_lane); const pair = lane.pair(); std.debug.assert(self.path_storage.admitsCurrent(.{ .database = pair.database, .wal = pair.wal, })); publication.prepare(self.io, self.dir, self.currentPair(), &lane) catch |err| return self.ioFailure(err); self.openPublicationLane(&lane) catch |err| return self.ioFailure(err); state.phase = .candidate; } fn openPublicationLane(self: *Database, lane: *const publication.Lane) Error!void { const next_epoch = std.math.add(u64, self.base_epoch, 1) catch return error.GenerationOverflow; const pair = lane.pair(); const base_file = try self.dir.openFile(self.io, pair.database, .{ .mode = .read_write }); errdefer base_file.close(self.io); const wal_file = try self.dir.openFile(self.io, pair.wal, .{ .mode = .read_write }); const stored_paths = self.path_storage.storeCurrent(.{ .database = pair.database, .wal = pair.wal, }) catch unreachable; self.base_file.close(self.io); self.wal_file.close(self.io); self.paths = stored_paths; self.base_file = base_file; self.wal_file = wal_file; self.base_epoch = next_epoch; self.read_cache.clearRetainingCapacity(); } fn currentPair(self: *const Database) publication.Pair { return .{ .database = self.paths.database, .wal = self.paths.wal }; } fn rewriteWal(self: *Database) Error!void { if (self.pager.walBytes().len > self.max_wal_bytes) return error.WalLimitExceeded; self.wal_synced = false; try writeWal(self.io, self.dir, self.paths.wal, &self.pager); const reopened = try self.dir.createFile(self.io, self.paths.wal, .{ .read = true, .truncate = false }); self.wal_file.close(self.io); self.wal_file = reopened; self.wal_written = self.pager.walBytes().len; self.wal_synced = true; } fn appendStagedTransactionWal(self: *Database, position: pager.Pager.Position, count: usize, database_page_count: u32) Error!void { try self.ensureWalFrames(count); const wal_written = self.wal_written; errdefer self.restoreAppendState(position, wal_written) catch self.poison(); try self.pager.commitStagedWal(position, count, database_page_count); self.persistWal(position.journal.len) catch |err| return self.ioFailure(err); } fn ensureWalFrames(self: *const Database, count: usize) Error!void { const appended = std.math.mul(usize, count, wal.frame_size) catch return error.TransactionTooLarge; const minimum = std.math.add(usize, wal.header_size, appended) catch return error.TransactionTooLarge; if (minimum > self.max_wal_bytes) return error.TransactionTooLarge; const projected = std.math.add(usize, self.pager.walBytes().len, appended) catch return error.TransactionTooLarge; if (projected > self.max_wal_bytes) return error.WalLimitExceeded; } fn persistWal(self: *Database, start: usize) Error!void { const bytes = self.pager.walBytes(); std.debug.assert(start == self.wal_written); std.debug.assert(start <= bytes.len); self.wal_synced = false; try self.wal_file.writePositionalAll(self.io, bytes[start..], start); self.wal_io.writes += 1; self.wal_written = bytes.len; } fn restoreAppendState( self: *Database, position: pager.Pager.Position, wal_written: usize, ) Error!void { self.pager.restore(position); try self.wal_file.setLength(self.io, position.journal.len); self.wal_io.resizes += 1; self.wal_written = wal_written; } fn advanceStateSerial(self: *Database) Error!void { self.state_serial = std.math.add(u64, self.state_serial, 1) catch return error.GenerationOverflow; } fn advanceWriteSerial(self: *Database) Error!void { const state_serial = std.math.add(u64, self.state_serial, 1) catch return error.GenerationOverflow; const write_serial = std.math.add(u64, self.write_serial, 1) catch return error.GenerationOverflow; self.state_serial = state_serial; self.write_serial = write_serial; } fn ensureBaseLoaded(self: *Database) Error!void { if (self.base_loaded) return; const count = self.pager.basePageCount(); const generation = self.pager.baseGeneration(); var page_id: u32 = 1; while (page_id <= count) : (page_id += 1) _ = try self.loadBasePage(page_id, generation); self.base_loaded = true; } fn loadBasePage(self: *Database, page_id: u32, generation: u64) Error!?[]const u8 { if (page_id == 0 or generation == 0 or page_id > self.pager.basePageCount()) return null; if (try self.pager.pageAt(page_id, .{ .base_generation = generation, .end_mark = 0 })) |bytes| return bytes; var image: [page.size]u8 = undefined; if (!(try self.copyBasePage(page_id, generation, &image))) return null; try self.pager.installBaseAtGeneration(page_id, &image, generation); return try self.pager.pageAt(page_id, .{ .base_generation = generation, .end_mark = 0 }); } fn copyBasePage(self: *Database, page_id: u32, generation: u64, image: *[page.size]u8) Error!bool { if (page_id == 0) return error.InvalidPageId; if (generation == 0 or page_id > self.pager.basePageCount()) return false; const key = ReadCacheKey{ .generation = generation, .page_id = page_id }; if (self.read_cache.get(key, image)) return true; const n = try self.base_file.readPositionalAll(self.io, image[0..], pageOffset(page_id)); if (n != page.size) return error.InvalidDatabaseFile; self.read_cache.put(key, image) catch |err| switch (err) { error.CacheDisabled => {}, }; return true; }};Source: lib/sql/src/root.zig:178
zig
pub const FileDatabase = file.Database;Complete caller list for FileDatabase.beginRead
10 direct callers.
tiny.sql.Tree.count[method] atlib/sql/src/tree.zig:1150tiny.sql.Tree.get[method] atlib/sql/src/tree.zig:938tiny.sql.Tree.getInto[method] atlib/sql/src/tree.zig:952tiny.sql.Tree.identity[method] atlib/sql/src/tree.zig:918tiny.sql.Tree.lastKey[method] atlib/sql/src/tree.zig:959tiny.sql.Tree.range[method] atlib/sql/src/tree.zig:1116tiny.sql.Tree.root[method] atlib/sql/src/tree.zig:1169tiny.sql.Tree.scan[method] atlib/sql/src/tree.zig:1129tiny.sql.Tree.summarize[method] atlib/sql/src/tree.zig:1143tiny.sql.Tree.valueLength[method] atlib/sql/src/tree.zig:945
Complete call list for FileDatabase.beginWrite
12 direct calls.
lib.sql.src.file.Database.ensureMutable[method] — private source atlib/sql/src/file.zig:2498in nearest public ownertiny.sql.indexlib.sql.src.file.Database.ensurePublicationCandidate[method] — private source atlib/sql/src/file.zig:2507in nearest public ownertiny.sql.indexlib.sql.src.file.Database.ensureUsable[method] — private source atlib/sql/src/file.zig:2494in nearest public ownertiny.sql.indextiny.sql.FileTransactionStaging.begin[method] atlib/sql/src/file.zig:3540tiny.sql.FileTransactionStaging.end[method] atlib/sql/src/file.zig:3554tiny.sql.Pager.baseGeneration[method] atlib/sql/src/pager.zig:1199tiny.sql.Pager.currentView[method] atlib/sql/src/pager.zig:1099tiny.sql.Pager.frameCount[method] atlib/sql/src/pager.zig:1151tiny.sql.Pager.position[method] atlib/sql/src/pager.zig:1155tiny.sql.Pager.reserve[method] atlib/sql/src/pager.zig:803tiny.sql.Pager.walStagingCapacity[method] atlib/sql/src/pager.zig:896tiny.sql.trace.scope[function] atlib/sql/src/trace.zig:3
Complete call list for FileDatabase.checkpoint
14 direct calls.
lib.sql.src.file.Database.advanceStateSerial[method] — private source atlib/sql/src/file.zig:2602in nearest public ownertiny.sql.indexlib.sql.src.file.Database.ensureMutable[method] — private source atlib/sql/src/file.zig:2498in nearest public ownertiny.sql.indexlib.sql.src.file.Database.ensurePublicationCandidate[method] — private source atlib/sql/src/file.zig:2507in nearest public ownertiny.sql.indexlib.sql.src.file.Database.ensureUsable[method] — private source atlib/sql/src/file.zig:2494in nearest public ownertiny.sql.indexlib.sql.src.file.Database.ioFailure[method] — private source atlib/sql/src/file.zig:2502in nearest public ownertiny.sql.indexlib.sql.src.file.Database.rewriteWal[method] — private source atlib/sql/src/file.zig:2553in nearest public ownertiny.sql.indexlib.sql.src.file.Database.writePreparedCheckpoint[method] — private source atlib/sql/src/file.zig:2404in nearest public ownertiny.sql.indexlib.sql.src.file.ReadLeaseRegistry.hasEpoch[method] — private source atlib/sql/src/file.zig:1718in nearest public ownertiny.sql.indexlib.sql.src.file.ReadLeaseRegistry.oldest[method] — private source atlib/sql/src/file.zig:1704in nearest public ownertiny.sql.indextiny.sql.Pager.commitCheckpoint[method] atlib/sql/src/pager.zig:1041tiny.sql.Pager.commitDurableCheckpoint[method] atlib/sql/src/pager.zig:1059tiny.sql.Pager.prepareCheckpoint[method] atlib/sql/src/pager.zig:976tiny.sql.trace.progress[function] atlib/sql/src/trace.zig:7tiny.sql.trace.scope[function] atlib/sql/src/trace.zig:3
Complete call list for FileDatabase.flush
12 direct calls.
lib.sql.src.file.Database.advanceStateSerial[method] — private source atlib/sql/src/file.zig:2602in nearest public ownertiny.sql.indexlib.sql.src.file.Database.ensureBaseLoaded[method] — private source atlib/sql/src/file.zig:2616in nearest public ownertiny.sql.indexlib.sql.src.file.Database.ensureMutable[method] — private source atlib/sql/src/file.zig:2498in nearest public ownertiny.sql.indexlib.sql.src.file.Database.ensurePublicationCandidate[method] — private source atlib/sql/src/file.zig:2507in nearest public ownertiny.sql.indexlib.sql.src.file.Database.ensureUsable[method] — private source atlib/sql/src/file.zig:2494in nearest public ownertiny.sql.indexlib.sql.src.file.Database.ioFailure[method] — private source atlib/sql/src/file.zig:2502in nearest public ownertiny.sql.indexlib.sql.src.file.Database.rewriteWal[method] — private source atlib/sql/src/file.zig:2553in nearest public ownertiny.sql.indexlib.sql.src.file.ReadCache.clearRetainingCapacity[method] — private source atlib/sql/src/file.zig:1423in nearest public ownertiny.sql.indexlib.sql.src.file.writeBaseFile[function] — private source atlib/sql/src/file.zig:3795in nearest public ownertiny.sql.indextiny.sql.Pager.releaseDurableBase[method] atlib/sql/src/pager.zig:1092tiny.sql.trace.progress[function] atlib/sql/src/trace.zig:7tiny.sql.trace.scope[function] atlib/sql/src/trace.zig:3
Complete call list for FileDatabase.open
14 direct calls.
lib.sql.src.file.PathStorage.Limits.forOpen[function] — private source atlib/sql/src/file.zig:325in nearest public ownertiny.sql.indexlib.sql.src.file.PublicationState.init[function] — private source atlib/sql/src/file.zig:1546in nearest public ownertiny.sql.indexlib.sql.src.file.ReadLeaseRegistry.init[function] — private source atlib/sql/src/file.zig:1618in nearest public ownertiny.sql.indexlib.sql.src.file.recoverState[function] — private source atlib/sql/src/file.zig:3891in nearest public ownertiny.sql.indexlib.sql.src.file.walFrameCapacity[function] — private source atlib/sql/src/file.zig:4240in nearest public ownertiny.sql.indexlib.sql.src.file.writeBase[function] — private source atlib/sql/src/file.zig:3785in nearest public ownertiny.sql.indexlib.sql.src.file.writeWal[function] — private source atlib/sql/src/file.zig:3828in nearest public ownertiny.sql.indexlib.sql.src.publication.Lane.init[function] — private source atlib/sql/src/publication.zig:71in nearest public ownerlib.sql.src.publicationlib.sql.src.publication.openSelected[function] — private source atlib/sql/src/publication.zig:257in nearest public ownerlib.sql.src.publicationlib.sql.src.publication.prepareOpened[function] — private source atlib/sql/src/publication.zig:170in nearest public ownerlib.sql.src.publicationlib.sql.src.publication.reset[function] — private source atlib/sql/src/publication.zig:281in nearest public ownerlib.sql.src.publicationtiny.sql.trace.progress[function] atlib/sql/src/trace.zig:7tiny.sql.trace.scope[function] atlib/sql/src/trace.zig:3tiny.tldr.formats.elf.liveness.state.deinit[function] atlib/tldr/src/formats/elf/liveness/state.zig:43
Complete caller list for FileDatabase.openForTesting
257 direct callers.
lib.sql.src.catalog.test_catalog_allocates_distinct_roots_for_multiple_relations[function] — test source atlib/sql/src/catalog.zig:3423in nearest public ownertiny.sql.cataloglib.sql.src.catalog.test_catalog_analyzes_composite_index_prefix_distributions[function] — test source atlib/sql/src/catalog.zig:3319in nearest public ownertiny.sql.cataloglib.sql.src.catalog.test_catalog_analyzes_relation_stats_and_reopens_them_without_schema_bump[function] — test source atlib/sql/src/catalog.zig:3165in nearest public ownertiny.sql.cataloglib.sql.src.catalog.test_catalog_clears_relation_stats_without_schema_bump[function] — test source atlib/sql/src/catalog.zig:3234in nearest public ownertiny.sql.cataloglib.sql.src.catalog.test_catalog_diagnoses_pre_identity_object_rows_as_unsupported_format[function] — test source atlib/sql/src/catalog.zig:3518in nearest public ownertiny.sql.cataloglib.sql.src.catalog.test_catalog_diagnoses_pre_identity_stats_rows_as_unsupported_format[function] — test source atlib/sql/src/catalog.zig:3568in nearest public ownertiny.sql.cataloglib.sql.src.catalog.test_catalog_diagnoses_schema_row_arity_drift_as_unsupported_format[function] — test source atlib/sql/src/catalog.zig:3592in nearest public ownertiny.sql.cataloglib.sql.src.catalog.test_catalog_drops_relation_index_and_stats_metadata[function] — test source atlib/sql/src/catalog.zig:3271in nearest public ownertiny.sql.cataloglib.sql.src.catalog.test_catalog_persists_relation_metadata_and_reopens_without_caller_specs[function] — test source atlib/sql/src/catalog.zig:3086in nearest public ownertiny.sql.cataloglib.sql.src.catalog.test_catalog_reader_exposes_one_snapshot_through_query-only_methods[function] — test source atlib/sql/src/catalog.zig:2817in nearest public ownertiny.sql.cataloglib.sql.src.catalog.test_catalog_reads_the_schema,_handle_and_stats_of_one_relation_in_one_pass[function] — test source atlib/sql/src/catalog.zig:2873in nearest public ownertiny.sql.cataloglib.sql.src.catalog.test_catalog_rejects_duplicate_names_inside_one_relation_definition[function] — test source atlib/sql/src/catalog.zig:3473in nearest public ownertiny.sql.cataloglib.sql.src.catalog.test_catalog_rejects_duplicate_object_names[function] — test source atlib/sql/src/catalog.zig:3402in nearest public ownertiny.sql.cataloglib.sql.src.catalog.test_catalog_rejects_newer_schema_format_before_object_rows_decode[function] — test source atlib/sql/src/catalog.zig:3543in nearest public ownertiny.sql.cataloglib.sql.src.catalog.test_catalog_rejects_stats_that_disagree_with_their_relation_and_rows_without_a_schema[function] — test source atlib/sql/src/catalog.zig:2979in nearest public ownertiny.sql.cataloglib.sql.src.connection.TestingConnection.init[method] — private source atlib/sql/src/connection.zig:3028in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_checkout_creates_missing_relations_from_committed_schema_descriptors[function] — test source atlib/sql/src/connection.zig:1600in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_checkout_discards_queued_relation_session_edits[function] — test source atlib/sql/src/connection.zig:1818in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_checkout_drops_relations_absent_from_target_root[function] — test source atlib/sql/src/connection.zig:1708in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_checkout_recreates_stats_for_missing_analyzed_relations[function] — test source atlib/sql/src/connection.zig:1653in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_commits_reuse_history_chunks_for_append_shaped_edits[function] — test source atlib/sql/src/connection.zig:1240in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_drop_table_statement_keeps_pre-drop_commits_readable[function] — test source atlib/sql/src/connection.zig:1763in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_executes_statement_writes_through_its_database_session[function] — test source atlib/sql/src/connection.zig:1379in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_manages_branch_checkout_fast_forward_and_merge_commits[function] — test source atlib/sql/src/connection.zig:1539in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_merges_branch_refs_from_history_snapshots[function] — test source atlib/sql/src/connection.zig:2509in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_open_seeds_first_write_from_committed_database_value[function] — test source atlib/sql/src/connection.zig:1493in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_publishes_catalog_session_values_on_commit[function] — test source atlib/sql/src/connection.zig:1450in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_write_session_stages_statements_before_one_root_flush[function] — test source atlib/sql/src/connection.zig:1888in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_local_connection_commits_the_maintained_database_without_history[function] — test source atlib/sql/src/connection.zig:1324in nearest public ownertiny.sql.connectionlib.sql.src.file.test_file_checkpoints_stream_prepared_WAL_pages_before_restart[function] — test source atlib/sql/src/file.zig:6869in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_appends_after_a_restore_end_the_log_where_they_stop[function] — test source atlib/sql/src/file.zig:7579in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_appends_wal_incrementally_and_recovers_after_reopen[function] — test source atlib/sql/src/file.zig:7145in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_beginWrite_rejects_uncommitted_wal_tail[function] — test source atlib/sql/src/file.zig:7901in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_checkpoint_after_lazy_open_preserves_untouched_base_pages[function] — test source atlib/sql/src/file.zig:7265in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_checkpoint_restart_persists_base_and_truncates_wal[function] — test source atlib/sql/src/file.zig:7178in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_checkpoint_rewrite_carries_tail_to_later_durable_commit[function] — test source atlib/sql/src/file.zig:7322in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_opens_clean_base_pages_lazily[function] — test source atlib/sql/src/file.zig:5191in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_opens_matching_committed_wal_lazily[function] — test source atlib/sql/src/file.zig:5925in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_owns_paths_needed_by_later_checkpoints[function] — test source atlib/sql/src/file.zig:5895in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_read-only_open_discards_a_torn_transaction_batch[function] — test source atlib/sql/src/file.zig:5529in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_rejects_a_wal_limit_smaller_than_the_header[function] — test source atlib/sql/src/file.zig:7956in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_rejects_stale_savepoints[function] — test source atlib/sql/src/file.zig:7720in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_reopen_ignores_uncommitted_appended_tail[function] — test source atlib/sql/src/file.zig:7378in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_reopen_with_matching_wal_header_drops_uncommitted_appended_tail[function] — test source atlib/sql/src/file.zig:7410in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_repeated_near_limit_commits_always_reopen[function] — test source atlib/sql/src/file.zig:8107in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_restores_an_exact_contiguous_write_sequence[function] — test source atlib/sql/src/file.zig:7629in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_savepoint_restores_one_committed_transaction[function] — test source atlib/sql/src/file.zig:7545in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_separates_wal_recovery_limit_from_byte_capacity[function] — test source atlib/sql/src/file.zig:7967in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_wal_bound_survives_checkpoint_rotation_and_reopen[function] — test source atlib/sql/src/file.zig:8047in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_database_write-sequence_restore_rejects_mixed_and_stale_state[function] — test source atlib/sql/src/file.zig:7670in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_open_removes_a_stale_wal_rewrite_sidecar[function] — test source atlib/sql/src/file.zig:7068in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_ordinary_reader_pins_files_and_rejects_mutation[function] — test source atlib/sql/src/file.zig:5030in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_publication_alternates_immutable_lanes_across_commits[function] — test source atlib/sql/src/file.zig:4686in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_publication_lane_path_replacement_remains_allocation_free[function] — test source atlib/sql/src/file.zig:4777in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_publication_opens_a_selected_lane_through_a_fresh_candidate[function] — test source atlib/sql/src/file.zig:4736in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_publication_pinned_writer_read_survives_lazy_base_and_two_lane_reuses[function] — test source atlib/sql/src/file.zig:4800in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_publication_read_lease_retains_wal_view_across_candidate_checkpoint[function] — test source atlib/sql/src/file.zig:7212in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_publication_reports_an_opaque_physical_footprint[function] — test source atlib/sql/src/file.zig:4942in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_published_reader_pins_a_lazy_base_across_lane_reuse[function] — test source atlib/sql/src/file.zig:4977in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_read_lease_acquisition_failure_leaves_no_live_slot[function] — test source atlib/sql/src/file.zig:4917in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_read_leases_reject_at_the_configured_fixed_capacity_and_reuse_released_slots[function] — test source atlib/sql/src/file.zig:4891in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_read_leases_share_the_base_file_unless_lanes_can_replace_it[function] — test source atlib/sql/src/file.zig:4845in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_recovery_discards_a_torn_transaction_batch[function] — test source atlib/sql/src/file.zig:8207in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_recovery_heals_a_torn_base_tail_covered_by_the_wal[function] — test source atlib/sql/src/file.zig:7087in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_recovery_rejects_a_torn_base_tail_the_wal_does_not_cover[function] — test source atlib/sql/src/file.zig:7119in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_snapshot_copies_carry_the_check_marks_of_their_stored_images[function] — test source atlib/sql/src/file.zig:6721in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_snapshot_copyPage_caches_base_reads_without_pager_retention[function] — test source atlib/sql/src/file.zig:6675in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_snapshot_copyPage_honors_read_cache_capacity_option[function] — test source atlib/sql/src/file.zig:6794in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_sparse_snapshot_cancellation_precedes_wal_payload_reads[function] — test source atlib/sql/src/file.zig:5743in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_sparse_snapshot_interruption_invalidates_an_incremental_refresh[function] — test source atlib/sql/src/file.zig:5810in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_sparse_snapshot_refresh_reads_only_appended_wal_frames[function] — test source atlib/sql/src/file.zig:5619in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_sparse_snapshot_rejects_wal_capacity_before_payload_reads[function] — test source atlib/sql/src/file.zig:5716in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_sparse_snapshot_reopens_a_checkpoint_generation[function] — test source atlib/sql/src/file.zig:5654in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_sparse_snapshot_verifies_a_selected_wal_frame_before_copying[function] — test source atlib/sql/src/file.zig:5850in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_transaction_coalesces_repeated_page_writes[function] — test source atlib/sql/src/file.zig:7807in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_transaction_commits_edits_made_through_a_staged_page[function] — test source atlib/sql/src/file.zig:7836in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_transaction_commits_multiple_pages_with_one_commit_marker[function] — test source atlib/sql/src/file.zig:7762in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_transaction_larger_than_the_wal_bound_leaves_no_tail[function] — test source atlib/sql/src/file.zig:8175in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_transaction_rejects_concurrent_pager_changes[function] — test source atlib/sql/src/file.zig:7873in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_transaction_synced_commit_recovers_after_reopen[function] — test source atlib/sql/src/file.zig:7918in nearest public ownertiny.sql.indexlib.sql.src.file.test_file_transaction_transfers_staged_WAL_pages_without_a_page_owner[function] — test source atlib/sql/src/file.zig:7442in nearest public ownertiny.sql.indexlib.sql.src.plan.test_prepared_relation_cache_key_changes_after_data_root_changes[function] — test source atlib/sql/src/plan.zig:737in nearest public ownertiny.sql.planlib.sql.src.plan.test_prepared_relation_cache_key_includes_parameter_shape[function] — test source atlib/sql/src/plan.zig:767in nearest public ownertiny.sql.planlib.sql.src.plan.test_prepared_relation_data_changes_preserve_captured_schema[function] — test source atlib/sql/src/plan.zig:703in nearest public ownertiny.sql.planlib.sql.src.plan.test_prepared_relation_detects_external_relation_root_changes[function] — test source atlib/sql/src/plan.zig:648in nearest public ownertiny.sql.planlib.sql.src.plan.test_prepared_relation_ignores_unrelated_catalog_schema_version_bumps[function] — test source atlib/sql/src/plan.zig:575in nearest public ownertiny.sql.planlib.sql.src.plan.test_prepared_relation_invalidates_by_stats_root_without_schema_change[function] — test source atlib/sql/src/plan.zig:799in nearest public ownertiny.sql.planlib.sql.src.properties.crash.crashAndVerify[function] — private source atlib/sql/src/properties/crash.zig:262in nearest public ownerlib.sql.src.properties.crashlib.sql.src.properties.crash.runPlan[function] — private source atlib/sql/src/properties/crash.zig:106in nearest public ownerlib.sql.src.properties.crashlib.sql.src.properties.crash.test_property:_ordinary_file_database_fences_a_failed_WAL_sync[function] — test source atlib/sql/src/properties/crash.zig:403in nearest public ownerlib.sql.src.properties.crashlib.sql.src.relation.test_relation_applies_edit_batches_to_table_and_secondary_indexes[function] — test source atlib/sql/src/relation.zig:759in nearest public ownertiny.sql.relationlib.sql.src.relation.test_relation_applies_update_edits_within_batches[function] — test source atlib/sql/src/relation.zig:904in nearest public ownertiny.sql.relationlib.sql.src.relation.test_relation_delete_removes_table_row_and_secondary_index_entry[function] — test source atlib/sql/src/relation.zig:731in nearest public ownertiny.sql.relationlib.sql.src.relation.test_relation_maintains_secondary_index_through_replace_and_reopen[function] — test source atlib/sql/src/relation.zig:682in nearest public ownertiny.sql.relationlib.sql.src.relation.test_relation_put_accepts_rows_larger_than_a_page[function] — test source atlib/sql/src/relation.zig:1073in nearest public ownertiny.sql.relationlib.sql.src.relation.test_relation_reader_scans_and_looks_up_one_fixed_snapshot[function] — test source atlib/sql/src/relation.zig:618in nearest public ownertiny.sql.relationlib.sql.src.relation.test_relation_rejects_an_index_key_larger_than_a_page_and_stays_writable[function] — test source atlib/sql/src/relation.zig:1028in nearest public ownertiny.sql.relationlib.sql.src.relation.test_relation_rejects_mismatched_secondary_index_entries[function] — test source atlib/sql/src/relation.zig:988in nearest public ownertiny.sql.relationlib.sql.src.relation.test_relation_rejects_orphaned_secondary_index_entries[function] — test source atlib/sql/src/relation.zig:968in nearest public ownertiny.sql.relationlib.sql.src.relation.test_relation_update_merges_assigned_columns_and_maintains_secondary_index[function] — test source atlib/sql/src/relation.zig:843in nearest public ownertiny.sql.relationlib.sql.src.relation.test_relation_update_requires_an_existing_row_and_known_columns[function] — test source atlib/sql/src/relation.zig:879in nearest public ownertiny.sql.relationlib.sql.src.relation.test_relation_validates_secondary_indexes_against_table_rows[function] — test source atlib/sql/src/relation.zig:946in nearest public ownertiny.sql.relationlib.sql.src.search.engine.test_search_OR_unions_exact_hits_and_sums_duplicate_scores[function] — test source atlib/sql/src/search/engine.zig:2655in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_bounds_oversized_documents_to_page_safe_text[function] — test source atlib/sql/src/search/engine.zig:3262in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_bulk_load_can_rebuild_identical_exact_postings_across_reopen[function] — test source atlib/sql/src/search/engine.zig:3182in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_bulk_load_rebuilds_changed_phrase_pair_postings[function] — test source atlib/sql/src/search/engine.zig:3217in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_bulk_load_replaces_existing_documents[function] — test source atlib/sql/src/search/engine.zig:3074in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_bulk_load_stores_fresh_documents_in_sorted_posting_order[function] — test source atlib/sql/src/search/engine.zig:2924in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_bulk_load_stores_repeated_terms_in_immutable_segments[function] — test source atlib/sql/src/search/engine.zig:2951in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_bulk_put_stores_documents_in_one_commit[function] — test source atlib/sql/src/search/engine.zig:2897in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_can_skip_prefix_postings_for_exact_workloads[function] — test source atlib/sql/src/search/engine.zig:3295in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_changed_put_updates_exact_and_phrase_posting_counts[function] — test source atlib/sql/src/search/engine.zig:2866in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_clear_removes_indexed_documents_and_postings[function] — test source atlib/sql/src/search/engine.zig:3112in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_exact-only_index_reopens[function] — test source atlib/sql/src/search/engine.zig:3319in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_exact-only_prefix_rows_remain_sorted_for_conjunctions[function] — test source atlib/sql/src/search/engine.zig:2131in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_exact_ranking_uses_posting_term_frequencies[function] — test source atlib/sql/src/search/engine.zig:2250in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_field_separators_bound_phrase_and_near_matches[function] — test source atlib/sql/src/search/engine.zig:1889in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_identical_put_commits_no_pages[function] — test source atlib/sql/src/search/engine.zig:2843in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_limited_OR_keeps_best_hits_before_rowid_order[function] — test source atlib/sql/src/search/engine.zig:2716in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_limited_OR_streams_multiple_exact_terms[function] — test source atlib/sql/src/search/engine.zig:2740in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_limited_OR_streams_segmented_terms_with_direct_tombstones[function] — test source atlib/sql/src/search/engine.zig:2774in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_limited_results_keep_total[function] — test source atlib/sql/src/search/engine.zig:2079in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_loadAllNew_loads_cleared_sorted_batches_across_reopen[function] — test source atlib/sql/src/search/engine.zig:3140in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_negative_field_atoms_subtract_only_field_matches[function] — test source atlib/sql/src/search/engine.zig:1974in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_phrase_matching_preserves_skipped_token_gaps[function] — test source atlib/sql/src/search/engine.zig:2153in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_phrase_pair_capability_persists_across_empty_index_opt_in[function] — test source atlib/sql/src/search/engine.zig:2450in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_phrase_pair_incremental_opt_in_requires_rebuild[function] — test source atlib/sql/src/search/engine.zig:2491in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_phrase_pair_singleton_omission_segments_repeated_pairs[function] — test source atlib/sql/src/search/engine.zig:2411in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_phrase_pair_singleton_omission_verifies_candidates[function] — test source atlib/sql/src/search/engine.zig:2372in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_posting_stats_classify_phrase_pair_segments[function] — test source atlib/sql/src/search/engine.zig:3026in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_prepared_query_reuses_parsed_exact_clauses[function] — test source atlib/sql/src/search/engine.zig:2050in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_ranked_field_clauses_verify_candidates_and_keep_negative_matches[function] — test source atlib/sql/src/search/engine.zig:2010in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_ranked_phrase_excludes_token_intersection_false_positives[function] — test source atlib/sql/src/search/engine.zig:2327in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_ranked_phrase_pair_uses_posting_frequency[function] — test source atlib/sql/src/search/engine.zig:2348in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_ranked_prefix_uses_prefix_posting_frequency[function] — test source atlib/sql/src/search/engine.zig:2528in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_ranked_query_boosts_rare_exact_terms_over_common_frequency[function] — test source atlib/sql/src/search/engine.zig:2276in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_ranked_query_keeps_stats_valid_across_load_replace_and_delete[function] — test source atlib/sql/src/search/engine.zig:2551in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_ranked_query_normalizes_document_length[function] — test source atlib/sql/src/search/engine.zig:2305in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_read-only_reader_queries_a_fixed_file_snapshot_without_write_declarations[function] — test source atlib/sql/src/search/engine.zig:1698in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_rejects_stale_posting_payloads[function] — test source atlib/sql/src/search/engine.zig:2822in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_reopens_glom_shaped_document_text[function] — test source atlib/sql/src/search/engine.zig:3435in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_reopens_large_rowids[function] — test source atlib/sql/src/search/engine.zig:3407in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_replacement_and_delete_update_postings_atomically[function] — test source atlib/sql/src/search/engine.zig:2182in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_replacement_tolerates_missing_old_postings[function] — test source atlib/sql/src/search/engine.zig:2223in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_score_band_keeps_OR_cutoff_ties[function] — test source atlib/sql/src/search/engine.zig:2690in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_score_band_keeps_exact_term_cutoff_ties[function] — test source atlib/sql/src/search/engine.zig:2593in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_score_band_streams_segmented_exact_term_cutoff_ties[function] — test source atlib/sql/src/search/engine.zig:2626in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_shared_tablespace_writes_later_reserved_table_root[function] — test source atlib/sql/src/search/engine.zig:3468in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_shared_tablespace_writes_refs_after_reopen_query[function] — test source atlib/sql/src/search/engine.zig:3502in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_shares_tablespace_with_rowid_table_roots[function] — test source atlib/sql/src/search/engine.zig:3346in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_shares_tablespace_with_two_search_roots[function] — test source atlib/sql/src/search/engine.zig:3376in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_source_revisions_gate_document_updates[function] — test source atlib/sql/src/search/engine.zig:3550in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_stores_large_documents_through_overflow_rows[function] — test source atlib/sql/src/search/engine.zig:3239in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_subtracts_negative_doclists_before_scoring[function] — test source atlib/sql/src/search/engine.zig:2106in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_supports_exact_prefix_phrase_boolean_and_reopen[function] — test source atlib/sql/src/search/engine.zig:1766in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_supports_fts_near_expressions[function] — test source atlib/sql/src/search/engine.zig:1840in nearest public ownerlib.sql.src.search.enginelib.sql.src.search.engine.test_search_supports_grouped_boolean_and_field_filters[function] — test source atlib/sql/src/search/engine.zig:1927in nearest public ownerlib.sql.src.search.enginelib.sql.src.session.test.test_database_session_applies_catalog_roots_before_history_commits[function] — test source atlib/sql/src/session/test.zig:806in nearest public ownerlib.sql.src.session.testlib.sql.src.session.test.test_database_session_assembles_staged_flushes_from_working_database_value[function] — test source atlib/sql/src/session/test.zig:657in nearest public ownerlib.sql.src.session.testlib.sql.src.session.test.test_database_session_clears_analyzed_stats_after_relation_edits[function] — test source atlib/sql/src/session/test.zig:905in nearest public ownerlib.sql.src.session.testlib.sql.src.session.test.test_database_session_deinit_discards_queued_relation_edits[function] — test source atlib/sql/src/session/test.zig:750in nearest public ownerlib.sql.src.session.testlib.sql.src.session.test.test_database_session_flushes_queued_relation_edits_into_one_working_root[function] — test source atlib/sql/src/session/test.zig:564in nearest public ownerlib.sql.src.session.testlib.sql.src.session.test.test_database_session_rejects_staged_relations_that_drift_from_working_values[function] — test source atlib/sql/src/session/test.zig:418in nearest public ownerlib.sql.src.session.testlib.sql.src.session.test.test_database_session_stages_flushed_database_roots_before_history_commits[function] — test source atlib/sql/src/session/test.zig:478in nearest public ownerlib.sql.src.session.testlib.sql.src.session.test.test_database_write_appends_staged_edits_to_staged_relations[function] — test source atlib/sql/src/session/test.zig:110in nearest public ownerlib.sql.src.session.testlib.sql.src.session.test.test_database_write_can_trust_staged_relation_indexes[function] — test source atlib/sql/src/session/test.zig:331in nearest public ownerlib.sql.src.session.testlib.sql.src.session.test.test_database_write_limits_bound_staged_edit_storage[function] — test source atlib/sql/src/session/test.zig:185in nearest public ownerlib.sql.src.session.testlib.sql.src.session.test.test_relation_sessions_stage_edits_through_database_flush[function] — test source atlib/sql/src/session/test.zig:39in nearest public ownerlib.sql.src.session.testlib.sql.src.space.test_space_keeps_table_growth_away_from_reserved_index_root[function] — test source atlib/sql/src/space.zig:216in nearest public ownertiny.sql.spacelib.sql.src.space.test_space_rejects_invalid_roots[function] — test source atlib/sql/src/space.zig:200in nearest public ownertiny.sql.spacelib.sql.src.statement.execute.test_covering_index_and_table_scan_return_the_same_overflow-backed_cards[function] — test source atlib/sql/src/statement/execute.zig:4208in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_covering_planner_requires_order,_binary_covered_columns_and_a_lower_cost[function] — test source atlib/sql/src/statement/execute.zig:4113in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_index_cursor_keeps_one_relation_read_across_table_mutation[function] — test source atlib/sql/src/statement/execute.zig:2805in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_read_only_statements_use_composite_event_window_indexes[function] — test source atlib/sql/src/statement/execute.zig:2557in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statement_cache_key_includes_parameter_shape[function] — test source atlib/sql/src/statement/execute.zig:3905in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statement_ignores_unrelated_catalog_schema_changes[function] — test source atlib/sql/src/statement/execute.zig:3944in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statement_reprepares_after_stats_root_changes[function] — test source atlib/sql/src/statement/execute.zig:3989in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_bind_parameters_by_index_and_name[function] — test source atlib/sql/src/statement/execute.zig:3829in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_choose_indexed_and_scanned_predicates[function] — test source atlib/sql/src/statement/execute.zig:2861in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_create_indexes_over_existing_rows[function] — test source atlib/sql/src/statement/execute.zig:2491in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_delete_rows_matching_predicates[function] — test source atlib/sql/src/statement/execute.zig:1893in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_drop_tables_and_report_missing_tables[function] — test source atlib/sql/src/statement/execute.zig:2602in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_insert_select_and_delete_rowid_rows[function] — test source atlib/sql/src/statement/execute.zig:2663in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_order_selected_rows_with_windows[function] — test source atlib/sql/src/statement/execute.zig:1381in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_require_matching_predicate_index_collation[function] — test source atlib/sql/src/statement/execute.zig:3768in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_resolve_catalog_columns_for_insert_and_select_projection[function] — test source atlib/sql/src/statement/execute.zig:2735in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_route_catalog_writes_through_database_sessions[function] — test source atlib/sql/src/statement/execute.zig:2427in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_select_bare_tables_with_limit_and_offset_windows[function] — test source atlib/sql/src/statement/execute.zig:1622in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_stage_bounded_writes_without_steady_allocation[function] — test source atlib/sql/src/statement/execute.zig:2270in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_stage_predicate_deletes_with_read-your-writes[function] — test source atlib/sql/src/statement/execute.zig:2098in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_stage_predicate_updates_with_read-your-writes[function] — test source atlib/sql/src/statement/execute.zig:2016in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_stage_repeated_executes_against_one_staged_base[function] — test source atlib/sql/src/statement/execute.zig:2177in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_stage_updates_with_read-your-writes[function] — test source atlib/sql/src/statement/execute.zig:1960in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_stream_rowid-ascending_orders_through_the_scan_window[function] — test source atlib/sql/src/statement/execute.zig:1544in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_surface_staged_base_drift_at_flush[function] — test source atlib/sql/src/statement/execute.zig:2362in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_update_assigned_columns_by_rowid[function] — test source atlib/sql/src/statement/execute.zig:1722in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_update_rows_matching_predicates[function] — test source atlib/sql/src/statement/execute.zig:1796in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_use_analyzed_distribution_to_avoid_unselective_literal_index[function] — test source atlib/sql/src/statement/execute.zig:3468in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_use_analyzed_stats_to_prefer_covered_index[function] — test source atlib/sql/src/statement/execute.zig:3374in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_use_and_predicates_with_composite_index_prefixes[function] — test source atlib/sql/src/statement/execute.zig:3097in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_use_bound_distribution_for_runtime_access[function] — test source atlib/sql/src/statement/execute.zig:3564in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_use_composite_index_after_checkpoint_reopen[function] — test source atlib/sql/src/statement/execute.zig:3245in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_use_composite_prefix_distribution_for_runtime_range_access[function] — test source atlib/sql/src/statement/execute.zig:3670in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_prepared_statements_use_large_composite_index_after_checkpoint_reopen[function] — test source atlib/sql/src/statement/execute.zig:3303in nearest public ownerlib.sql.src.statement.executelib.sql.src.statement.execute.test_sorted_cursor_allocation_failure_leaves_cleanup_empty_and_retryable[function] — test source atlib/sql/src/statement/execute.zig:1471in nearest public ownerlib.sql.src.statement.executelib.sql.src.sync.createStore[function] — private source atlib/sql/src/sync.zig:1844in nearest public ownertiny.sql.synclib.sql.src.table.test_rowid_table_deletes_and_recovers_after_reopen[function] — test source atlib/sql/src/table.zig:737in nearest public ownertiny.sql.tablelib.sql.src.table.test_rowid_table_key_projection_avoids_overflow_materialization[function] — test source atlib/sql/src/table.zig:660in nearest public ownertiny.sql.tablelib.sql.src.table.test_rowid_table_reports_the_last_assigned_rowid[function] — test source atlib/sql/src/table.zig:713in nearest public ownertiny.sql.tablelib.sql.src.table.test_rowid_table_stores_typed_rows_and_scans_in_rowid_order[function] — test source atlib/sql/src/table.zig:626in nearest public ownertiny.sql.tablelib.sql.src.table.test_table_value_storage_is_sealed_before_inline_overflow_and_rejection_reads[function] — test source atlib/sql/src/table.zig:519in nearest public ownertiny.sql.tablelib.sql.src.table.test_table_value_storage_preserves_typed_row_semantics[function] — test source atlib/sql/src/table.zig:587in nearest public ownertiny.sql.tablelib.sql.src.test_secondary_index_honors_configured_text_collation[function] — test source atlib/sql/src/index.zig:469in nearest public ownertiny.sql.indexlib.sql.src.test_secondary_index_range_scan_uses_encoded_value_bounds[function] — test source atlib/sql/src/index.zig:419in nearest public ownertiny.sql.indexlib.sql.src.test_secondary_index_stores_duplicate_values_in_rowid_order[function] — test source atlib/sql/src/index.zig:335in nearest public ownertiny.sql.indexlib.sql.src.test_secondary_index_stores_payloads_in_rowid_order[function] — test source atlib/sql/src/index.zig:386in nearest public ownertiny.sql.indexlib.sql.src.tree.test_allocated_roots_clear_recycled_page_images[function] — test source atlib/sql/src/tree.zig:3029in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_accepts_every_fitting_key_beside_short_separators[function] — test source atlib/sql/src/tree.zig:2468in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_clear_releases_durable_pages_without_loading_base_tree[function] — test source atlib/sql/src/tree.zig:3223in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_count_agrees_with_the_full_summary_across_generated_writes[function] — test source atlib/sql/src/tree.zig:3676in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_delete_compacts_recursive_branches_back_to_a_root_leaf[function] — test source atlib/sql/src/tree.zig:2914in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_delete_removes_a_key_from_durable_root_leaf[function] — test source atlib/sql/src/tree.zig:3440in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_delete_removes_empty_child_and_collapses_root_branch[function] — test source atlib/sql/src/tree.zig:2807in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_delete_retains_a_safe_lower_bound_when_exact_replacement_does_not_fit[function] — test source atlib/sql/src/tree.zig:2861in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_identity_accumulates_across_one_write_batch[function] — test source atlib/sql/src/tree.zig:3605in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_identity_follows_overflow_values_across_updates[function] — test source atlib/sql/src/tree.zig:3574in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_identity_requires_an_identity_page[function] — test source atlib/sql/src/tree.zig:3657in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_identity_survives_reopen[function] — test source atlib/sql/src/tree.zig:3628in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_identity_tracks_put_update_delete_and_clear[function] — test source atlib/sql/src/tree.zig:3536in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_range_after_lazy_reopen_does_not_retain_scanned_base_pages[function] — test source atlib/sql/src/tree.zig:2667in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_reader_keeps_a_fixed_read_view_without_write_declarations[function] — test source atlib/sql/src/tree.zig:2220in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_reads_mark_the_pages_they_validate[function] — test source atlib/sql/src/tree.zig:3835in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_recursive_branch_splits_recover_after_reopen[function] — test source atlib/sql/src/tree.zig:2762in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_recursively_splits_branch_pages[function] — test source atlib/sql/src/tree.zig:2499in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_rejects_a_reserved_root_with_a_byte_past_a_zero_header[function] — test source atlib/sql/src/tree.zig:2403in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_reports_missing_delete_and_invalid_root_page[function] — test source atlib/sql/src/tree.zig:3496in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_reuses_freed_pages_after_delete_compaction[function] — test source atlib/sql/src/tree.zig:2963in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_root_cache_serves_unchanged_views_and_recomputes_across_writes_and_checkpoints[function] — test source atlib/sql/src/tree.zig:2634in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_root_edges_link_every_node_to_its_direct_children[function] — test source atlib/sql/src/tree.zig:3094in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_root_exposes_subtree_hashes_for_unchanged_child_regions[function] — test source atlib/sql/src/tree.zig:2711in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_root_hash_is_stable_across_reopen_and_changes_after_write[function] — test source atlib/sql/src/tree.zig:2593in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_root_split_creates_a_branch_over_leaf_children[function] — test source atlib/sql/src/tree.zig:2288in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_scan_projection_controls_overflow_materialization[function] — test source atlib/sql/src/tree.zig:3354in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_scan_that_fails_in_place_releases_its_read_lease[function] — test source atlib/sql/src/tree.zig:3802in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_scan_validates_each_leaf_it_reads[function] — test source atlib/sql/src/tree.zig:3762in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_scans_and_lookups_agree_with_a_model_across_generated_trees[function] — test source atlib/sql/src/tree.zig:3727in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_spills_a_full_inline_free_list_into_a_chain_and_refills_it[function] — test source atlib/sql/src/tree.zig:3162in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_split_root_recovers_after_reopen[function] — test source atlib/sql/src/tree.zig:2330in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_splits_a_full_child_leaf_under_branch_root[function] — test source atlib/sql/src/tree.zig:2431in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_staged_summary_matches_committed_summary[function] — test source atlib/sql/src/tree.zig:2266in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_stores_large_values_in_overflow_pages_and_reuses_replaced_chains[function] — test source atlib/sql/src/tree.zig:3273in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_stores_ordered_keys_through_file_transactions[function] — test source atlib/sql/src/tree.zig:3409in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_synced_writes_recover_after_reopen[function] — test source atlib/sql/src/tree.zig:3461in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_treats_sparse_reserved_root_as_empty[function] — test source atlib/sql/src/tree.zig:2372in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_write_edits_the_pages_it_staged_in_place[function] — test source atlib/sql/src/tree.zig:3943in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_write_trusts_a_snapshot_page_only_after_validating_it[function] — test source atlib/sql/src/tree.zig:3913in nearest public ownertiny.sql.treelib.sql.src.tree.test_tree_write_validates_each_snapshot_leaf_it_reads[function] — test source atlib/sql/src/tree.zig:3885in nearest public ownertiny.sql.tree
Complete call list for FileDatabase.preparePublication
7 direct calls.
lib.sql.src.file.Database.ensureMutable[method] — private source atlib/sql/src/file.zig:2498in nearest public ownertiny.sql.indexlib.sql.src.file.Database.ensureUsable[method] — private source atlib/sql/src/file.zig:2494in nearest public ownertiny.sql.indexlib.sql.src.file.Database.ioFailure[method] — private source atlib/sql/src/file.zig:2502in nearest public ownertiny.sql.indextiny.sql.FileDatabase.syncWal[method] atlib/sql/src/file.zig:2335lib.sql.src.publication.Lane.init[function] — private source atlib/sql/src/publication.zig:71in nearest public ownerlib.sql.src.publicationlib.sql.src.publication.Lane.pair[method] — private source atlib/sql/src/publication.zig:95in nearest public ownerlib.sql.src.publicationlib.sql.src.publication.seal[function] — private source atlib/sql/src/publication.zig:202in nearest public ownerlib.sql.src.publication
Audit
| Definitions | 28 |
|---|---|
| Public names | 28 |
| Members | 30 |
| Version | 26.7.0 |
| Revision | daab053ee433 |