Skip to documentation
SLOP

tiny.sql.Statement

Reference tiny.sql Statement

Defined in tiny.sql.

API (10)

Actions

Public operations.

Fields and members

Public fields and members.

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

Source

Source: lib/sql/src/statement/ast.zig:145

zig
pub const Statement = union(enum) {    insert: Insert,    select: Select,    update: Update,    delete: Delete,    create_table: CreateTable,    create_index: CreateIndex,    drop_table: DropTable,    analyze: Analyze,    pub fn deinit(self: *Statement, allocator: Allocator) void {        switch (self.*) {            .insert => |insert| {                if (insert.columns) |columns| allocator.free(columns);                allocator.free(insert.values);            },            .select => |select| {                switch (select.projection) {                    .all => {},                    .columns => |columns| allocator.free(columns),                }                allocator.free(select.predicates);                allocator.free(select.order);            },            .update => |update| {                allocator.free(update.assignments);                allocator.free(update.predicates);            },            .delete => |delete| allocator.free(delete.predicates),            .create_table => |create_table| {                for (create_table.indexes) |index| allocator.free(@constCast(index.fields));                allocator.free(create_table.indexes);                allocator.free(create_table.columns);            },            .create_index => |create_index| allocator.free(create_index.columns),            .drop_table => {},            .analyze => {},        }        self.* = undefined;    }    pub fn tableName(self: Statement) []const u8 {        return switch (self) {            .insert => |insert| insert.table,            .select => |select| select.table,            .update => |update| update.table,            .delete => |delete| delete.table,            .create_table => |create_table| create_table.table,            .create_index => |create_index| create_index.table,            .drop_table => |drop_table| drop_table.table,            .analyze => |analyze| analyze.table,        };    }};

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

zig
pub const Statement = statement.Statement;
Called byCallsNo direct callsstatement.ParseddeinitStatementdeinit
Static calls · unresolved targets: 0 · external targets: 1.

Also reachable as

statement.Statement.

Audit

Definitions3
Public names6
Members8
Version26.7.0
Revisiondaab053ee433