Comments (2)
Thanks for the great feedback and advice! I'm definitely going to implement this, but it will take some time because I'll be on vacation so don't expect anything in the next week 😅
from jennifer.cr.
Hi, yeah it looks that such a method may be helpful 👍.
I think that we could start with Model::Base.upsert(collection : Array(Model::Base), unique_fields : Array = [] of String)
. From my perspective it shouldn't invoke any callback/validation same way as .import
does (SQL request only). As an addition I think about QueryBuilder::Executables#upsert(collection : Array(Hash(String, DBAny)), unique_fields : Array = [] of String)
.
Tip: Model::Base.arguments_to_insert
likely will be useful for you. Feel free to push MR and ask any question/help
P.S.: you can use Order.all
instead of Jennifer::Query["orders"]
from jennifer.cr.
Related Issues (20)
- Initializing empty records with `Model.new` or `Model.build` HOT 3
- Exception: In PG::ResultSet#read error HOT 3
- UInt32 mysql column error HOT 2
- Question about generators and authentication HOT 2
- Warning: positional parameter 'pull' HOT 2
- Jennifer i18n conflict with amber 1.5 HOT 3
- feature request: EdgeDB support HOT 4
- Generator support for jsonb type in postgres
- JSON columns with array values being updated is not recognized as "changed" & does not save HOT 3
- Password digest not created when using with_authentication directly via model build HOT 2
- Shard "inflector" version (0.1.8) doesn't match tag version (1.0.0)
- Empty seed task HOT 1
- Executing raw SQL directly through the connection HOT 5
- Feature parity/comparison for ActiveRecord enum types HOT 10
- `load_dependencies "jennifer"` issue with Jennifer::QueryBuilder::Condition error HOT 4
- Slow performance when creating new records HOT 7
- PCRE2 compatibility HOT 1
- How i run a migrate without using sam? HOT 3
- How to configure database connection? HOT 3
- Column can't be casted from JSON::PullParser to it's type - (JSON::Any | Nil) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jennifer.cr.