[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", []);
|
this.methodCalls.set("Delete", []);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
Insert(data: Record<string, unknown>): Builder<I> {
|
Insert(...data: Record<string, unknown>[]): Builder<I> {
|
||||||
this.methodCalls.set("Insert", [data]);
|
this.methodCalls.set("Insert", data);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
Set(data: Record<string, unknown>): Builder<I> {
|
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", []);
|
this.methodCalls.set("DoNothing", []);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
Tx(): Builder<I> {
|
||||||
|
this.methodCalls.set("Tx", []);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
async *Rows<T = InstanceType<I>>(): AsyncGenerator<T> {
|
async *Rows<T = InstanceType<I>>(): AsyncGenerator<T> {
|
||||||
this.formatRequest();
|
this.formatRequest();
|
||||||
const response = await fetch(this.url, {
|
const response = await fetch(this.url, {
|
||||||
|
|
|
@ -12,7 +12,7 @@ export interface Request {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const METHODS =
|
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