tiny.sql.version
Defined in tiny.sql.
API (47)
Actions
Public operations.
cloneRelationRowsdatabaseRootdatabaseRootMaintaineddatabaseRootReplacingEntriesdatabaseValuedatabaseValueFromOwnedRelationsdatabaseValueReplacingRelationsemptyHashfreeRelationRowsmapRootreadDatabaseRootMaintainedreadRelationRootMaintainedrelationKeyrelationRootrelationRootFromRowsrelationRootFromRowsWithStatsrelationRootMaintainedrelationRowLessThanrelationRowsrelationValuerelationValueApplyingMaterializedEditsrelationValueFromRootsameschemaHash
Types and contracts
Public types and contracts.
CommitConflictArtifactConflictEntryConflictKindConflictRootConflictValueDatabaseRootDatabaseValueErrorHashIndexRootMapRootRefRelationEntryRelationKeyRelationRootRelationRowRelationSchemaRelationValueStatsRootWorkingSet
Values and defaults
Public values and defaults.
Source
Source: lib/sql/src/root.zig:49
zig
pub const version = @import("version.zig");Source: lib/sql/src/version.zig
zig
const std = @import("std");const simd = @import("simd");const catalog_mod = @import("catalog.zig");const key = @import("key.zig");const page = @import("page.zig");const relation_mod = @import("relation.zig");const row = @import("row.zig");const tree = @import("tree.zig");const wal = @import("wal.zig");const Bytes = simd.ScalableTag(u8);const Allocator = std.mem.Allocator;pub const hash_bytes = 32;pub const format_version: u32 = 1;pub const Hash = [hash_bytes]u8;pub const Error = Allocator.Error || tree.Error || row.Error || key.Error || relation_mod.Error || catalog_mod.Error;pub const MapRoot = tree.Root;pub const IndexRoot = struct { fields: Hash, map: MapRoot, stats: Hash, hash: Hash, pub fn deinit(self: *IndexRoot) void { self.map.deinit(); self.* = undefined; } pub fn clone(self: *const IndexRoot, allocator: Allocator) Allocator.Error!IndexRoot { return .{ .fields = self.fields, .map = try self.map.clone(allocator), .stats = self.stats, .hash = self.hash, }; }};pub const StatsRoot = struct { table: ?tree.Summary = null, indexes: usize = 0, hash: Hash,};pub const RelationSchema = struct { allocator: Allocator, columns: []catalog_mod.ColumnDefinition, indexes: []catalog_mod.IndexDefinition, pub fn init(allocator: Allocator, columns: []const catalog_mod.ColumnDefinition, indexes: []const catalog_mod.IndexDefinition) Allocator.Error!RelationSchema { const owned_columns = try allocator.alloc(catalog_mod.ColumnDefinition, columns.len); var column_count: usize = 0; errdefer { for (owned_columns[0..column_count]) |*column| deinitColumn(allocator, column); allocator.free(owned_columns); } for (columns, owned_columns) |column, *target| { target.* = try cloneColumn(allocator, column); column_count += 1; } const owned_indexes = try allocator.alloc(catalog_mod.IndexDefinition, indexes.len); var index_count: usize = 0; errdefer { for (owned_indexes[0..index_count]) |*index| deinitIndex(allocator, index); allocator.free(owned_indexes); } for (indexes, owned_indexes) |index, *target| { target.* = try cloneIndex(allocator, index); index_count += 1; } return .{ .allocator = allocator, .columns = owned_columns, .indexes = owned_indexes, }; } pub fn deinit(self: *RelationSchema) void { for (self.columns) |*column| deinitColumn(self.allocator, column); for (self.indexes) |*index| deinitIndex(self.allocator, index); self.allocator.free(self.columns); self.allocator.free(self.indexes); self.* = undefined; } pub fn clone(self: *const RelationSchema, allocator: Allocator) Allocator.Error!RelationSchema { return try RelationSchema.init(allocator, self.columns, self.indexes); }};pub const RelationRoot = struct { allocator: Allocator, format: u32 = format_version, name: []u8, catalog: catalog_mod.Schema, schema: Hash, schema_descriptor: RelationSchema, table: MapRoot, indexes: []IndexRoot, stats: StatsRoot, hash: Hash, pub fn deinit(self: *RelationRoot) void { self.table.deinit(); for (self.indexes) |*index| index.deinit(); self.allocator.free(self.indexes); self.schema_descriptor.deinit(); self.allocator.free(self.name); self.* = undefined; } pub fn clone(self: *const RelationRoot, allocator: Allocator) Allocator.Error!RelationRoot { const name = try allocator.dupe(u8, self.name); errdefer allocator.free(name); var table = try self.table.clone(allocator); errdefer table.deinit(); const indexes = try allocator.alloc(IndexRoot, self.indexes.len); var index_count: usize = 0; errdefer { for (indexes[0..index_count]) |*index| index.deinit(); allocator.free(indexes); } for (self.indexes, indexes) |index, *target| { target.* = try index.clone(allocator); index_count += 1; } var schema_descriptor = try self.schema_descriptor.clone(allocator); errdefer schema_descriptor.deinit(); return .{ .allocator = allocator, .format = self.format, .name = name, .catalog = self.catalog, .schema = self.schema, .schema_descriptor = schema_descriptor, .table = table, .indexes = indexes, .stats = self.stats, .hash = self.hash, }; }};pub const RelationEntry = struct { name: []const u8, hash: Hash,};pub const RelationRow = struct { rowid: i64, bytes: []u8,};pub const RelationValue = struct { root: RelationRoot, rows: []RelationRow, pub fn deinit(self: *RelationValue, allocator: Allocator) void { self.root.deinit(); freeRelationRows(allocator, self.rows); self.* = undefined; } pub fn clone(self: *const RelationValue, allocator: Allocator) Allocator.Error!RelationValue { var root = try self.root.clone(allocator); errdefer root.deinit(); const rows = try cloneRelationRows(allocator, self.rows); return .{ .root = root, .rows = rows, }; }};pub const ConflictKind = enum(u8) { row, relation,};pub const ConflictValue = union(ConflictKind) { row: []const u8, relation: Hash,};pub const ConflictEntry = struct { kind: ConflictKind = .row, relation: []const u8, rowid: i64 = 0, hash: Hash, pub fn eql(left: ConflictEntry, right: ConflictEntry) bool { return left.kind == right.kind and std.mem.eql(u8, left.relation, right.relation) and (left.kind == .relation or left.rowid == right.rowid) and same(left.hash, right.hash); } pub fn sameSlot(left: ConflictEntry, right: ConflictEntry) bool { return left.kind == right.kind and std.mem.eql(u8, left.relation, right.relation) and (left.kind == .relation or left.rowid == right.rowid); } pub fn lessThan(_: void, left: ConflictEntry, right: ConflictEntry) bool { const relation_order = simd.order(Bytes, left.relation, right.relation); if (relation_order != .eq) return relation_order == .lt; if (left.kind != right.kind) return @backingInt(left.kind) < @backingInt(right.kind); if (left.kind == .row and left.rowid != right.rowid) return left.rowid < right.rowid; return simd.order(Bytes, left.hash[0..], right.hash[0..]) == .lt; }};pub const ConflictRoot = struct { hash: Hash, count: usize = 0, pub fn empty() ConflictRoot { return .{ .hash = emptyHash("sql.conflicts.empty"), }; } pub fn init(entries: []const ConflictEntry) ConflictRoot { var builder = Builder.init("sql.conflicts"); builder.writeU64(entries.len); for (entries) |entry| { builder.writeU8(@backingInt(entry.kind)); builder.bytes(entry.relation); if (entry.kind == .row) builder.writeI64(entry.rowid); builder.hash(entry.hash); } return .{ .hash = builder.finish(), .count = entries.len, }; } pub fn initSorted(allocator: Allocator, entries: []const ConflictEntry) Allocator.Error!ConflictRoot { const sorted = try allocator.dupe(ConflictEntry, entries); defer allocator.free(sorted); std.mem.sort(ConflictEntry, sorted, {}, ConflictEntry.lessThan); return init(sorted); }};pub const ConflictArtifact = struct { kind: ConflictKind = .row, relation: []const u8, rowid: i64 = 0, base: ?ConflictValue = null, ours: ?ConflictValue = null, theirs: ?ConflictValue = null, hash: Hash, pub fn init(relation: []const u8, rowid: i64, base: ?[]const u8, ours: ?[]const u8, theirs: ?[]const u8) ConflictArtifact { return initRow(relation, rowid, base, ours, theirs); } pub fn initRow(relation: []const u8, rowid: i64, base: ?[]const u8, ours: ?[]const u8, theirs: ?[]const u8) ConflictArtifact { var builder = Builder.init("sql.conflict"); builder.writeU8(@backingInt(ConflictKind.row)); builder.bytes(relation); builder.writeI64(rowid); builder.optionalConflictValue(.row, if (base) |value| ConflictValue{ .row = value } else null); builder.optionalConflictValue(.row, if (ours) |value| ConflictValue{ .row = value } else null); builder.optionalConflictValue(.row, if (theirs) |value| ConflictValue{ .row = value } else null); return .{ .kind = .row, .relation = relation, .rowid = rowid, .base = if (base) |value| .{ .row = value } else null, .ours = if (ours) |value| .{ .row = value } else null, .theirs = if (theirs) |value| .{ .row = value } else null, .hash = builder.finish(), }; } pub fn initRelation(relation: []const u8, base: ?Hash, ours: ?Hash, theirs: ?Hash) ConflictArtifact { var builder = Builder.init("sql.conflict"); builder.writeU8(@backingInt(ConflictKind.relation)); builder.bytes(relation); builder.optionalConflictValue(.relation, if (base) |value| ConflictValue{ .relation = value } else null); builder.optionalConflictValue(.relation, if (ours) |value| ConflictValue{ .relation = value } else null); builder.optionalConflictValue(.relation, if (theirs) |value| ConflictValue{ .relation = value } else null); return .{ .kind = .relation, .relation = relation, .base = if (base) |value| .{ .relation = value } else null, .ours = if (ours) |value| .{ .relation = value } else null, .theirs = if (theirs) |value| .{ .relation = value } else null, .hash = builder.finish(), }; } pub fn entry(self: ConflictArtifact) ConflictEntry { return .{ .kind = self.kind, .relation = self.relation, .rowid = self.rowid, .hash = self.hash, }; }};pub const DatabaseRoot = struct { allocator: ?Allocator = null, format: u32 = format_version, feature: u32 = 0, entries: []const RelationEntry = &.{}, conflicts: Hash, hash: Hash, pub fn init(entries: []const RelationEntry, conflicts: ConflictRoot) DatabaseRoot { var builder = Builder.init("sql.database"); builder.writeU32(format_version); builder.writeU32(0); builder.hash(conflicts.hash); builder.writeU64(entries.len); for (entries) |entry| { builder.bytes(entry.name); builder.hash(entry.hash); } return .{ .entries = entries, .conflicts = conflicts.hash, .hash = builder.finish(), }; } pub fn initSorted(allocator: Allocator, entries: []const RelationEntry, conflicts: ConflictRoot) Allocator.Error!DatabaseRoot { const sorted = try allocator.alloc(RelationEntry, entries.len); var copied: usize = 0; errdefer { for (sorted[0..copied]) |entry| allocator.free(entry.name); allocator.free(sorted); } for (entries, sorted) |entry, *target| { target.* = .{ .name = try allocator.dupe(u8, entry.name), .hash = entry.hash, }; copied += 1; } std.mem.sort(RelationEntry, sorted, {}, relationEntryLessThan); var root = init(sorted, conflicts); root.allocator = allocator; return root; } pub fn clone(self: *const DatabaseRoot, allocator: Allocator) Allocator.Error!DatabaseRoot { return try self.withConflicts(allocator, self.conflicts); } pub fn withConflicts( self: *const DatabaseRoot, allocator: Allocator, conflicts: Hash, ) Allocator.Error!DatabaseRoot { return try initSorted(allocator, self.entries, .{ .hash = conflicts }); } pub fn deinit(self: *DatabaseRoot) void { if (self.allocator) |allocator| { for (self.entries) |entry| allocator.free(entry.name); allocator.free(self.entries); } self.* = undefined; }};pub const DatabaseValue = struct { allocator: Allocator, root: DatabaseRoot, relations: []RelationValue, pub fn deinit(self: *DatabaseValue) void { self.root.deinit(); for (self.relations) |*relation| relation.deinit(self.allocator); if (self.relations.len != 0) self.allocator.free(self.relations); self.* = undefined; } pub fn intoRoot(self: *DatabaseValue) DatabaseRoot { const root = self.root; for (self.relations) |*relation| relation.deinit(self.allocator); if (self.relations.len != 0) self.allocator.free(self.relations); self.* = undefined; return root; } pub fn clone(self: *const DatabaseValue, allocator: Allocator) Allocator.Error!DatabaseValue { var root = try self.root.clone(allocator); errdefer root.deinit(); const relations = try allocator.alloc(RelationValue, self.relations.len); var relation_count: usize = 0; errdefer { for (relations[0..relation_count]) |*relation| relation.deinit(allocator); if (relations.len != 0) allocator.free(relations); } for (self.relations, relations) |relation, *target| { target.* = try relation.clone(allocator); relation_count += 1; } return .{ .allocator = allocator, .root = root, .relations = relations, }; } pub fn findRelation(self: *const DatabaseValue, name: []const u8) ?*const RelationValue { for (self.relations) |*relation_value| { if (std.mem.eql(u8, relation_value.root.name, name)) return relation_value; } return null; }};pub const Commit = struct { root: Hash, parents: []const Hash = &.{}, hash: Hash, pub fn init(root: Hash, parents: []const Hash) Commit { var builder = Builder.init("sql.commit"); builder.hash(root); builder.writeU64(parents.len); for (parents) |parent| builder.hash(parent); return .{ .root = root, .parents = parents, .hash = builder.finish(), }; }};pub const Ref = struct { name: []const u8, target: Hash,};pub const WorkingSet = struct { base: Hash, working: Hash, staged: Hash, pub fn init(base: Hash) WorkingSet { return .{ .base = base, .working = base, .staged = base, }; } pub fn withWorking(self: WorkingSet, working: Hash) WorkingSet { return .{ .base = self.base, .working = working, .staged = self.staged, }; } pub fn stage(self: WorkingSet) WorkingSet { return .{ .base = self.base, .working = self.working, .staged = self.working, }; } pub fn advance(self: WorkingSet, base: Hash) WorkingSet { _ = self; return WorkingSet.init(base); } pub fn dirty(self: WorkingSet) bool { return !same(self.base, self.working); } pub fn hasStaged(self: WorkingSet) bool { return !same(self.base, self.staged); }};pub fn emptyHash(kind: []const u8) Hash { var builder = Builder.init(kind); return builder.finish();}pub fn same(left: Hash, right: Hash) bool { return std.mem.eql(u8, left[0..], right[0..]);}pub fn relationRoot(allocator: Allocator, name: []const u8, catalog_schema: catalog_mod.Schema, handle: *const catalog_mod.RelationHandle, stats: ?*const catalog_mod.RelationStats) Error!RelationRoot { const owned_name = try allocator.dupe(u8, name); errdefer allocator.free(owned_name); var table_root = try mapRoot(allocator, &handle.relation.table.rows); errdefer table_root.deinit(); var schema_descriptor = try RelationSchema.init(allocator, handle.definitions, handle.index_definitions); errdefer schema_descriptor.deinit(); const schema_hash = schemaHash(schema_descriptor.columns, schema_descriptor.indexes); const stats_root = relationStatsRoot(stats); const indexes = try allocator.alloc(IndexRoot, handle.specs.len); var index_count: usize = 0; errdefer { for (indexes[0..index_count]) |*index| index.deinit(); allocator.free(indexes); } for (handle.specs, indexes) |spec, *target| { var index_tree = try handle.relation.space.tree(spec.root_page); var map = try mapRoot(allocator, &index_tree); var map_assigned = false; errdefer if (!map_assigned) map.deinit(); const index_stats = findIndexStats(stats, spec.root_page); const index_stats_hash = indexStatsHash(index_stats); target.* = .{ .fields = fieldsHash(spec.fields, spec.columns), .map = map, .stats = index_stats_hash, .hash = indexHash(spec.fields, spec.columns, map.hash, index_stats_hash), }; map_assigned = true; index_count += 1; } var builder = Builder.init("sql.relation"); builder.writeU32(format_version); builder.bytes(name); builder.hash(schema_hash); builder.hash(table_root.hash); builder.hash(stats_root.hash); builder.writeU64(indexes.len); for (indexes) |index| builder.hash(index.hash); return .{ .allocator = allocator, .name = owned_name, .catalog = .{ .format = catalog_schema.format, .version = catalog_schema.version, }, .schema = schema_hash, .schema_descriptor = schema_descriptor, .table = table_root, .indexes = indexes, .stats = stats_root, .hash = builder.finish(), };}pub fn relationRootMaintained( allocator: Allocator, name: []const u8, catalog_schema: catalog_mod.Schema, handle: *const catalog_mod.RelationHandle, stats: ?*const catalog_mod.RelationStats,) Error!RelationRoot { return try relationRootMaintainedFrom(allocator, name, catalog_schema, handle, stats);}pub fn readRelationRootMaintained( allocator: Allocator, name: []const u8, catalog_schema: catalog_mod.Schema, handle: *const catalog_mod.ReadRelationHandle, stats: ?*const catalog_mod.RelationStats,) Error!RelationRoot { return try relationRootMaintainedFrom(allocator, name, catalog_schema, handle, stats);}fn relationRootMaintainedFrom( allocator: Allocator, name: []const u8, catalog_schema: catalog_mod.Schema, handle: anytype, stats: ?*const catalog_mod.RelationStats,) Error!RelationRoot { const owned_name = try allocator.dupe(u8, name); errdefer allocator.free(owned_name); var table_root = try mapRootFromIdentity(allocator, &handle.relation.table.rows); errdefer table_root.deinit(); var schema_descriptor = try RelationSchema.init(allocator, handle.definitions, handle.index_definitions); errdefer schema_descriptor.deinit(); const schema_hash = schemaHash(schema_descriptor.columns, schema_descriptor.indexes); const stats_root = relationStatsRoot(stats); const indexes = try allocator.alloc(IndexRoot, handle.specs.len); var index_count: usize = 0; errdefer { for (indexes[0..index_count]) |*index| index.deinit(); allocator.free(indexes); } for (handle.specs, indexes) |spec, *target| { var index_tree = try handle.relation.space.tree(spec.root_page); var map = try mapRootFromIdentity(allocator, &index_tree); var map_assigned = false; errdefer if (!map_assigned) map.deinit(); const index_stats = findIndexStats(stats, spec.root_page); const index_stats_hash = indexStatsHash(index_stats); target.* = .{ .fields = fieldsHash(spec.fields, spec.columns), .map = map, .stats = index_stats_hash, .hash = indexHash(spec.fields, spec.columns, map.hash, index_stats_hash), }; map_assigned = true; index_count += 1; } var builder = Builder.init("sql.relation"); builder.writeU32(format_version); builder.bytes(name); builder.hash(schema_hash); builder.hash(table_root.hash); builder.hash(stats_root.hash); builder.writeU64(indexes.len); for (indexes) |index| builder.hash(index.hash); return .{ .allocator = allocator, .name = owned_name, .catalog = .{ .format = catalog_schema.format, .version = catalog_schema.version, }, .schema = schema_hash, .schema_descriptor = schema_descriptor, .table = table_root, .indexes = indexes, .stats = stats_root, .hash = builder.finish(), };}pub const RelationKey = struct { schema: Hash, table: Hash, stats: Hash, hash: Hash,};pub fn relationKey( name: []const u8, handle: *const catalog_mod.RelationHandle, stats: ?*const catalog_mod.RelationStats,) Error!RelationKey { const schema_hash = schemaHash(handle.definitions, handle.index_definitions); const table_identity = try handle.relation.table.rows.identity(); const table_hash = handle.relation.table.rows.digestIdentity(&table_identity); const stats_hash = relationStatsRoot(stats).hash; var builder = Builder.init("sql.relation"); builder.writeU32(format_version); builder.bytes(name); builder.hash(schema_hash); builder.hash(table_hash); builder.hash(stats_hash); builder.writeU64(handle.specs.len); for (handle.specs) |spec| { var index_tree = try handle.relation.space.tree(spec.root_page); const index_identity = try index_tree.identity(); const map_hash = index_tree.digestIdentity(&index_identity); const index_stats_hash = indexStatsHash(findIndexStats(stats, spec.root_page)); builder.hash(indexHash(spec.fields, spec.columns, map_hash, index_stats_hash)); } return .{ .schema = schema_hash, .table = table_hash, .stats = stats_hash, .hash = builder.finish(), };}fn mapRootFromIdentity(allocator: Allocator, stored: anytype) Error!MapRoot { const identity = try stored.identity(); const nodes = try allocator.alloc(tree.Node, 0); errdefer allocator.free(nodes); const edges = try allocator.alloc(usize, 0); errdefer allocator.free(edges); return .{ .allocator = allocator, .summary = .{ .entries = @intCast(identity.entries), .key_bytes = @intCast(identity.key_bytes), .record_bytes = @intCast(identity.value_bytes), .value_bytes = @intCast(identity.value_bytes), }, .hash = stored.digestIdentity(&identity), .subtree = std.mem.zeroes(Hash), .nodes = nodes, .edges = edges, };}pub fn relationRows(allocator: Allocator, handle: *const catalog_mod.RelationHandle) Error![]RelationRow { var rows: std.ArrayList(RelationRow) = .empty; errdefer { for (rows.items) |row_value| allocator.free(row_value.bytes); rows.deinit(allocator); } var scan: relation_mod.Scan = undefined; try handle.relation.scan(&scan, allocator, null, null); defer scan.deinit(); while (try scan.next()) |entry| { const bytes = try allocator.dupe(u8, entry.bytes); errdefer allocator.free(bytes); try rows.append(allocator, .{ .rowid = entry.rowid, .bytes = bytes, }); } return try rows.toOwnedSlice(allocator);}pub fn cloneRelationRows(allocator: Allocator, rows: []const RelationRow) Allocator.Error![]RelationRow { const cloned = try allocator.alloc(RelationRow, rows.len); var count: usize = 0; errdefer { for (cloned[0..count]) |row_value| allocator.free(row_value.bytes); allocator.free(cloned); } for (rows, cloned) |row_value, *target| { target.* = .{ .rowid = row_value.rowid, .bytes = try allocator.dupe(u8, row_value.bytes), }; count += 1; } std.mem.sort(RelationRow, cloned, {}, relationRowLessThan); return cloned;}pub fn freeRelationRows(allocator: Allocator, rows: []RelationRow) void { for (rows) |row_value| allocator.free(row_value.bytes); if (rows.len != 0) allocator.free(rows);}pub fn relationValue(allocator: Allocator, name: []const u8, catalog_schema: catalog_mod.Schema, handle: *const catalog_mod.RelationHandle, stats: ?*const catalog_mod.RelationStats) Error!RelationValue { var root = try relationRootMaintained(allocator, name, catalog_schema, handle, stats); defer root.deinit(); return try relationValueFromRoot(allocator, &root, handle);}pub fn relationValueFromRoot(allocator: Allocator, root: *const RelationRoot, handle: *const catalog_mod.RelationHandle) Error!RelationValue { var owned_root = try root.clone(allocator); errdefer owned_root.deinit(); const rows = try relationRows(allocator, handle); errdefer freeRelationRows(allocator, rows); return .{ .root = owned_root, .rows = rows, };}pub fn relationRootFromRows(allocator: Allocator, source: *const RelationRoot, rows: []const RelationRow) Error!RelationRoot { return try relationRootFromRowsWithOptionalStats(allocator, source, rows, null);}pub fn relationRootFromRowsWithStats( allocator: Allocator, source: *const RelationRoot, rows: []const RelationRow, stats: *const catalog_mod.RelationStats,) Error!RelationRoot { return try relationRootFromRowsWithOptionalStats(allocator, source, rows, stats);}fn relationRootFromRowsWithOptionalStats( allocator: Allocator, source: *const RelationRoot, rows: []const RelationRow, stats: ?*const catalog_mod.RelationStats,) Error!RelationRoot { const owned_name = try allocator.dupe(u8, source.name); errdefer allocator.free(owned_name); var table_root = try tableRootFromRows(allocator, rows); errdefer table_root.deinit(); var schema_descriptor = try source.schema_descriptor.clone(allocator); errdefer schema_descriptor.deinit(); const schema_hash = schemaHash(schema_descriptor.columns, schema_descriptor.indexes); if (stats) |relation_stats| { if (relation_stats.indexes.len != schema_descriptor.indexes.len) { return error.CatalogCorrupt; } if (!logicalSummaryEqual(table_root.summary, relation_stats.table)) { return error.CatalogCorrupt; } } const stats_root = relationStatsRoot(stats); const indexes = try relationIndexesFromRows( allocator, rows, schema_descriptor.indexes, stats, ); errdefer freeIndexRoots(allocator, indexes); var builder = Builder.init("sql.relation"); builder.writeU32(format_version); builder.bytes(source.name); builder.hash(schema_hash); builder.hash(table_root.hash); builder.hash(stats_root.hash); builder.writeU64(indexes.len); for (indexes) |index| builder.hash(index.hash); return .{ .allocator = allocator, .name = owned_name, .catalog = source.catalog, .schema = schema_hash, .schema_descriptor = schema_descriptor, .table = table_root, .indexes = indexes, .stats = stats_root, .hash = builder.finish(), };}fn relationIndexesFromRows( allocator: Allocator, rows: []const RelationRow, definitions: []const catalog_mod.IndexDefinition, stats: ?*const catalog_mod.RelationStats,) Error![]IndexRoot { const indexes = try allocator.alloc(IndexRoot, definitions.len); var index_count: usize = 0; errdefer { for (indexes[0..index_count]) |*index| index.deinit(); allocator.free(indexes); } for (definitions, indexes, 0..) |definition, *target, index_offset| { var map = try indexRootFromRows( allocator, rows, definition.fields, definition.columns, ); var map_assigned = false; errdefer if (!map_assigned) map.deinit(); const index_stats = if (stats) |relation_stats| &relation_stats.indexes[index_offset] else null; if (index_stats) |prepared| { if (!std.mem.eql(u8, prepared.name, definition.name)) { return error.CatalogCorrupt; } if (!logicalSummaryEqual(map.summary, prepared.summary)) { return error.CatalogCorrupt; } } const stats_hash = indexStatsHash(index_stats); target.* = .{ .fields = fieldsHash(definition.fields, definition.columns), .map = map, .stats = stats_hash, .hash = indexHash( definition.fields, definition.columns, map.hash, stats_hash, ), }; map_assigned = true; index_count += 1; } return indexes;}fn freeIndexRoots(allocator: Allocator, indexes: []IndexRoot) void { for (indexes) |*index| index.deinit(); allocator.free(indexes);}pub fn relationValueApplyingMaterializedEdits(allocator: Allocator, base: *const RelationValue, edits: []const relation_mod.Edit) Error!RelationValue { const rows = try relationRowsApplyingEdits(allocator, base.rows, edits); errdefer freeRelationRows(allocator, rows); var root = try relationRootFromRows(allocator, &base.root, rows); errdefer root.deinit(); return .{ .root = root, .rows = rows, };}pub fn databaseValue( allocator: Allocator, catalog: *const catalog_mod.Catalog, conflicts: Hash,) Error!DatabaseValue { return try databaseValueReplacingRelations(allocator, catalog, &.{}, conflicts);}pub fn databaseValueReplacingRelations( allocator: Allocator, catalog: *const catalog_mod.Catalog, replacements: []const RelationValue, conflicts: Hash,) Error!DatabaseValue { var names = try catalog.relationNames(allocator); defer names.deinit(); const relations = try allocator.alloc(RelationValue, names.names.len); var relation_count: usize = 0; var relations_owned = true; errdefer { if (relations_owned) { for (relations[0..relation_count]) |*relation| relation.deinit(allocator); if (relations.len != 0) allocator.free(relations); } } for (names.names, relations) |name, *relation| { if (replacementRelation(replacements, name)) |replacement| { relation.* = try replacement.clone(allocator); } else { var state = try catalog.readRelation(allocator, name); defer state.deinit(); relation.* = try relationValue( allocator, name, state.schema, &state.handle, state.relationStats(), ); } relation_count += 1; } const value = try databaseValueFromOwnedRelations(allocator, relations, conflicts); relations_owned = false; return value;}pub fn databaseValueFromOwnedRelations(allocator: Allocator, relations: []RelationValue, conflicts: Hash) Allocator.Error!DatabaseValue { const entries = try allocator.alloc(RelationEntry, relations.len); defer allocator.free(entries); for (relations, entries) |relation, *entry| { entry.* = .{ .name = relation.root.name, .hash = relation.root.hash, }; } var root = try DatabaseRoot.initSorted(allocator, entries, .{ .hash = conflicts }); errdefer root.deinit(); return .{ .allocator = allocator, .root = root, .relations = relations, };}fn replacementRelation(replacements: []const RelationValue, name: []const u8) ?*const RelationValue { for (replacements) |*replacement| { if (std.mem.eql(u8, replacement.root.name, name)) return replacement; } return null;}pub fn databaseRoot( allocator: Allocator, catalog: *const catalog_mod.Catalog, conflicts: Hash,) Error!DatabaseRoot { var names = try catalog.relationNames(allocator); defer names.deinit(); const entries = try allocator.alloc(RelationEntry, names.names.len); defer allocator.free(entries); for (names.names, entries) |name, *entry| { var state = try catalog.readRelation(allocator, name); defer state.deinit(); var root = try relationRoot( allocator, name, state.schema, &state.handle, state.relationStats(), ); defer root.deinit(); entry.* = .{ .name = name, .hash = root.hash, }; } return try DatabaseRoot.initSorted(allocator, entries, .{ .hash = conflicts });}pub fn databaseRootMaintained( allocator: Allocator, catalog: *const catalog_mod.Catalog, conflicts: Hash,) Error!DatabaseRoot { return try databaseRootMaintainedFrom(allocator, catalog, conflicts);}pub fn readDatabaseRootMaintained( allocator: Allocator, catalog: *const catalog_mod.Reader, conflicts: Hash,) Error!DatabaseRoot { return try databaseRootMaintainedFrom(allocator, catalog, conflicts);}fn databaseRootMaintainedFrom( allocator: Allocator, catalog: anytype, conflicts: Hash,) Error!DatabaseRoot { var names = try catalog.relationNames(allocator); defer names.deinit(); const entries = try allocator.alloc(RelationEntry, names.names.len); defer allocator.free(entries); for (names.names, entries) |name, *entry| { var state = try catalog.readRelation(allocator, name); defer state.deinit(); var root = try relationRootMaintainedFrom( allocator, name, state.schema, &state.handle, state.relationStats(), ); defer root.deinit(); entry.* = .{ .name = name, .hash = root.hash, }; } return try DatabaseRoot.initSorted(allocator, entries, .{ .hash = conflicts });}pub fn databaseRootReplacingEntries(allocator: Allocator, base: *const DatabaseRoot, replacements: []const RelationEntry) Allocator.Error!DatabaseRoot { const entries = try allocator.alloc(RelationEntry, base.entries.len); defer allocator.free(entries); for (base.entries, entries) |entry, *target| { target.* = entry; for (replacements) |replacement| { if (std.mem.eql(u8, replacement.name, entry.name)) { target.hash = replacement.hash; break; } } } return try DatabaseRoot.initSorted(allocator, entries, .{ .hash = base.conflicts });}pub fn mapRoot(allocator: Allocator, source: *const tree.Tree) Error!MapRoot { return try source.root(allocator);}fn tableRootFromRows(allocator: Allocator, rows: []const RelationRow) Error!MapRoot { const keys = try allocator.alloc([key.rowid_size]u8, rows.len); defer allocator.free(keys); const entries = try allocator.alloc(tree.RootEntry, rows.len); defer allocator.free(entries); for (rows, entries, 0..) |row_value, *entry, offset| { _ = try row.View.init(row_value.bytes); entry.* = .{ .key = try key.encodeRowId(keys[offset][0..], row_value.rowid), .value = row_value.bytes, }; } std.mem.sort(tree.RootEntry, entries, {}, rootEntryLessThan); return try tree.rootFromSortedEntries(allocator, entries);}fn indexRootFromRows(allocator: Allocator, rows: []const RelationRow, fields: []const usize, columns: []const row.Column) Error!MapRoot { if (fields.len > relation_mod.max_index_fields) return error.TooManyIndexFields; var key_bytes: usize = 0; for (rows) |row_value| { const view = try row.View.init(row_value.bytes); var projected: [relation_mod.max_index_fields]row.Value = undefined; const values = try view.project(fields, projected[0..]); var buffer: [page.size]u8 = undefined; const encoded = try key.encodeIndex(&buffer, values, columns, row_value.rowid); key_bytes = std.math.add(usize, key_bytes, encoded.len) catch return error.OutputTooSmall; } const keys = if (key_bytes == 0) @as([]u8, &.{}) else try allocator.alloc(u8, key_bytes); defer if (keys.len != 0) allocator.free(keys); const entries = try allocator.alloc(tree.RootEntry, rows.len); defer allocator.free(entries); var cursor: usize = 0; for (rows, entries) |row_value, *entry| { const view = try row.View.init(row_value.bytes); var projected: [relation_mod.max_index_fields]row.Value = undefined; const values = try view.project(fields, projected[0..]); const encoded = try key.encodeIndex( keys[cursor..], values, columns, row_value.rowid, ); entry.* = .{ .key = encoded, .value = "", }; cursor += encoded.len; } std.debug.assert(cursor == keys.len); std.mem.sort(tree.RootEntry, entries, {}, rootEntryLessThan); return try tree.rootFromSortedEntries(allocator, entries);}pub fn schemaHash(definitions: []const catalog_mod.ColumnDefinition, indexes: []const catalog_mod.IndexDefinition) Hash { var builder = Builder.init("sql.schema"); builder.writeU64(definitions.len); for (definitions) |definition| { builder.bytes(definition.name); builder.writeU8(@backingInt(definition.column.collation)); builder.rowValue(definition.default); } builder.writeU64(indexes.len); for (indexes) |index| { builder.bytes(index.name); builder.writeU64(index.fields.len); for (index.fields) |field| builder.writeU64(field); builder.writeU64(index.columns.len); for (index.columns) |column| builder.writeU8(@backingInt(column.collation)); } return builder.finish();}fn cloneColumn(allocator: Allocator, column: catalog_mod.ColumnDefinition) Allocator.Error!catalog_mod.ColumnDefinition { const name = try allocator.dupe(u8, column.name); errdefer allocator.free(name); const default = try cloneValue(allocator, column.default); errdefer deinitValue(allocator, default); return .{ .name = name, .column = column.column, .default = default, };}fn deinitColumn(allocator: Allocator, column: *catalog_mod.ColumnDefinition) void { allocator.free(column.name); deinitValue(allocator, column.default); column.* = undefined;}fn cloneIndex(allocator: Allocator, index: catalog_mod.IndexDefinition) Allocator.Error!catalog_mod.IndexDefinition { const name = try allocator.dupe(u8, index.name); errdefer allocator.free(name); const fields = try allocator.dupe(usize, index.fields); errdefer allocator.free(fields); const columns = try allocator.dupe(row.Column, index.columns); errdefer allocator.free(columns); return .{ .name = name, .fields = fields, .columns = columns, };}fn deinitIndex(allocator: Allocator, index: *catalog_mod.IndexDefinition) void { allocator.free(index.name); allocator.free(index.fields); allocator.free(index.columns); index.* = undefined;}fn cloneValue(allocator: Allocator, value: row.Value) Allocator.Error!row.Value { return switch (value) { .nil => .nil, .integer => |integer| .{ .integer = integer }, .text => |text| .{ .text = try allocator.dupe(u8, text) }, .blob => |blob| .{ .blob = try allocator.dupe(u8, blob) }, };}fn deinitValue(allocator: Allocator, value: row.Value) void { switch (value) { .nil, .integer => {}, .text => |text| allocator.free(text), .blob => |blob| allocator.free(blob), }}fn indexHash(fields: []const usize, columns: []const row.Column, map_hash: Hash, stats_hash: Hash) Hash { var builder = Builder.init("sql.index"); builder.hash(fieldsHash(fields, columns)); builder.hash(map_hash); builder.hash(stats_hash); return builder.finish();}fn fieldsHash(fields: []const usize, columns: []const row.Column) Hash { var builder = Builder.init("sql.index.fields"); builder.writeU64(fields.len); for (fields) |field| builder.writeU64(field); builder.writeU64(columns.len); for (columns) |column| builder.writeU8(@backingInt(column.collation)); return builder.finish();}fn relationStatsRoot(stats: ?*const catalog_mod.RelationStats) StatsRoot { const relation_stats = stats orelse return .{ .hash = emptyHash("sql.stats.none"), }; var builder = Builder.init("sql.stats.relation"); builder.logicalSummary(relation_stats.table); builder.writeU64(relation_stats.indexes.len); for (relation_stats.indexes) |index| builder.hash(indexStatsHash(&index)); return .{ .table = relation_stats.table, .indexes = relation_stats.indexes.len, .hash = builder.finish(), };}fn logicalSummaryEqual(left: tree.Summary, right: tree.Summary) bool { return left.entries == right.entries and left.key_bytes == right.key_bytes and left.value_bytes == right.value_bytes;}fn findIndexStats(stats: ?*const catalog_mod.RelationStats, root_page: u32) ?*const catalog_mod.IndexStats { const relation_stats = stats orelse return null; for (relation_stats.indexes) |*index_stats| { if (index_stats.root_page == root_page) return index_stats; } return null;}fn indexStatsHash(stats: ?*const catalog_mod.IndexStats) Hash { const index_stats = stats orelse return emptyHash("sql.stats.index.none"); var builder = Builder.init("sql.stats.index"); builder.bytes(index_stats.name); builder.logicalSummary(index_stats.summary); builder.distribution(index_stats.distribution); return builder.finish();}fn relationEntryLessThan(_: void, left: RelationEntry, right: RelationEntry) bool { return simd.order(Bytes, left.name, right.name) == .lt;}fn rootEntryLessThan(_: void, left: tree.RootEntry, right: tree.RootEntry) bool { return simd.order(Bytes, left.key, right.key) == .lt;}pub fn relationRowLessThan(_: void, left: RelationRow, right: RelationRow) bool { return left.rowid < right.rowid;}fn relationRowsApplyingEdits(allocator: Allocator, source: []const RelationRow, edits: []const relation_mod.Edit) Error![]RelationRow { var rows: std.ArrayList(RelationRow) = .empty; errdefer { for (rows.items) |row_value| allocator.free(row_value.bytes); rows.deinit(allocator); } for (source) |row_value| { const bytes = try allocator.dupe(u8, row_value.bytes); errdefer allocator.free(bytes); try rows.append(allocator, .{ .rowid = row_value.rowid, .bytes = bytes, }); } for (edits) |edit| try applyRelationRowEdit(allocator, &rows, edit); return try rows.toOwnedSlice(allocator);}fn applyRelationRowEdit(allocator: Allocator, rows: *std.ArrayList(RelationRow), edit: relation_mod.Edit) Error!void { switch (edit) { .put => |put_edit| { _ = try row.View.init(put_edit.bytes); const bytes = try allocator.dupe(u8, put_edit.bytes); errdefer allocator.free(bytes); const target = relationRowPosition(rows.items, put_edit.rowid); if (target.found) { allocator.free(rows.items[target.index].bytes); rows.items[target.index].bytes = bytes; } else { try rows.insert(allocator, target.index, .{ .rowid = put_edit.rowid, .bytes = bytes, }); } }, .update => |update_edit| { const target = relationRowPosition(rows.items, update_edit.rowid); if (!target.found) return error.KeyNotFound; const merged = try relation_mod.applyUpdate(allocator, rows.items[target.index].bytes, update_edit.assignments); allocator.free(rows.items[target.index].bytes); rows.items[target.index].bytes = merged; }, .delete => |rowid| { const target = relationRowPosition(rows.items, rowid); if (!target.found) return error.KeyNotFound; const removed = rows.orderedRemove(target.index); allocator.free(removed.bytes); }, }}const RelationRowPosition = struct { index: usize, found: bool,};fn relationRowPosition(rows: []const RelationRow, rowid: i64) RelationRowPosition { var low: usize = 0; var high: usize = rows.len; while (low < high) { const mid = low + (high - low) / 2; if (rows[mid].rowid < rowid) { low = mid + 1; } else { high = mid; } } return .{ .index = low, .found = low < rows.len and rows[low].rowid == rowid, };}const Builder = struct { hasher: std.crypto.hash.sha2.Sha256, fn init(tag: []const u8) Builder { var builder = Builder{ .hasher = std.crypto.hash.sha2.Sha256.init(.{}) }; builder.bytes(tag); return builder; } fn finish(self: *Builder) Hash { var digest: Hash = undefined; self.hasher.final(&digest); return digest; } fn hash(self: *Builder, value: Hash) void { self.hasher.update(value[0..]); } fn bytes(self: *Builder, value: []const u8) void { self.writeU64(value.len); self.hasher.update(value); } fn optionalBytes(self: *Builder, value: ?[]const u8) void { if (value) |bytes_value| { self.writeU8(1); self.bytes(bytes_value); } else { self.writeU8(0); } } fn optionalConflictValue(self: *Builder, kind: ConflictKind, value: ?ConflictValue) void { if (value) |conflict_value| { self.writeU8(1); switch (conflict_value) { .row => |bytes_value| { std.debug.assert(kind == .row); self.bytes(bytes_value); }, .relation => |hash_value| { std.debug.assert(kind == .relation); self.hash(hash_value); }, } } else { self.writeU8(0); } } fn rowValue(self: *Builder, row_value: row.Value) void { self.writeU8(@backingInt(std.meta.activeTag(row_value))); switch (row_value) { .nil => {}, .integer => |integer| self.writeI64(integer), .text => |text| self.bytes(text), .blob => |blob| self.bytes(blob), } } fn distribution(self: *Builder, value: catalog_mod.IndexDistribution) void { self.writeU64(value.distinct_values); self.writeU64(value.max_equal); self.writeU64(value.samples.len); for (value.samples) |entry_sample| self.sample(entry_sample); self.bytes(value.sample_keys); self.writeU64(value.prefixes.len); for (value.prefixes) |prefix| { self.writeU64(prefix.field_count); self.writeU64(prefix.distinct_values); self.writeU64(prefix.max_equal); self.writeU64(prefix.samples.len); for (prefix.samples) |entry_sample| self.sample(entry_sample); self.bytes(prefix.sample_keys); } } fn sample(self: *Builder, value: catalog_mod.IndexSample) void { self.bytes(value.key); self.writeU64(value.less_than); self.writeU64(value.equal_count); self.writeU64(value.less_distinct); } fn logicalSummary(self: *Builder, value: tree.Summary) void { self.writeU64(value.entries); self.writeU64(value.key_bytes); self.writeU64(value.value_bytes); } fn writeU8(self: *Builder, value: u8) void { self.hasher.update(&.{value}); } fn writeU32(self: *Builder, value: u32) void { var encoded: [4]u8 = undefined; std.mem.writeInt(u32, encoded[0..], value, .big); self.hasher.update(&encoded); } fn writeU64(self: *Builder, value: anytype) void { var encoded: [8]u8 = undefined; std.mem.writeInt(u64, encoded[0..], @intCast(value), .big); self.hasher.update(&encoded); } fn writeI64(self: *Builder, value: i64) void { var encoded: [8]u8 = undefined; std.mem.writeInt(i64, encoded[0..], value, .big); self.hasher.update(&encoded); }};test "database root hash depends on relation root hashes and names" { const empty = emptyHash("empty"); var changed = empty; changed[0] +%= 1; const conflicts = ConflictRoot.empty(); const left = DatabaseRoot.init(&.{ .{ .name = "items", .hash = empty }, }, conflicts); const same_left = DatabaseRoot.init(&.{ .{ .name = "items", .hash = empty }, }, conflicts); const renamed = DatabaseRoot.init(&.{ .{ .name = "users", .hash = empty }, }, conflicts); const modified = DatabaseRoot.init(&.{ .{ .name = "items", .hash = changed }, }, conflicts); try std.testing.expect(same(left.hash, same_left.hash)); try std.testing.expect(!same(left.hash, renamed.hash)); try std.testing.expect(!same(left.hash, modified.hash));}test "database root sorted hash is independent of relation entry order" { const items = emptyHash("items"); const users = emptyHash("users"); const conflicts = ConflictRoot.empty(); var first = try DatabaseRoot.initSorted(std.testing.allocator, &.{ .{ .name = "items", .hash = items }, .{ .name = "users", .hash = users }, }, conflicts); defer first.deinit(); var second = try DatabaseRoot.initSorted(std.testing.allocator, &.{ .{ .name = "users", .hash = users }, .{ .name = "items", .hash = items }, }, conflicts); defer second.deinit(); try std.testing.expect(same(first.hash, second.hash)); try std.testing.expectEqualStrings("items", first.entries[0].name); try std.testing.expectEqualStrings("users", first.entries[1].name);}test "database root hash depends on conflict root" { const relation = emptyHash("relation"); const artifact = ConflictArtifact.init("items", 7, "base", "ours", "theirs"); const conflicts = ConflictRoot.init(&.{artifact.entry()}); const clean = DatabaseRoot.init(&.{.{ .name = "items", .hash = relation }}, ConflictRoot.empty()); const conflicted = DatabaseRoot.init(&.{.{ .name = "items", .hash = relation }}, conflicts); try std.testing.expect(!same(clean.hash, conflicted.hash)); try std.testing.expect(same(conflicts.hash, conflicted.conflicts));}test "conflict artifact hash distinguishes row and relation values" { const ours = emptyHash("conflict.ours"); const theirs = emptyHash("conflict.theirs"); const row_artifact = ConflictArtifact.init("items", 0, null, "ours", "theirs"); const relation_artifact = ConflictArtifact.initRelation("items", null, ours, theirs); try std.testing.expectEqual(ConflictKind.row, row_artifact.kind); try std.testing.expectEqual(ConflictKind.relation, relation_artifact.kind); try std.testing.expect(!same(row_artifact.hash, relation_artifact.hash)); try std.testing.expect(same(ours, relation_artifact.ours.?.relation)); try std.testing.expect(same(theirs, relation_artifact.theirs.?.relation)); const conflicts = ConflictRoot.init(&.{relation_artifact.entry()}); try std.testing.expectEqual(@as(usize, 1), conflicts.count);}test "schema hash includes index descriptor names" { const columns = [_]catalog_mod.ColumnDefinition{.{ .name = "value" }}; const fields = [_]usize{0}; const index_columns = [_]row.Column{.{}}; const first = [_]catalog_mod.IndexDefinition{.{ .name = "items_value", .fields = fields[0..], .columns = index_columns[0..], }}; const second = [_]catalog_mod.IndexDefinition{.{ .name = "items_value_alt", .fields = fields[0..], .columns = index_columns[0..], }}; try std.testing.expect(!same(schemaHash(columns[0..], first[0..]), schemaHash(columns[0..], second[0..])));}test "conflict root sorted hash is independent of artifact order" { const first = ConflictArtifact.init("items", 1, "base", "ours", "theirs"); const second = ConflictArtifact.init("users", 2, null, "ours", "theirs"); const left = try ConflictRoot.initSorted(std.testing.allocator, &.{ first.entry(), second.entry() }); const right = try ConflictRoot.initSorted(std.testing.allocator, &.{ second.entry(), first.entry() }); try std.testing.expect(same(left.hash, right.hash)); try std.testing.expectEqual(@as(usize, 2), left.count);}test "relation stats hash ignores physical table shape" { var no_indexes = [_]catalog_mod.IndexStats{}; const left = catalog_mod.RelationStats{ .allocator = std.testing.allocator, .table_root_page = 17, .table = .{ .branch_pages = 1, .leaf_pages = 2, .overflow_pages = 3, .entries = 11, .inline_records = 9, .overflow_records = 2, .max_depth = 2, .key_bytes = 44, .record_bytes = 99, .value_bytes = 180, }, .indexes = no_indexes[0..], }; const same_logical = catalog_mod.RelationStats{ .allocator = std.testing.allocator, .table_root_page = 91, .table = .{ .branch_pages = 8, .leaf_pages = 13, .overflow_pages = 21, .entries = 11, .inline_records = 4, .overflow_records = 7, .max_depth = 5, .key_bytes = 44, .record_bytes = 24, .value_bytes = 180, }, .indexes = no_indexes[0..], }; const different_logical = catalog_mod.RelationStats{ .allocator = std.testing.allocator, .table_root_page = 91, .table = .{ .branch_pages = 8, .leaf_pages = 13, .overflow_pages = 21, .entries = 12, .inline_records = 4, .overflow_records = 7, .max_depth = 5, .key_bytes = 44, .record_bytes = 24, .value_bytes = 180, }, .indexes = no_indexes[0..], }; const first = relationStatsRoot(&left); const second = relationStatsRoot(&same_logical); const changed = relationStatsRoot(&different_logical); try std.testing.expect(same(first.hash, second.hash)); try std.testing.expect(!same(first.hash, changed.hash));}test "index stats hash ignores physical root and shape" { var left_name = [_]u8{ 'b', 'y', '_', 'v', 'a', 'l', 'u', 'e' }; var right_name = [_]u8{ 'b', 'y', '_', 'v', 'a', 'l', 'u', 'e' }; var changed_name = [_]u8{ 'b', 'y', '_', 'v', 'a', 'l', 'u', 'e' }; const left = catalog_mod.IndexStats{ .name = left_name[0..], .root_page = 19, .summary = .{ .branch_pages = 1, .leaf_pages = 3, .overflow_pages = 5, .entries = 7, .inline_records = 6, .overflow_records = 1, .max_depth = 2, .key_bytes = 33, .record_bytes = 120, .value_bytes = 88, }, .distribution = .{ .distinct_values = 6, .max_equal = 2, }, }; const same_logical = catalog_mod.IndexStats{ .name = right_name[0..], .root_page = 71, .summary = .{ .branch_pages = 11, .leaf_pages = 13, .overflow_pages = 17, .entries = 7, .inline_records = 2, .overflow_records = 5, .max_depth = 4, .key_bytes = 33, .record_bytes = 60, .value_bytes = 88, }, .distribution = .{ .distinct_values = 6, .max_equal = 2, }, }; const different_distribution = catalog_mod.IndexStats{ .name = changed_name[0..], .root_page = 71, .summary = .{ .branch_pages = 11, .leaf_pages = 13, .overflow_pages = 17, .entries = 7, .inline_records = 2, .overflow_records = 5, .max_depth = 4, .key_bytes = 33, .record_bytes = 60, .value_bytes = 88, }, .distribution = .{ .distinct_values = 7, .max_equal = 2, }, }; try std.testing.expect(same(indexStatsHash(&left), indexStatsHash(&same_logical))); try std.testing.expect(!same(indexStatsHash(&left), indexStatsHash(&different_distribution)));}test "commit hash depends on root and parents" { const root = emptyHash("root"); const parent = emptyHash("parent"); const other_parent = emptyHash("other-parent"); const first = Commit.init(root, &.{parent}); const second = Commit.init(root, &.{parent}); const other = Commit.init(root, &.{other_parent}); try std.testing.expect(same(first.hash, second.hash)); try std.testing.expect(!same(first.hash, other.hash));}test "working set tracks explicit base working and staged roots" { const base = emptyHash("base"); const working = emptyHash("working"); const next = emptyHash("next"); const clean = WorkingSet.init(base); try std.testing.expect(same(clean.base, base)); try std.testing.expect(!clean.dirty()); try std.testing.expect(!clean.hasStaged()); const changed = clean.withWorking(working); try std.testing.expect(changed.dirty()); try std.testing.expect(!changed.hasStaged()); const staged = changed.stage(); try std.testing.expect(staged.dirty()); try std.testing.expect(staged.hasStaged()); try std.testing.expect(same(staged.staged, working)); const advanced = staged.advance(next); try std.testing.expect(!advanced.dirty()); try std.testing.expect(!advanced.hasStaged()); try std.testing.expect(same(advanced.base, next));}test "relation root ignores unrelated catalog schema version bumps" { var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); var database = try @import("file.zig").Database.openForTesting(std.testing.allocator, tmp.dir, .{ .paths = .{ .database = "version-schema.db", .wal = "version-schema.wal" }, .header = testingHeader(), }); defer database.deinit(); try database.reserve(.{ .wal_frames = 256 }); var catalog = try catalog_mod.Catalog.open(&database, .{}); const first = try catalog.createRelation(std.testing.allocator, .{ .name = "items", .columns = &.{.{ .name = "value" }}, }, .{ .durability = .buffered }); var handle = try catalog.openRelation(std.testing.allocator, "items"); defer handle.deinit(); _ = try handle.relation.put(std.testing.allocator, 1, &.{.{ .text = "one" }}, .{ .durability = .buffered }); var before = try relationRoot(std.testing.allocator, "items", first.schema, &handle, null); defer before.deinit(); const second = try catalog.createRelation(std.testing.allocator, .{ .name = "users", }, .{ .durability = .buffered }); try std.testing.expect(second.schema.version > first.schema.version); var after = try relationRoot(std.testing.allocator, "items", second.schema, &handle, null); defer after.deinit(); try std.testing.expect(same(before.hash, after.hash));}test "database root from catalog tracks all relation roots" { var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); var database = try @import("file.zig").Database.openForTesting(std.testing.allocator, tmp.dir, .{ .paths = .{ .database = "database-root.db", .wal = "database-root.wal" }, .header = testingHeader(), }); defer database.deinit(); try database.reserve(.{ .wal_frames = 512 }); var catalog = try catalog_mod.Catalog.open(&database, .{}); _ = try catalog.createRelation(std.testing.allocator, .{ .name = "items", .columns = &.{.{ .name = "value" }}, }, .{ .durability = .buffered }); _ = try catalog.createRelation(std.testing.allocator, .{ .name = "users", .columns = &.{.{ .name = "name" }}, }, .{ .durability = .buffered }); var before = try databaseRoot( std.testing.allocator, &catalog, ConflictRoot.empty().hash, ); defer before.deinit(); var users = try catalog.openRelation(std.testing.allocator, "users"); defer users.deinit(); _ = try users.relation.put(std.testing.allocator, 1, &.{.{ .text = "ada" }}, .{ .durability = .buffered }); var after = try databaseRoot( std.testing.allocator, &catalog, ConflictRoot.empty().hash, ); defer after.deinit(); try std.testing.expect(!same(before.hash, after.hash)); try std.testing.expectEqual(@as(usize, 2), after.entries.len); try std.testing.expectEqualStrings("items", after.entries[0].name); try std.testing.expectEqualStrings("users", after.entries[1].name);}test "database value accepts replacement relation values" { var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); var database = try @import("file.zig").Database.openForTesting(std.testing.allocator, tmp.dir, .{ .paths = .{ .database = "database-value-replacement.db", .wal = "database-value-replacement.wal" }, .header = testingHeader(), }); defer database.deinit(); try database.reserve(.{ .wal_frames = 512 }); var catalog = try catalog_mod.Catalog.open(&database, .{}); _ = try catalog.createRelation(std.testing.allocator, .{ .name = "items", .columns = &.{.{ .name = "value" }}, }, .{ .durability = .buffered }); _ = try catalog.createRelation(std.testing.allocator, .{ .name = "users", .columns = &.{.{ .name = "name" }}, }, .{ .durability = .buffered }); var live = try databaseValue( std.testing.allocator, &catalog, ConflictRoot.empty().hash, ); defer live.deinit(); var replacement = try live.relations[0].clone(std.testing.allocator); defer replacement.deinit(std.testing.allocator); replacement.root.hash = emptyHash("sql.test.replacement"); var replaced = try databaseValueReplacingRelations( std.testing.allocator, &catalog, &.{replacement}, ConflictRoot.empty().hash, ); defer replaced.deinit(); try std.testing.expect(same(replaced.relations[0].root.hash, replacement.root.hash)); try std.testing.expect(same(replaced.root.entries[0].hash, replacement.root.hash)); try std.testing.expect(same(replaced.relations[1].root.hash, live.relations[1].root.hash));}test "relation value applies row edits from an immutable base" { var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); var database = try @import("file.zig").Database.openForTesting(std.testing.allocator, tmp.dir, .{ .paths = .{ .database = "relation-value-edits.db", .wal = "relation-value-edits.wal" }, .header = testingHeader(), }); defer database.deinit(); try database.reserve(.{ .wal_frames = 512 }); var catalog = try catalog_mod.Catalog.open(&database, .{}); _ = try catalog.createRelation(std.testing.allocator, .{ .name = "items", .columns = &.{.{ .name = "value" }}, }, .{ .durability = .buffered }); var handle = try catalog.openRelation(std.testing.allocator, "items"); defer handle.deinit(); _ = try handle.relation.put(std.testing.allocator, 1, &.{.{ .text = "one" }}, .{ .durability = .buffered }); _ = try handle.relation.put(std.testing.allocator, 3, &.{.{ .text = "three" }}, .{ .durability = .buffered }); var base = try databaseValue( std.testing.allocator, &catalog, ConflictRoot.empty().hash, ); defer base.deinit(); const base_items = base.findRelation("items").?; var two_buffer: [128]u8 = undefined; const two = try row.encode(&two_buffer, &.{.{ .text = "two" }}); var updated_buffer: [128]u8 = undefined; const updated = try row.encode(&updated_buffer, &.{.{ .text = "updated" }}); var applied = try relationValueApplyingMaterializedEdits(std.testing.allocator, base_items, &.{ .{ .put = .{ .rowid = 2, .bytes = two } }, .{ .put = .{ .rowid = 3, .bytes = updated } }, .{ .update = .{ .rowid = 2, .assignments = &.{.{ .column = 0, .value = .{ .text = "two-edited" } }} } }, .{ .delete = 1 }, }); defer applied.deinit(std.testing.allocator); try std.testing.expectEqual(@as(usize, 2), applied.rows.len); try std.testing.expectEqual(@as(i64, 2), applied.rows[0].rowid); try std.testing.expectEqual(@as(i64, 3), applied.rows[1].rowid); const inserted = try row.View.init(applied.rows[0].bytes); const replaced = try row.View.init(applied.rows[1].bytes); try std.testing.expectEqualStrings("two-edited", (try inserted.column(0)).text); try std.testing.expectEqualStrings("updated", (try replaced.column(0)).text); try std.testing.expectError(error.KeyNotFound, relationValueApplyingMaterializedEdits(std.testing.allocator, base_items, &.{.{ .delete = 99 }})); try std.testing.expectError(error.KeyNotFound, relationValueApplyingMaterializedEdits(std.testing.allocator, base_items, &.{.{ .update = .{ .rowid = 99, .assignments = &.{.{ .column = 0, .value = .nil }} } }}));}test "relation root from materialized rows matches live logical maps" { var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); var database = try @import("file.zig").Database.openForTesting(std.testing.allocator, tmp.dir, .{ .paths = .{ .database = "relation-root-rows.db", .wal = "relation-root-rows.wal" }, .header = testingHeader(), }); defer database.deinit(); try database.reserve(.{ .wal_frames = 512 }); var catalog = try catalog_mod.Catalog.open(&database, .{}); _ = try catalog.createRelation(std.testing.allocator, .{ .name = "items", .columns = &.{ .{ .name = "name" }, .{ .name = "score" }, }, .indexes = &.{.{ .name = "items_score", .fields = &.{1}, .columns = &.{.{}}, }}, }, .{ .durability = .buffered }); var handle = try catalog.openRelation(std.testing.allocator, "items"); defer handle.deinit(); _ = try handle.relation.put(std.testing.allocator, 3, &.{ .{ .text = "Ada" }, .{ .integer = 7 } }, .{ .durability = .buffered }); _ = try handle.relation.put(std.testing.allocator, 1, &.{ .{ .text = "Bea" }, .{ .integer = 4 } }, .{ .durability = .buffered }); const schema = try catalog.schemaState(std.testing.allocator); var live_root = try relationRoot(std.testing.allocator, "items", schema, &handle, null); defer live_root.deinit(); const rows = try relationRows(std.testing.allocator, &handle); defer freeRelationRows(std.testing.allocator, rows); var materialized_root = try relationRootFromRows(std.testing.allocator, &live_root, rows); defer materialized_root.deinit(); try std.testing.expect(same(live_root.hash, materialized_root.hash)); try std.testing.expect(same(live_root.table.hash, materialized_root.table.hash)); try std.testing.expectEqual(@as(usize, 1), materialized_root.indexes.len); try std.testing.expect(same(live_root.indexes[0].map.hash, materialized_root.indexes[0].map.hash));}test "index root from rows retains exact encoded key storage" { const row_count = 512; var row_buffer: [64]u8 = undefined; const encoded = try row.encode(&row_buffer, &.{.{ .text = "compact" }}); var rows: [row_count]RelationRow = undefined; for (&rows, 0..) |*row_value, index| { row_value.* = .{ .rowid = @intCast(index + 1), .bytes = @constCast(encoded), }; } var storage: [256 * 1024]u8 = undefined; var fixed = std.heap.FixedBufferAllocator.init(&storage); var root = try indexRootFromRows( fixed.allocator(), &rows, &.{0}, &.{.{}}, ); defer root.deinit(); try std.testing.expectEqual(@as(usize, row_count), root.summary.entries); try std.testing.expect(fixed.end_index < storage.len);}test "relation root hash is stable across reopen and changes after row write" { var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); { var database = try @import("file.zig").Database.openForTesting(std.testing.allocator, tmp.dir, .{ .paths = .{ .database = "version.db", .wal = "version.wal" }, .header = testingHeader(), }); defer database.deinit(); try database.reserve(.{ .wal_frames = 256 }); var catalog = try catalog_mod.Catalog.open(&database, .{}); _ = try catalog.createRelation(std.testing.allocator, .{ .name = "items", .columns = &.{.{ .name = "value" }}, }, .{ .durability = .buffered }); var handle = try catalog.openRelation(std.testing.allocator, "items"); defer handle.deinit(); _ = try handle.relation.put(std.testing.allocator, 1, &.{.{ .text = "one" }}, .{ .durability = .buffered }); const schema = try catalog.schemaState(std.testing.allocator); var stats = try catalog.relationStats(std.testing.allocator, "items"); defer if (stats) |*s| s.deinit(); var root = try relationRoot(std.testing.allocator, "items", schema, &handle, if (stats) |*s| s else null); defer root.deinit(); try std.testing.expect(root.table.summary.entries == 1); try std.testing.expectEqual(@as(usize, 1), root.schema_descriptor.columns.len); try std.testing.expectEqualStrings("value", root.schema_descriptor.columns[0].name); try std.testing.expectEqual(@as(usize, 0), root.schema_descriptor.indexes.len); try database.syncWal(); } var reopened = try @import("file.zig").Database.openForTesting(std.testing.allocator, tmp.dir, .{ .paths = .{ .database = "version.db", .wal = "version.wal" }, .header = recoveredHeader(), }); defer reopened.deinit(); try reopened.reserve(.{ .wal_frames = 256 }); var catalog = try catalog_mod.Catalog.open(&reopened, .{}); var handle = try catalog.openRelation(std.testing.allocator, "items"); defer handle.deinit(); const schema = try catalog.schemaState(std.testing.allocator); var stats = try catalog.relationStats(std.testing.allocator, "items"); defer if (stats) |*s| s.deinit(); var before = try relationRoot(std.testing.allocator, "items", schema, &handle, if (stats) |*s| s else null); defer before.deinit(); var again = try relationRoot(std.testing.allocator, "items", schema, &handle, if (stats) |*s| s else null); defer again.deinit(); try std.testing.expect(same(before.hash, again.hash)); _ = try handle.relation.put(std.testing.allocator, 2, &.{.{ .text = "two" }}, .{ .durability = .buffered }); var after = try relationRoot(std.testing.allocator, "items", schema, &handle, if (stats) |*s| s else null); defer after.deinit(); try std.testing.expect(!same(before.hash, after.hash));}fn testingHeader() wal.Header { return .{ .sequence = 1801, .salt = .{ .first = 0xabcd_0101, .second = 0xdcba_0202 }, };}fn recoveredHeader() wal.Header { return .{ .sequence = 1802, .salt = .{ .first = 0x0101_abcd, .second = 0x0202_dcba }, };}test "relation key matches the maintained root identity across the fixture matrix" { const testing = std.testing; var tmp = testing.tmpDir(.{}); defer tmp.cleanup(); var database = try @import("file.zig").Database.openForTesting(testing.allocator, tmp.dir, .{ .paths = .{ .database = "key.db", .wal = "key.wal" }, .header = .{ .sequence = 3101, .salt = .{ .first = 0x1a2b_0101, .second = 0x2b1a_0202 }, }, }); defer database.deinit(); try database.reserve(.{ .wal_frames = 512 }); var catalog = try catalog_mod.Catalog.open(&database, .{}); _ = try catalog.createRelation(testing.allocator, .{ .name = "bare", .columns = &.{}, }, .{ .durability = .buffered }); _ = try catalog.createRelation(testing.allocator, .{ .name = "items", .columns = &.{ .{ .name = "value" }, .{ .name = "grade" } }, }, .{ .durability = .buffered }); try expectKeyMatchesRoot(&catalog, "bare"); try expectKeyMatchesRoot(&catalog, "items"); var relation = try catalog.openRelation(testing.allocator, "items"); _ = try relation.relation.put(testing.allocator, 1, &.{ .{ .text = "one" }, .{ .integer = 7 } }, .{ .durability = .buffered }); _ = try relation.relation.put(testing.allocator, 2, &.{ .{ .text = "two" }, .{ .integer = 9 } }, .{ .durability = .buffered }); relation.deinit(); try expectKeyMatchesRoot(&catalog, "items"); _ = try catalog.createIndex(testing.allocator, "items", .{ .name = "items_by_grade", .fields = &.{1}, }, .{ .durability = .buffered }); try expectKeyMatchesRoot(&catalog, "items"); _ = try catalog.analyzeRelation(testing.allocator, "items", .{ .durability = .buffered }); try expectKeyMatchesRoot(&catalog, "items"); try expectKeyMatchesRoot(&catalog, "bare");}fn expectKeyMatchesRoot(catalog: *const catalog_mod.Catalog, name: []const u8) !void { const testing = std.testing; const schema = try catalog.schemaState(testing.allocator); var handle = try catalog.openRelation(testing.allocator, name); defer handle.deinit(); var stats = try catalog.relationStats(testing.allocator, name); defer if (stats) |*relation_stats| relation_stats.deinit(); const stats_pointer: ?*const catalog_mod.RelationStats = if (stats) |*relation_stats| relation_stats else null; const derived = try relationKey(name, &handle, stats_pointer); var root = try relationRootMaintained(testing.allocator, name, schema, &handle, stats_pointer); defer root.deinit(); try testing.expect(same(derived.schema, root.schema)); try testing.expect(same(derived.table, root.table.hash)); try testing.expect(same(derived.stats, root.stats.hash)); try testing.expect(same(derived.hash, root.hash)); var lease = try catalog.database.beginRead(); defer lease.deinit(); const reader = try catalog_mod.Reader.open(lease.snapshot(), .{ .meta_page = catalog.meta_page, .root_page = catalog.root_page, }); var read_handle = try reader.openRelation(testing.allocator, name); defer read_handle.deinit(); var read_root = try readRelationRootMaintained( testing.allocator, name, schema, &read_handle, stats_pointer, ); defer read_root.deinit(); try testing.expect(same(root.hash, read_root.hash));}Complete caller list for version.emptyHash
77 direct callers.
lib.sql.src.branch.test_branch_ancestry_rejects_missing_commits[function] — test source atlib/sql/src/branch.zig:240in nearest public ownertiny.sql.branchlib.sql.src.branch.test_branch_checkout_keeps_head_and_working_state_explicit[function] — test source atlib/sql/src/branch.zig:206in nearest public ownertiny.sql.branchlib.sql.src.branch.test_branch_fast-forward_follows_commit_ancestry[function] — test source atlib/sql/src/branch.zig:160in nearest public ownertiny.sql.branchlib.sql.src.branch.test_branch_merge_base_chooses_nearest_common_ancestor[function] — test source atlib/sql/src/branch.zig:187in nearest public ownertiny.sql.branchlib.sql.src.connection.relationRootHasStats[function] — private source atlib/sql/src/connection.zig:1150in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_applies_explicit_database_merge_snapshots_into_working_root[function] — test source atlib/sql/src/connection.zig:2009in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_fast_forward_missing_database_root_is_failure_atomic[function] — test source atlib/sql/src/connection.zig:2687in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_resolves_selected_conflict_artifacts[function] — test source atlib/sql/src/connection.zig:2316in nearest public ownertiny.sql.connectionlib.sql.src.history.recover.test_history_replay_keeps_semantic_failure_before_later_hashes[function] — test source atlib/sql/src/history/recover.zig:697in nearest public ownerlib.sql.src.history.recoverlib.sql.src.history.recover.test_history_replay_keeps_the_earliest_hash_failure_across_worker_order[function] — test source atlib/sql/src/history/recover.zig:654in nearest public ownerlib.sql.src.history.recoverlib.sql.src.history.recover.test_history_replay_serial_and_parallel_batches_agree[function] — test source atlib/sql/src/history/recover.zig:622in nearest public ownerlib.sql.src.history.recoverlib.sql.src.history.refs.test_refs_advance_rejects_a_ref_before_its_target_commit[function] — test source atlib/sql/src/history/refs.zig:931in nearest public ownertiny.sql.history.refslib.sql.src.history.refs.test_refs_advance_resolves_stale_suffix_and_pre-boundary_targets[function] — test source atlib/sql/src/history/refs.zig:871in nearest public ownertiny.sql.history.refslib.sql.src.history.resolver.test_history_resolver_keeps_the_first_typed_commit_location[function] — test source atlib/sql/src/history/resolver.zig:304in nearest public ownertiny.sql.history.resolverlib.sql.src.history.store.test_fast_forward_coordinator_fences_history_until_completion[function] — test source atlib/sql/src/history/store.zig:2683in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_fast_forward_poisons_an_ambiguous_preexisting_write_batch[function] — test source atlib/sql/src/history/store.zig:2733in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_appends_after_a_truncating_recovery_end_the_file_where_they_stop[function] — test source atlib/sql/src/history/store.zig:3851in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_creates_checkouts_and_advances_branches_durably[function] — test source atlib/sql/src/history/store.zig:3480in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_deletes_refs_durably[function] — test source atlib/sql/src/history/store.zig:3631in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_open_rejects_prior_format_records[function] — test source atlib/sql/src/history/store.zig:3802in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_preserves_semantically_invalid_coordinator_evidence[function] — test source atlib/sql/src/history/store.zig:2932in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_reads_indexed_row_topology_for_incremental_access[function] — test source atlib/sql/src/history/store.zig:3205in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_rechecks_indexed_row_topology_during_access[function] — test source atlib/sql/src/history/store.zig:3421in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_recovers_branch_commits_and_merge_commits[function] — test source atlib/sql/src/history/store.zig:3542in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_recovers_commits_refs_and_conflicts[function] — test source atlib/sql/src/history/store.zig:2404in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_recovers_database_roots_by_commit[function] — test source atlib/sql/src/history/store.zig:3012in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_recovers_relation_roots_by_hash[function] — test source atlib/sql/src/history/store.zig:3044in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_recovers_relation_rows_by_root_hash[function] — test source atlib/sql/src/history/store.zig:3175in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_recovery_truncates_corrupt_tail[function] — test source atlib/sql/src/history/store.zig:3821in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_recovery_truncates_refs_with_missing_commits[function] — test source atlib/sql/src/history/store.zig:3604in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_refs_recover_the_latest_target[function] — test source atlib/sql/src/history/store.zig:3582in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_rejects_relation_roots_referencing_missing_tree_nodes[function] — test source atlib/sql/src/history/store.zig:2319in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_reopens_logs_larger_than_sixteen_mebibytes[function] — test source atlib/sql/src/history/store.zig:3451in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_replays_committed_fast_forward_until_completion[function] — test source atlib/sql/src/history/store.zig:2825in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_replays_pending_fast_forward_through_abort_completion[function] — test source atlib/sql/src/history/store.zig:2773in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_row_topology_duplicates_keep_the_first_records[function] — test source atlib/sql/src/history/store.zig:3318in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_shares_index_pages_across_large_relation_versions[function] — test source atlib/sql/src/history/store.zig:3680in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_shares_row_chunks_across_relation_versions[function] — test source atlib/sql/src/history/store.zig:3711in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_truncates_a_torn_fast_forward_decision_to_pending_prepare[function] — test source atlib/sql/src/history/store.zig:2872in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_updates_refs_only_when_expected_target_matches[function] — test source atlib/sql/src/history/store.zig:3516in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_validates_exact_conflict_root_closure[function] — test source atlib/sql/src/history/store.zig:2483in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_validates_indexed_row_topology_during_open[function] — test source atlib/sql/src/history/store.zig:3391in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_verifies_row_chunk_payloads_during_open[function] — test source atlib/sql/src/history/store.zig:3747in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_verifies_tree_node_batches_during_open[function] — test source atlib/sql/src/history/store.zig:2269in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_write_batch_emits_one_write_and_one_sync[function] — test source atlib/sql/src/history/store.zig:2649in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_write_batch_preserves_completed_records_after_allocation_failure[function] — test source atlib/sql/src/history/store.zig:2985in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.testingMapRoot[function] — private source atlib/sql/src/history/store.zig:1876in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.testingMerkleRelationRoot[function] — private source atlib/sql/src/history/store.zig:2033in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.testingMerkleTree[function] — private source atlib/sql/src/history/store.zig:1925in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.testingRelationRoot[function] — private source atlib/sql/src/history/store.zig:1820in nearest public ownerlib.sql.src.history.storelib.sql.src.history.validate.test_attested_prefix_scanner_skips_an_unrelated_sparse_payload[function] — test source atlib/sql/src/history/validate.zig:1496in nearest public ownerlib.sql.src.history.validatelib.sql.src.history.validate.test_history_suffix_validation_applies_complete_fast_forward_and_rejects_its_crash_cut[function] — test source atlib/sql/src/history/validate.zig:1826in nearest public ownerlib.sql.src.history.validatelib.sql.src.history.validate.test_history_suffix_validation_preflights_allocation-driving_counts[function] — test source atlib/sql/src/history/validate.zig:1912in nearest public ownerlib.sql.src.history.validatelib.sql.src.history.validate.test_history_suffix_validation_rejects_a_byte-corrupted_dependency_prefix[function] — test source atlib/sql/src/history/validate.zig:1783in nearest public ownerlib.sql.src.history.validatelib.sql.src.history.validate.test_history_suffix_validation_rejects_a_first_tree_node_that_names_itself[function] — test source atlib/sql/src/history/validate.zig:1729in nearest public ownerlib.sql.src.history.validatelib.sql.src.history.validate.test_history_suffix_validation_rejects_a_ref_before_its_future_commit[function] — test source atlib/sql/src/history/validate.zig:1595in nearest public ownerlib.sql.src.history.validatelib.sql.src.history.validate.test_history_suffix_validation_resolves_a_commit_in_the_prefix[function] — test source atlib/sql/src/history/validate.zig:1566in nearest public ownerlib.sql.src.history.validatelib.sql.src.history.verify.test_history_verification_reports_a_missing_dependency_without_writing[function] — test source atlib/sql/src/history/verify.zig:262in nearest public ownertiny.sql.history.verificationlib.sql.src.lifecycle.test_lifecycle_moved_history_preserves_stale_refs_before_retry_publication[function] — test source atlib/sql/src/lifecycle.zig:1570in nearest public ownertiny.sql.lifecyclelib.sql.src.lifecycle.test_lifecycle_read-only_classifies_branch_root_and_freshness_repairs[function] — test source atlib/sql/src/lifecycle.zig:1665in nearest public ownertiny.sql.lifecyclelib.sql.src.lifecycle.test_lifecycle_stale_deferred_conflict_identity_falls_back_and_heals[function] — test source atlib/sql/src/lifecycle.zig:1904in nearest public ownertiny.sql.lifecycletiny.sql.plan.emptyParameterShape[function] atlib/sql/src/plan.zig:58lib.sql.src.plan.statsShapeHash[function] — private source atlib/sql/src/plan.zig:86in 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.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_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.sync.test_sync_file_remotes_reject_truncated_history_without_repairing_it[function] — test source atlib/sql/src/sync.zig:2380in nearest public ownertiny.sql.synctiny.sql.ConflictRoot.empty[function] atlib/sql/src/version.zig:225lib.sql.src.version.indexStatsHash[function] — private source atlib/sql/src/version.zig:1254in nearest public ownertiny.sql.versionlib.sql.src.version.relationStatsRoot[function] — private source atlib/sql/src/version.zig:1225in nearest public ownertiny.sql.versionlib.sql.src.version.test_commit_hash_depends_on_root_and_parents[function] — test source atlib/sql/src/version.zig:1690in nearest public ownertiny.sql.versionlib.sql.src.version.test_conflict_artifact_hash_distinguishes_row_and_relation_values[function] — test source atlib/sql/src/version.zig:1517in nearest public ownertiny.sql.versionlib.sql.src.version.test_database_root_hash_depends_on_conflict_root[function] — test source atlib/sql/src/version.zig:1506in nearest public ownertiny.sql.versionlib.sql.src.version.test_database_root_hash_depends_on_relation_root_hashes_and_names[function] — test source atlib/sql/src/version.zig:1462in nearest public ownertiny.sql.versionlib.sql.src.version.test_database_root_sorted_hash_is_independent_of_relation_entry_order[function] — test source atlib/sql/src/version.zig:1486in nearest public ownertiny.sql.versionlib.sql.src.version.test_database_value_accepts_replacement_relation_values[function] — test source atlib/sql/src/version.zig:1803in nearest public ownertiny.sql.versionlib.sql.src.version.test_working_set_tracks_explicit_base_working_and_staged_roots[function] — test source atlib/sql/src/version.zig:1702in nearest public ownertiny.sql.version
Complete caller list for version.freeRelationRows
33 direct callers.
tiny.sql.blame.relation[function] atlib/sql/src/blame.zig:24lib.sql.src.blame.snapshotCommit[function] — private source atlib/sql/src/blame.zig:248in nearest public ownertiny.sql.blamelib.sql.src.chunk.buildRows[function] — private source atlib/sql/src/chunk.zig:151in nearest public ownertiny.sql.chunklib.sql.src.chunk.test_chunk_boundaries_cover_rows_contiguously_within_limits[function] — test source atlib/sql/src/chunk.zig:185in nearest public ownertiny.sql.chunklib.sql.src.chunk.test_chunk_boundaries_stable_under_single_row_insert[function] — test source atlib/sql/src/chunk.zig:269in nearest public ownertiny.sql.chunklib.sql.src.chunk.test_chunk_digest_distinguishes_content_and_order[function] — test source atlib/sql/src/chunk.zig:257in nearest public ownertiny.sql.chunklib.sql.src.chunk.test_streaming_chunker_matches_slice_boundaries_and_digests[function] — test source atlib/sql/src/chunk.zig:223in nearest public ownertiny.sql.chunklib.sql.src.connection.Connection.relationViewFromRoot[function] — private source atlib/sql/src/connection.zig:650in nearest public ownertiny.sql.connectiontiny.sql.ConnectionRelationView.deinit[method] atlib/sql/src/connection.zig:87lib.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_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.history.pack.importRowChunkPayload[method] — private source atlib/sql/src/history/pack.zig:86in nearest public ownerlib.sql.src.history.packlib.sql.src.history.resolver.test_history_resolver_typed_keys_agree_with_replay_across_object_kinds[function] — test source atlib/sql/src/history/resolver.zig:364in nearest public ownertiny.sql.history.resolvertiny.sql.History.databaseValue[method] atlib/sql/src/history/store.zig:971lib.sql.src.history.store.test_history_merkle_relation_roots_preserve_diff_behavior_across_reopen[function] — test source atlib/sql/src/history/store.zig:2127in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_reads_indexed_row_topology_for_incremental_access[function] — test source atlib/sql/src/history/store.zig:3205in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_recovers_relation_rows_by_root_hash[function] — test source atlib/sql/src/history/store.zig:3175in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_reopens_logs_larger_than_sixteen_mebibytes[function] — test source atlib/sql/src/history/store.zig:3451in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_row_topology_duplicates_keep_the_first_records[function] — test source atlib/sql/src/history/store.zig:3318in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_shares_index_pages_across_large_relation_versions[function] — test source atlib/sql/src/history/store.zig:3680in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_shares_row_chunks_across_relation_versions[function] — test source atlib/sql/src/history/store.zig:3711in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.testingChunkRows[function] — private source atlib/sql/src/history/store.zig:3662in nearest public ownerlib.sql.src.history.storelib.sql.src.sync.test_sync_byte_packs_import_and_fetch_remote_refs[function] — test source atlib/sql/src/sync.zig:2218in nearest public ownertiny.sql.synclib.sql.src.sync.test_sync_clone_copies_reachable_history_and_refs[function] — test source atlib/sql/src/sync.zig:1862in nearest public ownertiny.sql.synclib.sql.src.sync.test_sync_fetch_writes_remote_tracking_refs[function] — test source atlib/sql/src/sync.zig:2058in nearest public ownertiny.sql.synclib.sql.src.sync.test_sync_file_remotes_clone_fetch_push_and_pull_refs[function] — test source atlib/sql/src/sync.zig:2554in nearest public ownertiny.sql.synclib.sql.src.sync.test_sync_push_fast_forwards_remote_refs_and_rejects_divergence[function] — test source atlib/sql/src/sync.zig:2499in nearest public ownertiny.sql.synclib.sql.src.sync.test_sync_record_packs_re-export_from_imported_stores[function] — test source atlib/sql/src/sync.zig:2020in nearest public ownertiny.sql.synctiny.sql.RelationValue.deinit[method] atlib/sql/src/version.zig:166tiny.sql.version.relationValueApplyingMaterializedEdits[function] atlib/sql/src/version.zig:889tiny.sql.version.relationValueFromRoot[function] atlib/sql/src/version.zig:755lib.sql.src.version.test_relation_root_from_materialized_rows_matches_live_logical_maps[function] — test source atlib/sql/src/version.zig:1899in nearest public ownertiny.sql.version
Complete caller list for version.relationKey
7 direct callers.
lib.sql.src.connection.Connection.publishStagedValue[method] — private source atlib/sql/src/connection.zig:710in nearest public ownertiny.sql.connectionlib.sql.src.connection.Connection.verifyMaterializedDatabaseRoot[method] — private source atlib/sql/src/connection.zig:423in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_materialized_root_verifier_rejects_an_extra_live_relation[function] — test source atlib/sql/src/connection.zig:2285in nearest public ownertiny.sql.connectiontiny.sql.PreparedRelation.currentCacheKey[method] atlib/sql/src/plan.zig:337lib.sql.src.session.database.StagedRelation.flushRoot[method] — private source atlib/sql/src/session/database.zig:451in nearest public ownerlib.sql.src.session.databaselib.sql.src.session.database.StagedRelation.matchesCurrentRoot[method] — private source atlib/sql/src/session/database.zig:476in nearest public ownerlib.sql.src.session.databaselib.sql.src.version.expectKeyMatchesRoot[function] — private source atlib/sql/src/version.zig:2085in nearest public ownertiny.sql.version
Complete call list for version.relationKey
11 direct calls.
lib.sql.src.version.Builder.bytes[method] — private source atlib/sql/src/version.zig:1367in nearest public ownertiny.sql.versionlib.sql.src.version.Builder.finish[method] — private source atlib/sql/src/version.zig:1357in nearest public ownertiny.sql.versionlib.sql.src.version.Builder.hash[method] — private source atlib/sql/src/version.zig:1363in nearest public ownertiny.sql.versionlib.sql.src.version.Builder.init[function] — private source atlib/sql/src/version.zig:1351in nearest public ownertiny.sql.versionlib.sql.src.version.Builder.writeU32[method] — private source atlib/sql/src/version.zig:1443in nearest public ownertiny.sql.versionlib.sql.src.version.Builder.writeU64[method] — private source atlib/sql/src/version.zig:1449in nearest public ownertiny.sql.versionlib.sql.src.version.findIndexStats[function] — private source atlib/sql/src/version.zig:1246in nearest public ownertiny.sql.versionlib.sql.src.version.indexHash[function] — private source atlib/sql/src/version.zig:1208in nearest public ownertiny.sql.versionlib.sql.src.version.indexStatsHash[function] — private source atlib/sql/src/version.zig:1254in nearest public ownertiny.sql.versionlib.sql.src.version.relationStatsRoot[function] — private source atlib/sql/src/version.zig:1225in nearest public ownertiny.sql.versiontiny.sql.version.schemaHash[function] atlib/sql/src/version.zig:1133
Complete caller list for version.relationRootMaintained
7 direct callers.
lib.sql.src.connection.Connection.publishStagedValue[method] — private source atlib/sql/src/connection.zig:710in nearest public ownertiny.sql.connectiontiny.sql.PreparedRelation.refresh[method] atlib/sql/src/plan.zig:373lib.sql.src.plan.prepareRelationWithValidation[function] — private source atlib/sql/src/plan.zig:472in nearest public ownertiny.sql.plantiny.sql.RelationSession.open[function] atlib/sql/src/session/relation.zig:57tiny.sql.RelationSession.refresh[method] atlib/sql/src/session/relation.zig:140lib.sql.src.version.expectKeyMatchesRoot[function] — private source atlib/sql/src/version.zig:2085in nearest public ownertiny.sql.versiontiny.sql.version.relationValue[function] atlib/sql/src/version.zig:749
Complete caller list for version.relationValue
7 direct callers.
lib.sql.src.merge.test_database_merge_applies_clean_relation_edits_and_derives_root[function] — test source atlib/sql/src/merge.zig:1060in nearest public ownertiny.sql.mergelib.sql.src.merge.test_database_merge_contains_cross-schema_row_divergence[function] — test source atlib/sql/src/merge.zig:1563in nearest public ownertiny.sql.mergelib.sql.src.merge.test_database_merge_matches_relation_names_and_preserves_independent_relation_set_changes[function] — test source atlib/sql/src/merge.zig:1249in nearest public ownertiny.sql.mergelib.sql.src.merge.test_database_merge_preserves_a_theirs-only_index_schema[function] — test source atlib/sql/src/merge.zig:1510in nearest public ownertiny.sql.mergelib.sql.src.merge.test_database_merge_records_relation_topology_conflicts_under_database_root[function] — test source atlib/sql/src/merge.zig:1386in nearest public ownertiny.sql.mergelib.sql.src.merge.test_database_merge_supersedes_stale_slots_and_persists_complete_conflict_root[function] — test source atlib/sql/src/merge.zig:1151in nearest public ownertiny.sql.mergetiny.sql.version.databaseValueReplacingRelations[function] atlib/sql/src/version.zig:908
Complete caller list for version.same
207 direct callers.
tiny.sql.blame.relation[function] atlib/sql/src/blame.zig:24lib.sql.src.blame.test_blame_follows_side_branches_to_the_commits_that_introduced_rows[function] — test source atlib/sql/src/blame.zig:184in nearest public ownertiny.sql.blamelib.sql.src.branch.contains[function] — private source atlib/sql/src/branch.zig:146in nearest public ownertiny.sql.branchlib.sql.src.branch.containsAncestor[function] — private source atlib/sql/src/branch.zig:111in nearest public ownertiny.sql.branchlib.sql.src.branch.find[function] — private source atlib/sql/src/branch.zig:153in nearest public ownertiny.sql.branchtiny.sql.branch.mergeBase[function] atlib/sql/src/branch.zig:86lib.sql.src.branch.test_branch_checkout_keeps_head_and_working_state_explicit[function] — test source atlib/sql/src/branch.zig:206in nearest public ownertiny.sql.branchlib.sql.src.branch.test_branch_fast-forward_follows_commit_ancestry[function] — test source atlib/sql/src/branch.zig:160in nearest public ownertiny.sql.branchlib.sql.src.branch.test_branch_merge_base_chooses_nearest_common_ancestor[function] — test source atlib/sql/src/branch.zig:187in nearest public ownertiny.sql.branchlib.sql.src.chunk.containsDigest[function] — private source atlib/sql/src/chunk.zig:170in nearest public ownertiny.sql.chunklib.sql.src.chunk.test_chunk_digest_distinguishes_content_and_order[function] — test source atlib/sql/src/chunk.zig:257in nearest public ownertiny.sql.chunklib.sql.src.chunk.test_page_digest_distinguishes_content_and_order[function] — test source atlib/sql/src/chunk.zig:351in nearest public ownertiny.sql.chunklib.sql.src.chunk.test_streaming_chunker_matches_slice_boundaries_and_digests[function] — test source atlib/sql/src/chunk.zig:223in nearest public ownertiny.sql.chunklib.sql.src.connection.Connection.materializeDatabaseMerge[method] — private source atlib/sql/src/connection.zig:694in nearest public ownertiny.sql.connectionlib.sql.src.connection.Connection.publishStagedValue[method] — private source atlib/sql/src/connection.zig:710in nearest public ownertiny.sql.connectionlib.sql.src.connection.Connection.rollbackFastForward[method] — private source atlib/sql/src/connection.zig:476in nearest public ownertiny.sql.connectionlib.sql.src.connection.Connection.validateFastForwardBaseline[method] — private source atlib/sql/src/connection.zig:337in nearest public ownertiny.sql.connectionlib.sql.src.connection.Connection.verifyMaterializedDatabaseRoot[method] — private source atlib/sql/src/connection.zig:423in nearest public ownertiny.sql.connectionlib.sql.src.connection.DatabaseMaterialization.planRelation[function] — private source atlib/sql/src/connection.zig:966in nearest public ownertiny.sql.connectionlib.sql.src.connection.DatabaseMaterialization.validateRelationIdentity[function] — private source atlib/sql/src/connection.zig:1019in nearest public ownertiny.sql.connectionlib.sql.src.connection.DatabaseMaterialization.validateTarget[function] — private source atlib/sql/src/connection.zig:948in nearest public ownertiny.sql.connectionlib.sql.src.connection.DatabaseMaterialization.validateValue[function] — private source atlib/sql/src/connection.zig:928in nearest public ownertiny.sql.connectionlib.sql.src.connection.expectAtomicConnectionBaseline[function] — private source atlib/sql/src/connection.zig:3109in nearest public ownertiny.sql.connectionlib.sql.src.connection.expectLiveDatabaseRoot[function] — private source atlib/sql/src/connection.zig:3099in nearest public ownertiny.sql.connectionlib.sql.src.connection.expectTestingConflict[function] — private source atlib/sql/src/connection.zig:3082in nearest public ownertiny.sql.connectionlib.sql.src.connection.hasConflictHash[function] — private source atlib/sql/src/connection.zig:3172in nearest public ownertiny.sql.connectionlib.sql.src.connection.hasConflictHashValue[function] — private source atlib/sql/src/connection.zig:3179in nearest public ownertiny.sql.connectionlib.sql.src.connection.recoverFastForward[function] — private source atlib/sql/src/connection.zig:806in nearest public ownertiny.sql.connectionlib.sql.src.connection.relationRootHasStats[function] — private source atlib/sql/src/connection.zig:1150in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_committed_conflict_survives_identical_later_merge[function] — test source atlib/sql/src/connection.zig:2570in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_applies_explicit_database_merge_snapshots_into_working_root[function] — test source atlib/sql/src/connection.zig:2009in 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_checkout_row_root_mismatch_is_failure_atomic[function] — test source atlib/sql/src/connection.zig:2906in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_commit_rejects_an_unclosed_conflict_root[function] — test source atlib/sql/src/connection.zig:2623in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_commit_rejects_catalog_identity_drift[function] — test source atlib/sql/src/connection.zig:2661in 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_fast_forward_adopts_a_committed_conflict_root[function] — test source atlib/sql/src/connection.zig:2606in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_fast_forward_rejects_a_changed_working_set[function] — test source atlib/sql/src/connection.zig:2719in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_fast_forward_rejects_an_unsynced_semantic_clean_state[function] — test source atlib/sql/src/connection.zig:2763in 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_materialized_root_verifier_rejects_an_extra_live_relation[function] — test source atlib/sql/src/connection.zig:2285in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_materialized_root_verifier_rejects_relation_identity_drift[function] — test source atlib/sql/src/connection.zig:2258in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_merge_commit_records_parent_when_resolved_root_matches_ours[function] — test source atlib/sql/src/connection.zig:2410in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_merge_materialization_rejects_mismatched_and_unclosed_conflicts[function] — test source atlib/sql/src/connection.zig:2198in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_merge_materializes_independent_relation_additions[function] — test source atlib/sql/src/connection.zig:2454in 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_repairs_committed_fast_forward_to_target[function] — test source atlib/sql/src/connection.zig:2858in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_open_repairs_pending_fast_forward_to_baseline[function] — test source atlib/sql/src/connection.zig:2800in 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_rejects_a_selected_schema_before_changing_the_working_root[function] — test source atlib/sql/src/connection.zig:2081in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_replaces_conflict_root_after_value_resolution[function] — test source atlib/sql/src/connection.zig:2131in nearest public ownertiny.sql.connectionlib.sql.src.connection.test_connection_resolves_selected_conflict_artifacts[function] — test source atlib/sql/src/connection.zig:2316in 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.connectiontiny.sql.diff.relation[function] atlib/sql/src/diff.zig:136lib.sql.src.history.materialize.readHashListRecord[method] — private source atlib/sql/src/history/materialize.zig:232in nearest public ownerlib.sql.src.history.materializelib.sql.src.history.materialize.readIndexedRelationRoot[method] — private source atlib/sql/src/history/materialize.zig:62in nearest public ownerlib.sql.src.history.materializelib.sql.src.history.materialize.readIndexedRelationSpans[method] — private source atlib/sql/src/history/materialize.zig:257in nearest public ownerlib.sql.src.history.materializelib.sql.src.history.materialize.readPayload[method] — private source atlib/sql/src/history/materialize.zig:273in nearest public ownerlib.sql.src.history.materializelib.sql.src.history.materialize.readTreeNodeRecord[method] — private source atlib/sql/src/history/materialize.zig:188in nearest public ownerlib.sql.src.history.materializelib.sql.src.history.pack.appendRowChunkPackPayload[method] — private source atlib/sql/src/history/pack.zig:17in nearest public ownerlib.sql.src.history.packlib.sql.src.history.pack.importChunkIndexPagePayload[method] — private source atlib/sql/src/history/pack.zig:128in nearest public ownerlib.sql.src.history.packlib.sql.src.history.pack.importDatabaseRootPayload[method] — private source atlib/sql/src/history/pack.zig:193in nearest public ownerlib.sql.src.history.packlib.sql.src.history.pack.importRowChunkPayload[method] — private source atlib/sql/src/history/pack.zig:86in nearest public ownerlib.sql.src.history.packlib.sql.src.history.pack.importTreeNodePayload[method] — private source atlib/sql/src/history/pack.zig:101in nearest public ownerlib.sql.src.history.packlib.sql.src.history.recover.applyFastForwardComplete[method] — private source atlib/sql/src/history/recover.zig:294in nearest public ownerlib.sql.src.history.recoverlib.sql.src.history.recover.applyFastForwardDecision[method] — private source atlib/sql/src/history/recover.zig:276in nearest public ownerlib.sql.src.history.recoverlib.sql.src.history.recover.applyFastForwardPrepare[method] — private source atlib/sql/src/history/recover.zig:256in nearest public ownerlib.sql.src.history.recoverlib.sql.src.history.refs.RecordScanner.next[method] — private source atlib/sql/src/history/refs.zig:475in nearest public ownertiny.sql.history.refslib.sql.src.history.refs.RepairState.metadataForHead[method] — private source atlib/sql/src/history/refs.zig:362in nearest public ownertiny.sql.history.refslib.sql.src.history.refs.RepairState.setRef[method] — private source atlib/sql/src/history/refs.zig:328in nearest public ownertiny.sql.history.refslib.sql.src.history.refs.applyFastForwardComplete[function] — private source atlib/sql/src/history/refs.zig:685in nearest public ownertiny.sql.history.refslib.sql.src.history.refs.applyFastForwardDecision[function] — private source atlib/sql/src/history/refs.zig:669in nearest public ownertiny.sql.history.refslib.sql.src.history.refs.applyFastForwardPrepare[function] — private source atlib/sql/src/history/refs.zig:649in nearest public ownertiny.sql.history.refslib.sql.src.history.refs.resolveHeads[function] — private source atlib/sql/src/history/refs.zig:706in nearest public ownertiny.sql.history.refslib.sql.src.history.refs.resolveRoots[function] — private source atlib/sql/src/history/refs.zig:749in nearest public ownertiny.sql.history.refslib.sql.src.history.refs.test_refs_advance_resolves_stale_suffix_and_pre-boundary_targets[function] — test source atlib/sql/src/history/refs.zig:871in nearest public ownertiny.sql.history.refstiny.sql.history.resolver.Resolver.read[method] atlib/sql/src/history/resolver.zig:231tiny.sql.history.resolver.Scanner.next[method] atlib/sql/src/history/resolver.zig:158lib.sql.src.history.resolver.test_history_resolver_keeps_the_first_typed_commit_location[function] — test source atlib/sql/src/history/resolver.zig:304in nearest public ownertiny.sql.history.resolverlib.sql.src.history.resolver.test_history_resolver_typed_keys_agree_with_replay_across_object_kinds[function] — test source atlib/sql/src/history/resolver.zig:364in nearest public ownertiny.sql.history.resolvertiny.sql.History.beginFastForward[method] atlib/sql/src/history/store.zig:590tiny.sql.History.chunkRowsInto[method] atlib/sql/src/history/store.zig:1062lib.sql.src.history.store.History.completeFastForward[method] — private source atlib/sql/src/history/store.zig:663in nearest public ownerlib.sql.src.history.storetiny.sql.History.conflictEntries[method] atlib/sql/src/history/store.zig:909tiny.sql.History.databaseValue[method] atlib/sql/src/history/store.zig:971lib.sql.src.history.store.History.decideFastForward[method] — private source atlib/sql/src/history/store.zig:641in nearest public ownerlib.sql.src.history.storetiny.sql.History.putRefIfMatches[method] atlib/sql/src/history/store.zig:578tiny.sql.History.validateConflictRoot[method] atlib/sql/src/history/store.zig:872lib.sql.src.history.store.expectSameTree[function] — private source atlib/sql/src/history/store.zig:2062in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_fast_forward_coordinator_fences_history_until_completion[function] — test source atlib/sql/src/history/store.zig:2683in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_fast_forward_poisons_an_ambiguous_preexisting_write_batch[function] — test source atlib/sql/src/history/store.zig:2733in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_creates_checkouts_and_advances_branches_durably[function] — test source atlib/sql/src/history/store.zig:3480in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_deletes_refs_durably[function] — test source atlib/sql/src/history/store.zig:3631in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_recovers_branch_commits_and_merge_commits[function] — test source atlib/sql/src/history/store.zig:3542in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_recovers_commits_refs_and_conflicts[function] — test source atlib/sql/src/history/store.zig:2404in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_recovers_database_roots_by_commit[function] — test source atlib/sql/src/history/store.zig:3012in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_recovers_relation_roots_by_hash[function] — test source atlib/sql/src/history/store.zig:3044in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_recovery_truncates_corrupt_tail[function] — test source atlib/sql/src/history/store.zig:3821in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_recovery_truncates_refs_with_missing_commits[function] — test source atlib/sql/src/history/store.zig:3604in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_refs_recover_the_latest_target[function] — test source atlib/sql/src/history/store.zig:3582in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_replays_committed_fast_forward_until_completion[function] — test source atlib/sql/src/history/store.zig:2825in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_replays_pending_fast_forward_through_abort_completion[function] — test source atlib/sql/src/history/store.zig:2773in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_row_topology_duplicates_keep_the_first_records[function] — test source atlib/sql/src/history/store.zig:3318in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_truncates_a_torn_fast_forward_decision_to_pending_prepare[function] — test source atlib/sql/src/history/store.zig:2872in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_updates_refs_only_when_expected_target_matches[function] — test source atlib/sql/src/history/store.zig:3516in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.test_history_write_batch_emits_one_write_and_one_sync[function] — test source atlib/sql/src/history/store.zig:2649in nearest public ownerlib.sql.src.history.storelib.sql.src.history.validate.Scanner.readPayload[method] — private source atlib/sql/src/history/validate.zig:137in nearest public ownerlib.sql.src.history.validatelib.sql.src.history.validate.Scanner.streamHash[method] — private source atlib/sql/src/history/validate.zig:175in nearest public ownerlib.sql.src.history.validatelib.sql.src.history.validate.Validation.fastForwardComplete[method] — private source atlib/sql/src/history/validate.zig:957in nearest public ownerlib.sql.src.history.validatelib.sql.src.history.validate.Validation.fastForwardDecision[method] — private source atlib/sql/src/history/validate.zig:937in nearest public ownerlib.sql.src.history.validatelib.sql.src.history.validate.Validation.fastForwardPrepare[method] — private source atlib/sql/src/history/validate.zig:916in nearest public ownerlib.sql.src.history.validatelib.sql.src.history.validate.sameKey[function] — private source atlib/sql/src/history/validate.zig:1443in nearest public ownerlib.sql.src.history.validatelib.sql.src.history.validate.sameNeedKey[function] — private source atlib/sql/src/history/validate.zig:1447in nearest public ownerlib.sql.src.history.validatelib.sql.src.history.verify.test_history_verification_reports_a_missing_dependency_without_writing[function] — test source atlib/sql/src/history/verify.zig:262in nearest public ownertiny.sql.history.verificationlib.sql.src.history.verify.verifyRecord[function] — private source atlib/sql/src/history/verify.zig:257in nearest public ownertiny.sql.history.verificationtiny.sql.LifecycleSparseReadSession.finish[method] atlib/sql/src/lifecycle.zig:398tiny.sql.lifecycle.open[function] atlib/sql/src/lifecycle.zig:495tiny.sql.lifecycle.openConnectionReadOnly[function] atlib/sql/src/lifecycle.zig:644lib.sql.src.lifecycle.openReadOnlyFromSnapshot[function] — private source atlib/sql/src/lifecycle.zig:701in nearest public ownertiny.sql.lifecyclelib.sql.src.lifecycle.test_lifecycle_deferred_history_upgrades_once_for_a_commit_and_refreshes_the_sidecar[function] — test source atlib/sql/src/lifecycle.zig:1787in nearest public ownertiny.sql.lifecyclelib.sql.src.lifecycle.test_lifecycle_read-only_open_owns_a_stable_maintained_snapshot[function] — test source atlib/sql/src/lifecycle.zig:1388in nearest public ownertiny.sql.lifecyclelib.sql.src.lifecycle.test_lifecycle_read_connection_derives_stale_refs_and_rejects_durable_writes[function] — test source atlib/sql/src/lifecycle.zig:1407in nearest public ownertiny.sql.lifecyclelib.sql.src.lifecycle.test_lifecycle_reopen_restores_a_committed_conflict_root[function] — test source atlib/sql/src/lifecycle.zig:1882in nearest public ownertiny.sql.lifecyclelib.sql.src.lifecycle.test_lifecycle_truncated_fast_forward_decision_repairs_the_accepted_prepare[function] — test source atlib/sql/src/lifecycle.zig:1819in nearest public ownertiny.sql.lifecycletiny.sql.DatabaseMerge.persistConflicts[method] atlib/sql/src/merge.zig:146lib.sql.src.merge.expectOptionalHash[function] — private source atlib/sql/src/merge.zig:1675in nearest public ownertiny.sql.mergetiny.sql.merge.mergeDatabase[function] atlib/sql/src/merge.zig:227lib.sql.src.merge.schemasAgree[function] — private source atlib/sql/src/merge.zig:640in nearest public ownertiny.sql.mergelib.sql.src.merge.test_database_merge_applies_clean_relation_edits_and_derives_root[function] — test source atlib/sql/src/merge.zig:1060in nearest public ownertiny.sql.mergelib.sql.src.merge.test_database_merge_contains_cross-schema_row_divergence[function] — test source atlib/sql/src/merge.zig:1563in nearest public ownertiny.sql.mergelib.sql.src.merge.test_database_merge_matches_relation_names_and_preserves_independent_relation_set_changes[function] — test source atlib/sql/src/merge.zig:1249in nearest public ownertiny.sql.mergelib.sql.src.merge.test_database_merge_preserves_a_theirs-only_index_schema[function] — test source atlib/sql/src/merge.zig:1510in nearest public ownertiny.sql.mergelib.sql.src.merge.test_database_merge_records_relation_topology_conflicts_under_database_root[function] — test source atlib/sql/src/merge.zig:1386in nearest public ownertiny.sql.mergelib.sql.src.merge.test_database_merge_supersedes_stale_slots_and_persists_complete_conflict_root[function] — test source atlib/sql/src/merge.zig:1151in nearest public ownertiny.sql.mergelib.sql.src.merge.test_relation_merge_records_divergent_same_row_conflicts[function] — test source atlib/sql/src/merge.zig:933in nearest public ownertiny.sql.mergelib.sql.src.merge.validateConflictArtifact[function] — private source atlib/sql/src/merge.zig:394in nearest public ownertiny.sql.mergelib.sql.src.merge.validateConflictSnapshot[function] — private source atlib/sql/src/merge.zig:377in nearest public ownertiny.sql.mergelib.sql.src.merge.wholeRelationMode[function] — private source atlib/sql/src/merge.zig:649in nearest public ownertiny.sql.mergetiny.sql.plan.PlanKey.same[function] atlib/sql/src/plan.zig:45lib.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_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_invalidates_by_stats_root_without_schema_change[function] — test source atlib/sql/src/plan.zig:799in nearest public ownertiny.sql.plantiny.sql.repository.Repository[function] atlib/sql/src/repository/flow.zig:7tiny.sql.DatabaseSession.advance[method] atlib/sql/src/session/database.zig:325lib.sql.src.session.database.DatabaseSession.checkStagedBase[method] — private source atlib/sql/src/session/database.zig:390in nearest public ownerlib.sql.src.session.databasetiny.sql.DatabaseSession.initWithRoot[function] atlib/sql/src/session/database.zig:71tiny.sql.DatabaseSession.pendingEditRowids[method] atlib/sql/src/session/database.zig:340lib.sql.src.session.database.DatabaseSession.stageRelation[method] — private source atlib/sql/src/session/database.zig:213in nearest public ownerlib.sql.src.session.databaselib.sql.src.session.database.StagedRelation.matchesCurrentRoot[method] — private source atlib/sql/src/session/database.zig:476in nearest public ownerlib.sql.src.session.databaselib.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_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_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.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_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_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_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.executetiny.sql.sync.HistoryRelation.upToDate[method] atlib/sql/src/sync.zig:57lib.sql.src.sync.PackBuilder.addConflictRoot[method] — private source atlib/sql/src/sync.zig:1074in nearest public ownertiny.sql.synclib.sql.src.sync.containsHash[function] — private source atlib/sql/src/sync.zig:1791in nearest public ownertiny.sql.synclib.sql.src.sync.decodePackSections[function] — private source atlib/sql/src/sync.zig:412in nearest public ownertiny.sql.synctiny.sql.sync.importBytes[function] atlib/sql/src/sync.zig:1236tiny.sql.sync.importObjects[function] atlib/sql/src/sync.zig:1210lib.sql.src.sync.test_sync_byte_packs_import_and_fetch_remote_refs[function] — test source atlib/sql/src/sync.zig:2218in nearest public ownertiny.sql.synclib.sql.src.sync.test_sync_clone_copies_committed_conflict_roots[function] — test source atlib/sql/src/sync.zig:2414in nearest public ownertiny.sql.synclib.sql.src.sync.test_sync_clone_copies_reachable_history_and_refs[function] — test source atlib/sql/src/sync.zig:1862in nearest public ownertiny.sql.synclib.sql.src.sync.test_sync_fetch_and_push_transfer_only_missing_objects[function] — test source atlib/sql/src/sync.zig:2106in nearest public ownertiny.sql.synclib.sql.src.sync.test_sync_fetch_writes_remote_tracking_refs[function] — test source atlib/sql/src/sync.zig:2058in nearest public ownertiny.sql.synclib.sql.src.sync.test_sync_file_remotes_clone_fetch_push_and_pull_refs[function] — test source atlib/sql/src/sync.zig:2554in nearest public ownertiny.sql.synclib.sql.src.sync.test_sync_history_planning_reports_relation_and_missing_pack_counts[function] — test source atlib/sql/src/sync.zig:1899in nearest public ownertiny.sql.synclib.sql.src.sync.test_sync_negotiated_fetch_advertises_refs_and_returns_requested_missing_pack[function] — test source atlib/sql/src/sync.zig:2156in nearest public ownertiny.sql.synclib.sql.src.sync.test_sync_push_fast_forwards_remote_refs_and_rejects_divergence[function] — test source atlib/sql/src/sync.zig:2499in nearest public ownertiny.sql.synclib.sql.src.sync.test_sync_record_packs_re-export_from_imported_stores[function] — test source atlib/sql/src/sync.zig:2020in nearest public ownertiny.sql.synctiny.sql.ConflictEntry.eql[function] atlib/sql/src/version.zig:199tiny.sql.WorkingSet.dirty[method] atlib/sql/src/version.zig:484tiny.sql.WorkingSet.hasStaged[method] atlib/sql/src/version.zig:488lib.sql.src.version.expectKeyMatchesRoot[function] — private source atlib/sql/src/version.zig:2085in nearest public ownertiny.sql.versionlib.sql.src.version.test_commit_hash_depends_on_root_and_parents[function] — test source atlib/sql/src/version.zig:1690in nearest public ownertiny.sql.versionlib.sql.src.version.test_conflict_artifact_hash_distinguishes_row_and_relation_values[function] — test source atlib/sql/src/version.zig:1517in nearest public ownertiny.sql.versionlib.sql.src.version.test_conflict_root_sorted_hash_is_independent_of_artifact_order[function] — test source atlib/sql/src/version.zig:1550in nearest public ownertiny.sql.versionlib.sql.src.version.test_database_root_from_catalog_tracks_all_relation_roots[function] — test source atlib/sql/src/version.zig:1760in nearest public ownertiny.sql.versionlib.sql.src.version.test_database_root_hash_depends_on_conflict_root[function] — test source atlib/sql/src/version.zig:1506in nearest public ownertiny.sql.versionlib.sql.src.version.test_database_root_hash_depends_on_relation_root_hashes_and_names[function] — test source atlib/sql/src/version.zig:1462in nearest public ownertiny.sql.versionlib.sql.src.version.test_database_root_sorted_hash_is_independent_of_relation_entry_order[function] — test source atlib/sql/src/version.zig:1486in nearest public ownertiny.sql.versionlib.sql.src.version.test_database_value_accepts_replacement_relation_values[function] — test source atlib/sql/src/version.zig:1803in nearest public ownertiny.sql.versionlib.sql.src.version.test_index_stats_hash_ignores_physical_root_and_shape[function] — test source atlib/sql/src/version.zig:1621in nearest public ownertiny.sql.versionlib.sql.src.version.test_relation_root_from_materialized_rows_matches_live_logical_maps[function] — test source atlib/sql/src/version.zig:1899in nearest public ownertiny.sql.versionlib.sql.src.version.test_relation_root_hash_is_stable_across_reopen_and_changes_after_row_write[function] — test source atlib/sql/src/version.zig:1968in nearest public ownertiny.sql.versionlib.sql.src.version.test_relation_root_ignores_unrelated_catalog_schema_version_bumps[function] — test source atlib/sql/src/version.zig:1727in nearest public ownertiny.sql.versionlib.sql.src.version.test_relation_stats_hash_ignores_physical_table_shape[function] — test source atlib/sql/src/version.zig:1560in nearest public ownertiny.sql.versionlib.sql.src.version.test_schema_hash_includes_index_descriptor_names[function] — test source atlib/sql/src/version.zig:1532in nearest public ownertiny.sql.versionlib.sql.src.version.test_working_set_tracks_explicit_base_working_and_staged_roots[function] — test source atlib/sql/src/version.zig:1702in nearest public ownertiny.sql.version
Complete caller list for version.schemaHash
8 direct callers.
lib.sql.src.history.store.testingMerkleRelationRoot[function] — private source atlib/sql/src/history/store.zig:2033in nearest public ownerlib.sql.src.history.storelib.sql.src.history.store.testingRelationRoot[function] — private source atlib/sql/src/history/store.zig:1820in nearest public ownerlib.sql.src.history.storelib.sql.src.plan.shapeKey[function] — private source atlib/sql/src/plan.zig:62in nearest public ownertiny.sql.plantiny.sql.version.relationKey[function] atlib/sql/src/version.zig:653tiny.sql.version.relationRoot[function] atlib/sql/src/version.zig:502lib.sql.src.version.relationRootFromRowsWithOptionalStats[function] — private source atlib/sql/src/version.zig:779in nearest public ownertiny.sql.versionlib.sql.src.version.relationRootMaintainedFrom[function] — private source atlib/sql/src/version.zig:581in nearest public ownertiny.sql.versionlib.sql.src.version.test_schema_hash_includes_index_descriptor_names[function] — test source atlib/sql/src/version.zig:1532in nearest public ownertiny.sql.version
Audit
| Definitions | 28 |
|---|---|
| Public names | 28 |
| Members | 8 |
| Version | 26.7.0 |
| Revision | daab053ee433 |