Comments (3)
How would we feel about reversing the order?
insert(record).into(table)
It feels more consistent to me with update
and delete
, which both seem to follow the pattern of
action(record).action_specific(parameter)
So we would be left with the API
insert(record).into(table)
update(record).set(changes)
delete(record)
from diesel.
Would it though?
update(users.filter(id.eq(1))).set(user_changes)
delete(users.filter(id.eq(1))
insert_into(users).values(new_user)
vs
update(users.filter(id.eq(1))).set(user_changes)
delete(users.filter(id.eq(1))
insert(new_user).into(users)
there's also the third option (not mutually exclusive)
new_user.insert_into(users)
from diesel.
I do want to end up supporting update(record)
and delete(record)
as sugar for filtering on the PK though, so there's merit to insert.into
. It also reads more naturally.
from diesel.
Related Issues (20)
- Documentation: Improve documentation for upsert `.filter_target()` HOT 2
- splitting into multiple schema.rs HOT 1
- Interaction between `#[derive(AsChangeset)]` and macro in type position HOT 2
- SQLite + PRAGMA foreign_keys = ON => missing error HOT 9
- `.distinct_on` is limited to maximum three `.order_by`s HOT 2
- Runtime Error for count() with order_by clause combined HOT 5
- fix: `sql_query` error "`Untyped: CompatibleType<std::string::String, Pg>` is not satisfied" HOT 1
- Impossible to combine into_boxed and group_by
- Impossible to combine into_boxed and group_by
- Failed to save array of enums HOT 3
- Nullable<diesel::sqlite::sql_types::Timestamptz> throws trait not implement errors
- Segmentation Fault in R2D2 postgres (interrupted by signal 11: SIGSEGV) HOT 10
- `joinable!` is not generated for two foreign keys referencing the same table HOT 1
- Diesel-cli Can't connect to local MySQL server through socket '/tmp/mysql.sock' HOT 1
- Deserialization layer seems too permissive with regards to checking the actual types received HOT 1
- Can't use `into_boxed` after union HOT 1
- table have more than one primary_key can not use on_conflict(diesel::dsl::DuplicatedKeys) HOT 7
- No intellisense when using query dsl HOT 6
- `overflow evaluating the requirement` when writing generic diesel code HOT 1
- Pagination guide doesn't work on entity represented by joined tables 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 diesel.