java.jdbc

Clean up syntax for create table DDL to improve options handling

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

Version 0.5.5 introduced a single options map, flagged by the :options argument. This is a compromise while I figure out the better way to change create-table-ddl to be a better behaved function, instead of being inherently variadic.

Activity

Hide
Sean Corfield added a comment - - edited

Since the arguments are really:

  • table name
  • list of column specs
  • options

It probably makes sense to have the signature:

(create-table-ddl :table [[col1 spec] [col2 spec] ..] {:option value})

so it takes either three or four arguments: a name (string / symbol / keyword), a collection of column specs (require the column specs to be vectors), an optional map of options.

Given that the current form is variadic but the "middle" arguments are not maps anyway, introducing :options in 0.5.5 was unnecessary, but consistent with the changes for insert!.

Version 0.5.6 should support both forms, then 0.6.0 can drop support for the general variadic version.

Show
Sean Corfield added a comment - - edited Since the arguments are really:
  • table name
  • list of column specs
  • options
It probably makes sense to have the signature:
(create-table-ddl :table [[col1 spec] [col2 spec] ..] {:option value})
so it takes either three or four arguments: a name (string / symbol / keyword), a collection of column specs (require the column specs to be vectors), an optional map of options. Given that the current form is variadic but the "middle" arguments are not maps anyway, introducing :options in 0.5.5 was unnecessary, but consistent with the changes for insert!. Version 0.5.6 should support both forms, then 0.6.0 can drop support for the general variadic version.
Hide
Sean Corfield added a comment -

This has been implemented ready for 0.5.6.

Show
Sean Corfield added a comment - This has been implemented ready for 0.5.6.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: