chop-dbhi / dataexpress

[NOT MAINTAINED] DataExpress is a simple, Scala-based cross database ETL toolkit supporting Postgres, MySql, Oracle, SQLServer, and Sqlite
http://dataexpress.research.chop.edu
BSD 2-Clause "Simplified" License
72 stars 9 forks source link

SqlBackend createTable blindly drops if table exists #21

Open masinoa opened 11 years ago

masinoa commented 11 years ago

SqlBackend the createTable method blindly drops the table if it already exists. Is this what we want? It could instead throw an exception or the method could return some kind of status object, e.g. Completed, Failed(withReason), etc. Then the caller method can decide if the table should be dropped if it exists. Of course, we can also add a "dropIfExists" arg to the createTable method for convenience.

murphyke commented 10 years ago

FWIW, I agree that it would be better to have control over this situation.

mitalia commented 10 years ago

@murphyke this is going to go away in a future release. The upcoming release candidate adds logging support and includes a warning about this behavior when it's triggered:

https://github.com/cbmi/dataexpress/blob/develop/src/main/scala/edu/chop/cbmi/dataExpress/backends/SqlBackend.scala#L404-L418