How many insert queries in repeated function call #754
Replies: 2 comments 2 replies
-
i have almost the same problem with updating querires const result = await sql`
update activity set ${sql(updateFields, columns)}
where id = ${id} and uid = ${uid}
`; result.count
Property 'count' does not exist on type 'object'. its very hard to get how many rows were updated. For example in pgAdmin at every operation it says that it insert\update\delete n rows. The same problem acording delete operation. |
Beta Was this translation helpful? Give feedback.
-
Hey @elhananjair .. Sorry, never saw this post until @K4leri reply, but curious if you found your way through? There is no limit really, and I wouldn't say you should need optimization unless you start to see performance issues. I think you're simply dealing with a race condition between the time it takes for the query to run and the time you update your counter :) |
Beta Was this translation helpful? Give feedback.
-
Hello friends,
I am still testing postgresjs and it is so easy to work with thanks again @porsager.
The problem I am facing currently is, I am not sure if my insert query is really inserting all data that have been sent to the function I am doing insert with.
I have a function saveNum which saves/insert new phone number to database, and just for testing purpose I created counter variable to check if the counter and data from database is equal. But, unfortunately they are not. My question is, does PostgreSQL limits insert queries execute in certain amount of time? I am curious because I am inserting the data instantly as the process received external data which sometimes might be 1000 data per second that arrives from external server.
Therefore should I save such thing into array and run insert query in some time interval? or is there any tip for that? Here is the code I am working with [Implementing SMPP protocol]
I checked a database and deliveryCounter value and there is some difference.
Beta Was this translation helpful? Give feedback.
All reactions