jeremydaly / data-api-client

A "DocumentClient" for the Amazon Aurora Serverless Data API
MIT License
444 stars 63 forks source link

batch insert gives error #86

Open rabiSharelookapp opened 3 years ago

rabiSharelookapp commented 3 years ago

while query is done for batchInsert it insert the multiple row but throws an error "BadRequestException:Batch entry 1 was aborted: Too many update results were returned. Call getNextException to see othe errors in the batch". though the items passed as same structure as in document . Here 1 is number of entry Screenshot from 2021-04-01 11-16-36

jeremydaly commented 3 years ago

This looks like a Postgres error. Are you able to run a smaller batch?

rabiSharelookapp commented 3 years ago

I could run a small batch with 3 or might be more but it does insertion on table but throws that error even batch with length 1 .

On Fri, Apr 2, 2021 at 12:55 AM Jeremy Daly @.***> wrote:

This looks like a Postgres error. Are you able to run a smaller batch?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jeremydaly/data-api-client/issues/86#issuecomment-812113417, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS762I2CRSUCR4YSCV6Z6RDTGTAIZANCNFSM42GLEZ3A .

rabiSharelookapp commented 3 years ago

what would be the solution for this @jeremydaly

jeremydaly commented 3 years ago

@ffxsam Any thoughts on this? Haven't seen this error with batches before.

rabiSharelookapp commented 3 years ago

@jeremydaly today I got another situation that if table not exist then batch insertion execution is only done for 1 batch more than one it gives error but after 1 batch entry or table exist then more than 1 batch be inserted.Is this from my side or the issue (I have used create table if not exist query to create table and followed by insert script)

ffxsam commented 3 years ago

No, sorry I can't be of any help. I actually don't use batch inserts very often. Plus, I'm using knex to build all my queries before passing the resulting string to dataApi.query().

rabiSharelookapp commented 3 years ago

@Sam , could you suggest a library for knex that is compatible with data-api. I tried to do with knex.js only but couldn't connect using aws arn

On Sun, Apr 4, 2021 at 5:24 AM Sam Hulick @.***> wrote:

No, sorry I can't be of any help. I actually don't use batch inserts very often. Plus, I'm using knex to build all my queries before passing the resulting string to dataApi.query().

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jeremydaly/data-api-client/issues/86#issuecomment-812941393, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS762IZ4O5FFPFWWUGCD4J3TG6RKFANCNFSM42GLEZ3A .

rabiSharelookapp commented 3 years ago

And also use case here is that need to perform migration , could you please suggest how to I perform that trough data-api-client

On Mon, Jun 7, 2021 at 1:29 PM Rabi Gautam @.***> wrote:

@Sam , could you suggest a library for knex that is compatible with data-api. I tried to do with knex.js only but couldn't connect using aws arn

On Sun, Apr 4, 2021 at 5:24 AM Sam Hulick @.***> wrote:

No, sorry I can't be of any help. I actually don't use batch inserts very often. Plus, I'm using knex to build all my queries before passing the resulting string to dataApi.query().

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jeremydaly/data-api-client/issues/86#issuecomment-812941393, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS762IZ4O5FFPFWWUGCD4J3TG6RKFANCNFSM42GLEZ3A .

ffxsam commented 3 years ago

@rabiSharelookapp knex works fine with dataApi. You can use it like this:

const knex = require('knex')({ client: 'pg' });

async function doTheThing() {
  const results = await dataApi.query(knex('my_table').select('a', 'b', 'c'));
}

As for your other question, that's a bit of a general and very involved question that I unfortunately don't have time to help with.

rabiSharelookapp commented 3 years ago

okay thanks

On Mon, Jun 7, 2021 at 9:07 PM Sam Hulick @.***> wrote:

@rabiSharelookapp https://github.com/rabiSharelookapp knex works fine with dataApi. You can use it like this:

const knex = require('knex')({ client: 'pg' }); async function doTheThing() { const results = await dataApi.query(knex('my_table').select('a', 'b', 'c'));}

As for your other question, that's a bit of a general and very involved question that I unfortunately don't have time to help with.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jeremydaly/data-api-client/issues/86#issuecomment-856030010, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS762I3BWQH5E4NXM4VIMW3TRTP3HANCNFSM42GLEZ3A .