java.jdbc

resultset-seq uses structmap which has been deprecated

Details

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

Description

structmap has been deprecated. The open question is whether to replace its use with record or regular map (I'd expect the latter would be less surprising?).

Activity

Hide
Sean Corfield added a comment -

See JDBC-3 for some background on this.

Show
Sean Corfield added a comment - See JDBC-3 for some background on this.
Hide
Sean Corfield added a comment - - edited

The way resultset-seq uses create-struct and struct doesn't seem to leverage any inherent functionality of structmaps except perhaps some vague guarantee of ordering of columns in rows. Replacing the create-struct / struct calls with

(into {} (map vector keys (row-values)))

maintains the order up to 16 columns (PersistentArrayMap) so that seems a reasonable compromise.

I'm not sure that preserving order is something that should be documented or supported?

Show
Sean Corfield added a comment - - edited The way resultset-seq uses create-struct and struct doesn't seem to leverage any inherent functionality of structmaps except perhaps some vague guarantee of ordering of columns in rows. Replacing the create-struct / struct calls with
(into {} (map vector keys (row-values)))
maintains the order up to 16 columns (PersistentArrayMap) so that seems a reasonable compromise. I'm not sure that preserving order is something that should be documented or supported?
Hide
Sean Corfield added a comment -

No longer uses structmap. Attempts to provide column order (up to 16 columns) but don't rely on that... it was never documented as a guarantee!

Show
Sean Corfield added a comment - No longer uses structmap. Attempts to provide column order (up to 16 columns) but don't rely on that... it was never documented as a guarantee!

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: