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 upConsider changing `insert(records).into(table)` to `insert_into(table).values(records)` #1167
Comments
sgrif
added
breaking change
discussion desired
labels
Sep 15, 2017
sgrif
added this to the 1.0 milestone
Sep 15, 2017
This comment has been minimized.
|
@diesel-rs/contributors WDYT? |
This comment has been minimized.
|
I like it. |
added a commit
that referenced
this issue
Sep 21, 2017
sgrif
closed this
in
#1182
Sep 21, 2017
added a commit
that referenced
this issue
Sep 21, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sgrif commentedSep 15, 2017
There are two main things that got me thinking about this change. The first is this code. It's a papercut, but I don't like the fact that if you get the argument to
insertwrong, the message is going to be that you passed the wrong number of arguments tointo. Maybe this isn't a big deal (I don't think it's ever come up in gitter), but it's a paper cut I'd like to avoid, and I think it will be easier to run into once #789 is done.The second is that I've been thinking about an API to represent
INSERT INTO table (column_list) SELECT .... The best idea I've seen based on our current API isinsert(select_statement).into(column_list), but that feels a little implicit to me. If we changed the insert API, I could see something likeinsert_into(table).columns(column_list).values(select_statement)orinsert_into(table).from_select(column_list, select_statement)being much more reasonable.