java.jdbc

create-table if-not-exists

Details

  • Type: Enhancement Enhancement
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

sqlite has the IF NOT EXISTS clause to CREATE TABLE, but there doesn't seem to be an easy way to use it through jdbc.

It is usually an error to attempt to create a new table in a database that already contains a table, index or view of the same name. However, if the "IF NOT EXISTS" clause is specified as part of the CREATE TABLE statement and a table or view of the same name already exists, the CREATE TABLE command simply has no effect (and no error message is returned). An error is still returned if the table cannot be created because of an existing index, even if the "IF NOT EXISTS" clause is specified.

https://sqlite.org/lang_createtable.html

Activity

Hide
Sean Corfield added a comment -

DROP TABLE supports this too (MySQL at least, no doubt others). DDL should provide a consistent way to add stuff like this.

Show
Sean Corfield added a comment - DROP TABLE supports this too (MySQL at least, no doubt others). DDL should provide a consistent way to add stuff like this.
Hide
Sean Corfield added a comment -

Based on recent feedback about the DSLs that crept into 0.3.0, I'm going to decline this and recommend efforts go toward adding DDL support to Justin Kramer's HoneySQL.

Show
Sean Corfield added a comment - Based on recent feedback about the DSLs that crept into 0.3.0, I'm going to decline this and recommend efforts go toward adding DDL support to Justin Kramer's HoneySQL.
Hide
Sean Corfield added a comment -

Won't fix - DSLs are not growing here

Show
Sean Corfield added a comment - Won't fix - DSLs are not growing here
Sean Corfield made changes -
Field Original Value New Value
Resolution Declined [ 2 ]
Status Open [ 1 ] Resolved [ 5 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: