Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up`insert` is inconsistent, and should be changed to match other operations #30
Comments
sgrif
added
enhancement
discussion desired
labels
Nov 29, 2015
sgrif
added this to the 0.2 milestone
Nov 29, 2015
sgrif
added
the
breaking change
label
Nov 29, 2015
added a commit
that referenced
this issue
Nov 29, 2015
This comment has been minimized.
|
How would we feel about reversing the order? insert(record).into(table)It feels more consistent to me with action(record).action_specific(parameter)So we would be left with the API insert(record).into(table)
update(record).set(changes)
delete(record) |
This comment has been minimized.
|
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) |
This comment has been minimized.
|
I do want to end up supporting |
sgrif
removed
the
enhancement
label
Nov 29, 2015
referenced
this issue
Nov 30, 2015
mfpiccolo
referenced this issue
Nov 30, 2015
Closed
`connection.query_one/all` with `update` and `delete` are a bit annoying to use #29
sgrif
closed this
in
caea99a
Nov 30, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sgrif commentedNov 29, 2015
This is just an artifact of the fact that I implemented this before everything other than the most basic forms of select. This should be changed to match
updateanddelete. This is the API I'm imagining:This would return a command that can be used in the same way the return values of
updateanddelete, which will be less painful with #29.Since this represents a breaking change in one of the most common APIs, we should do this sooner rather than later.