You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
consttable=cli.tableConnector<TestEntity>('prest.public.test')table.batch(data)// or table.batch<TestEntityInput>(data)table.batch([data])// should work too
Approach
We need to change the behavior of Api.call to be able to receive adapt new parameters. Something like:
Feel free to think in a better approach
typeRequestOpts<Input>={data?: Input;query?: string;}publiccall<T>(method: Method,path: string,opts: RequestOpts): Promise<T>{constaxiosFn=axios[method];consturi=this.baseUrl+path+opts.query;constdataGetter=(promise)=>promise.then(({ data })=>data);if(['put','post','patch'].indexOf(method)){returndataGetter(axiosFn(uri,opts.data));}returndataGetter(axiosFn(uri));}
After doing that, we need to add a .batch method inside TableConnector:
Motivation
We have a batch endpoint inside pRest (https://docs.postgres.rest/batch-operations/), but we don’t have an client method the reflect it yet.
Interface Sample
Approach
We need to change the behavior of Api.call to be able to receive adapt new parameters. Something like:
Feel free to think in a better approach
After doing that, we need to add a
.batch
method inside TableConnector:The text was updated successfully, but these errors were encountered: