import { Alias } from "./Alias"; import { BaseNode, Keyword } from "./Base"; import { DataType } from "./DataType"; import { EntityName, Expr, ListExpr, ParenExpr } from "./Expr"; import { AsClause, IntoVariablesClause } from "./OtherClauses"; import { Statement } from "./Statement"; export type AllPreparedStatementNodes = AllPreparedStatements | PrepareFromClause | DeallocateAll | ExecuteUsingClause | ExecuteExpr; export type AllPreparedStatements = PrepareStmt | DeallocateStmt | ExecuteStmt | ExecuteImmediateStmt; export interface PrepareStmt extends BaseNode { type: "prepare_stmt"; prepareKw: Keyword<"PREPARE">; name: EntityName; params?: ParenExpr>; source: PrepareFromClause | AsClause; } export interface PrepareFromClause extends BaseNode { type: "prepare_from_clause"; fromKw: Keyword<"FROM">; expr: Expr; } export interface DeallocateStmt extends BaseNode { type: "deallocate_stmt"; deallocateKw: Keyword<"DEALLOCATE"> | [Keyword<"DEALLOCATE">, Keyword<"PREPARE">] | [Keyword<"DROP">, Keyword<"PREPARE">]; name: EntityName | DeallocateAll; } export interface DeallocateAll extends BaseNode { type: "deallocate_all"; allKw: Keyword<"ALL">; } export interface ExecuteStmt extends BaseNode { type: "execute_stmt"; executeKw: Keyword<"EXECUTE">; name: EntityName; args?: ExecuteUsingClause | ParenExpr>; } export interface ExecuteImmediateStmt extends BaseNode { type: "execute_immediate_stmt"; executeKw: Keyword<"EXECUTE">; immediateKw?: Keyword<"IMMEDIATE">; expr: Expr; into?: IntoVariablesClause; using?: ExecuteUsingClause; } export interface ExecuteUsingClause extends BaseNode { type: "execute_using_clause"; usingKw: Keyword<"USING">; values: ListExpr>; } export interface ExecuteExpr extends BaseNode { type: "execute_expr"; executeKw: Keyword<"EXECUTE">; expr: Expr; using?: ExecuteUsingClause; }