question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Array support for insert and update

See original GitHub issue

I’m using linq2db in one client/server project where the MS SQL Server DB is on cloud and winform app is desktop pc. Several scenario involves updating or inserting 1000-10000 rows in tables. As turnaround times between server/application makes the processing time long (works really fast with local db). I might have missed something really basic, but I can’t find a good way to batch together many insert or update operations onto a batch and send them to DB at once. That way, I get rid of turn around times. Example what I see would work for me:

List<Order> orderList = GetOrderListToInsert();
db.Insert(orderList);
orderList = GetOrderListToUpdate();
db.Update(orderList);

I have done some work in creating text SQL statements and sending them over to DB and that works with good performance. Drawback is to create all the code for update/insert…

Please note that I’m a relative new user to linq2db and still learning how to do things. I might not use the linq2db in the correct way.

Thanks for sharing such a cool project as linq2db!

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
MaceWinducommented, Nov 26, 2020

image

1reaction
MaceWinducommented, Oct 27, 2015

For updates there are multiple options available:

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Update an object in array or insert into the ...
Yes i had thought about that. But I was trying to explore a single query option. There was $addToSet but for updating or...
Read more >
How to Modify Arrays in PostgreSQL
The most basic way to modify an array column are to overwrite all values by assigning it a new array, or to specify...
Read more >
How to INSERT or UPDATE data with array fields using ...
1. To insert a record with NONE of the 5 elements of the array specified: INSERT INTO pub.State ("State", "State-Name", "Region") · 2....
Read more >
Enabling array update and upsert operations for an Oracle ...
When you configure an array update or upsert, the Secure Agent clubs all records together into arrays and writes those arrays of data...
Read more >
Design a data structure that supports insert, delete, search ...
The idea is to use a resizable array (ArrayList in Java, vector in C) together with hashing. Resizable arrays support insert in ?(1)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found