rawsql-ts
Version:
[beta]High-performance SQL parser and AST analyzer written in TypeScript. Provides fast parsing and advanced transformation capabilities.
64 lines (63 loc) • 2.4 kB
TypeScript
import { SqlComponent } from "./SqlComponent";
import { IdentifierString, ValueList, ValueComponent } from "./ValueComponent";
import { SetClause, SetClauseItem, SourceExpression, WhereClause, WithClause } from "./Clause";
export type MergeMatchType = "matched" | "not_matched" | "not_matched_by_source" | "not_matched_by_target";
export declare abstract class MergeAction extends SqlComponent {
static kind: symbol;
}
export declare class MergeUpdateAction extends MergeAction {
static kind: symbol;
setClause: SetClause;
whereClause: WhereClause | null;
constructor(setClause: SetClause | SetClauseItem[], whereClause?: WhereClause | null);
}
export declare class MergeDeleteAction extends MergeAction {
static kind: symbol;
whereClause: WhereClause | null;
constructor(whereClause?: WhereClause | null);
}
export declare class MergeInsertAction extends MergeAction {
static kind: symbol;
columns: IdentifierString[] | null;
values: ValueList | null;
defaultValues: boolean;
private valuesLeadingComments;
constructor(params: {
columns?: (IdentifierString | string)[] | null;
values?: ValueList | null;
defaultValues?: boolean;
valuesLeadingComments?: string[] | null;
});
addValuesLeadingComments(comments: string[]): void;
getValuesLeadingComments(): string[];
}
export declare class MergeDoNothingAction extends MergeAction {
static kind: symbol;
}
export declare class MergeWhenClause extends SqlComponent {
static kind: symbol;
matchType: MergeMatchType;
condition: ValueComponent | null;
action: MergeAction;
private thenLeadingComments;
constructor(matchType: MergeMatchType, action: MergeAction, condition?: ValueComponent | null, options?: {
thenLeadingComments?: string[] | null;
});
addThenLeadingComments(comments: string[]): void;
getThenLeadingComments(): string[];
}
export declare class MergeQuery extends SqlComponent {
static kind: symbol;
withClause: WithClause | null;
target: SourceExpression;
source: SourceExpression;
onCondition: ValueComponent;
whenClauses: MergeWhenClause[];
constructor(params: {
withClause?: WithClause | null;
target: SourceExpression;
source: SourceExpression;
onCondition: ValueComponent;
whenClauses: MergeWhenClause[];
});
}