tiny.sql.RelationSchema
Defined in version.
API (6)
Actions
Public operations.
Fields and members
Public fields and members.
Source
Source: lib/sql/src/version.zig:51
zig
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); }};Source: lib/sql/src/root.zig:280
zig
pub const RelationSchema = version.RelationSchema;Audit
| Definitions | 4 |
|---|---|
| Public names | 8 |
| Members | 3 |
| Version | 26.7.0 |
| Revision | daab053ee433 |