embulk / embulk-output-jdbc

MySQL, PostgreSQL, Redshift and generic JDBC output plugins for Embulk
Other
88 stars 86 forks source link

I want you to add an alias delete_insert to mode:tuncate_insert #322

Closed naka-sho closed 11 months ago

naka-sho commented 1 year ago

mode:tuncate_insert does not actually use the truncate statement, it executes the delete statement

https://github.com/embulk/embulk-output-jdbc/blob/dfb2192cd0162ac32b9111f1de7f28177e4cf902/embulk-output-jdbc/src/main/java/org/embulk/output/jdbc/AbstractJdbcOutputPlugin.java#L890-L897 https://github.com/embulk/embulk-output-jdbc/blob/dfb2192cd0162ac32b9111f1de7f28177e4cf902/embulk-output-jdbc/src/main/java/org/embulk/output/jdbc/JdbcOutputConnection.java#L386-L417 https://github.com/embulk/embulk-output-jdbc/blob/dfb2192cd0162ac32b9111f1de7f28177e4cf902/embulk-output-jdbc/src/main/java/org/embulk/output/jdbc/JdbcOutputConnection.java#L419-L427

Please add delete_insert with another name because there is a possibility of misunderstanding that rollback is not possible.

I think that misunderstandings can be eliminated by adding the fact that the delete statement is explicitly issued to mode.

I created a pull request with the changes, please check it.

https://github.com/embulk/embulk-output-jdbc/pull/321 https://github.com/embulk/embulk-output-jdbc/pull/324

hiroyuki-sato commented 11 months ago

324 fixed this issue. (Add description). If you have any concern please re-open this issue.