[fix] add tx method for client; [todo] add exec on client
This commit is contained in:
parent
9d13824fdf
commit
6670c1f55a
|
@ -113,8 +113,8 @@ export default class Builder<I extends abstract new (...args: any) => any> {
|
|||
this.methodCalls.set("Delete", []);
|
||||
return this;
|
||||
}
|
||||
Insert(data: Record<string, unknown>): Builder<I> {
|
||||
this.methodCalls.set("Insert", [data]);
|
||||
Insert(...data: Record<string, unknown>[]): Builder<I> {
|
||||
this.methodCalls.set("Insert", data);
|
||||
return this;
|
||||
}
|
||||
Set(data: Record<string, unknown>): Builder<I> {
|
||||
|
@ -139,6 +139,10 @@ export default class Builder<I extends abstract new (...args: any) => any> {
|
|||
this.methodCalls.set("DoNothing", []);
|
||||
return this;
|
||||
}
|
||||
Tx(): Builder<I> {
|
||||
this.methodCalls.set("Tx", []);
|
||||
return this;
|
||||
}
|
||||
async *Rows<T = InstanceType<I>>(): AsyncGenerator<T> {
|
||||
this.formatRequest();
|
||||
const response = await fetch(this.url, {
|
||||
|
|
|
@ -12,7 +12,7 @@ export interface Request {
|
|||
}
|
||||
|
||||
export const METHODS =
|
||||
"In|Find|Select|Fields|Join|Group|Sort|Limit|Offset|Delete|Insert|Set|Update|OnConflict|DoUpdate|DoNothing".split(
|
||||
"In|Find|Select|Fields|Join|Group|Sort|Limit|Offset|Delete|Insert|Set|Update|OnConflict|DoUpdate|DoNothing|Tx".split(
|
||||
"|",
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue