Implement SELECT INTO for Postgres#1021
Conversation
src/query/select.rs
Outdated
| /// r#"SELECT "character" INTO UNLOGGED TABLE "character_copy" FROM "character""# | ||
| /// ); | ||
| /// ``` | ||
| pub fn into_target(&mut self, into_table: SelectInto) -> &mut Self { |
There was a problem hiding this comment.
Why name it into_target instead of into_table? This type of statement is only used to create new tables.
There was a problem hiding this comment.
https://www.postgresql.org/docs/current/sql-selectinto.html#compatibility
Well, different databases have different behaviors. Which naming do you prefer? @tyt2y3
There was a problem hiding this comment.
I see that there are other INTOs:
- in MySQL it is coming after FROM and it puts the values into variables
- in PL/PgSQL the into is before the FROM and it puts values into variables (but this is not what we want here)
- in SQLite I haven't seen any INTO
So I think into_table is a good name. I added at first into() then I though it might interfere with Into trait if once it needs to be implemented. So I wanted to change to something else, watching the Postgres spec too long the target word hooked in, so I chose into_target but into_table describes better the intent what an API should do otherwise.
|
How are we with this? @Huliiiiii you asked a review which never happened. |
🎉 Released In 1.0.0-rc.31 🎉Thank you everyone for the contribution! |
PR Info
New Features
fn into_target()onSelectStatementin order to specify the SELECT INTO clause for PostgresqlChanges
Check the naming please.