Skip to documentation
SLOP

tiny.sql.RowIdTable

Reference tiny.sql RowIdTable

Defined in table.

API (18)

Actions

Public operations.

Fields and members

Public fields and members.

No direct callersNo direct callstableTable
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/sql/src/table.zig:267

zig
pub const Table = struct {    rows: tree.Tree,    pub fn open(database: *file.Database, options: Options) Error!Table {        return .{ .rows = try tree.Tree.open(database, options.tree) };    }    pub fn reader(self: *const Table, snapshot: file.Snapshot) Error!Reader {        return .{ .rows = try self.rows.reader(snapshot) };    }    pub fn lastRowId(self: *const Table) Error!?i64 {        var read = try self.rows.database.beginRead();        defer read.deinit();        const opened = try self.reader(read.snapshot());        return try opened.lastRowId();    }    pub fn put(self: *Table, rowid: i64, values: []const row.Value, options: file.CommitOptions) Error!file.Commit {        const phase = trace.scope("table.put");        defer phase.end();        var write = try tree.Write.beginTree(&self.rows);        defer write.deinit();        try self.putIn(&write, rowid, values);        return try write.commit(options);    }    pub fn putIn(self: *Table, write: *tree.Write, rowid: i64, values: []const row.Value) Error!void {        var key_bytes: [key.rowid_size]u8 = undefined;        var row_bytes: [page.size]u8 = undefined;        const encoded_key = try key.encodeRowId(&key_bytes, rowid);        const encoded_row = try row.encode(&row_bytes, values);        try write.put(&self.rows, encoded_key, encoded_row);    }    pub fn putEncoded(self: *Table, rowid: i64, bytes: []const u8, options: file.CommitOptions) Error!file.Commit {        const phase = trace.scope("table.put_encoded");        defer phase.end();        var write = try tree.Write.beginTree(&self.rows);        defer write.deinit();        try self.putEncodedIn(&write, rowid, bytes);        return try write.commit(options);    }    pub fn putEncodedIn(self: *Table, write: *tree.Write, rowid: i64, bytes: []const u8) Error!void {        _ = try row.View.init(bytes);        var key_bytes: [key.rowid_size]u8 = undefined;        try write.put(&self.rows, try key.encodeRowId(&key_bytes, rowid), bytes);    }    pub fn get(self: *const Table, allocator: Allocator, rowid: i64) Error!?[]u8 {        var read = try self.rows.database.beginRead();        defer read.deinit();        const opened = try self.reader(read.snapshot());        return try opened.get(allocator, rowid);    }    pub fn valueLength(self: *const Table, rowid: i64) Error!?usize {        var read = try self.rows.database.beginRead();        defer read.deinit();        const opened = try self.reader(read.snapshot());        return try opened.valueLength(rowid);    }    pub fn getInto(self: *const Table, rowid: i64, target: []u8) Error!?[]u8 {        var read = try self.rows.database.beginRead();        defer read.deinit();        const opened = try self.reader(read.snapshot());        return try opened.getInto(rowid, target);    }    pub fn delete(self: *Table, rowid: i64, options: file.CommitOptions) Error!file.Commit {        const phase = trace.scope("table.delete");        defer phase.end();        var write = try tree.Write.beginTree(&self.rows);        defer write.deinit();        try self.deleteIn(&write, rowid);        return try write.commit(options);    }    pub fn deleteIn(self: *Table, write: *tree.Write, rowid: i64) Error!void {        var key_bytes: [key.rowid_size]u8 = undefined;        try write.delete(&self.rows, try key.encodeRowId(&key_bytes, rowid));    }    /// Starts a scan of the rows from `start` up to `end` in `target`.    pub fn scan(        self: *const Table,        target: *Scan,        allocator: Allocator,        start: ?i64,        end: ?i64,    ) Error!void {        try self.scanProjected(target, allocator, start, end, .value);    }    pub fn scanProjected(        self: *const Table,        target: *Scan,        allocator: Allocator,        start: ?i64,        end: ?i64,        projection: Projection,    ) Error!void {        var read = try self.rows.database.beginRead();        defer read.deinit();        const opened = try self.reader(read.snapshot());        try opened.scanProjected(target, allocator, start, end, projection);    }    pub fn summarize(self: *const Table) Error!tree.Summary {        var read = try self.rows.database.beginRead();        defer read.deinit();        const opened = try self.reader(read.snapshot());        return try opened.summarize();    }    pub fn count(self: *const Table) Error!usize {        var read = try self.rows.database.beginRead();        defer read.deinit();        const opened = try self.reader(read.snapshot());        return try opened.count();    }    pub fn summarizeIn(self: *const Table, write: *const tree.Write) Error!tree.Summary {        const phase = trace.scope("table.summarize_in");        defer phase.end();        return try self.rows.summarizeIn(write);    }};

Source: lib/sql/src/root.zig:224

zig
pub const RowIdTable = table.Table;
Called byCallsNo direct callersRowIdTablereaderRowIdTablecount
Static calls · unresolved targets: 0 · external targets: 4.
Called byCallsNo direct callersRowIdTabledeleteInTreeWritebeginTreeRowIdTabledelete
Static calls · unresolved targets: 0 · external targets: 4.
Called byCallscatalog.MaterializationclearRelationStatscatalog.MaterializationdropRelationRowIdTabledeletekeyencodeRowIdRowIdTabledeleteIn
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callersRowIdTablereaderRowIdTableget
Static calls · unresolved targets: 1 · external targets: 3.
Called byCallsNo direct callersRowIdTablereaderRowIdTablegetInto
Static calls · unresolved targets: 0 · external targets: 4.
Called byCallsNo direct callersRowIdTablereaderRowIdTablelastRowId
Static calls · unresolved targets: 0 · external targets: 4.
Called byCallsCatalogopenSpacerowidTabletest sourcelib.sql.src.tabletest: rowid table deletes and recover...test sourcelib.sql.src.tabletest: rowid table key projection avoi...test sourcelib.sql.src.tabletest: rowid table reports the last as...+3 moreTreeopenRowIdTableopen
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersRowIdTableputInTreeWritebeginTreeRowIdTableput
Static calls · unresolved targets: 0 · external targets: 4.
Called byCallsNo direct callersRowIdTableputEncodedInTreeWritebeginTreeRowIdTableputEncoded
Static calls · unresolved targets: 0 · external targets: 4.
Called byCallsRowIdTableputEncodedkeyencodeRowIdRowViewinitRowIdTableputEncodedIn
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsRowIdTableputkeyencodeRowIdrowencodeRowIdTableputIn
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsRowIdTablecountRowIdTablegetRowIdTablegetIntoRowIdTablelastRowIdRowIdTablescanProjected+2 moreTreereaderRowIdTablereader
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsCataloganalyzeRelationCatalogbeginMaterializationCatalogclearRelationStatsCatalogcreateIndexCatalogcreateRelationCatalogdropRelationRowIdTablescanProjectedRowIdTablescan
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsRowIdTablescanRowIdTablereaderRowIdTablescanProjected
Static calls · unresolved targets: 0 · external targets: 4.
Called byCallsNo direct callersRowIdTablereaderRowIdTablesummarize
Static calls · unresolved targets: 0 · external targets: 4.
Called byCallsNo direct callersTreesummarizeInRowIdTablesummarizeIn
Static calls · unresolved targets: 0 · external targets: 2.
Called byCallsNo direct callersRowIdTablereaderRowIdTablevalueLength
Static calls · unresolved targets: 0 · external targets: 4.

Complete caller list for RowIdTable.open

8 direct callers.

Complete caller list for RowIdTable.reader

7 direct callers.

Audit

Definitions18
Public names36
Members1
Version26.7.0
Revisiondaab053ee433