jgaskins / perpetuity-postgres

Postgres adapter for Perpetuity
MIT License
10 stars 7 forks source link

Use SQL Value constants in type map. #16

Open acook opened 10 years ago

acook commented 10 years ago

@jgaskins said:

we've already got constants for (well, some of) the SQL types to serialize them to the database:

  • TextValue
  • NumericValue
  • TimestampValue

We could subclass them to get the proper ones and then use those classes via your mappings here to get the proper classes to serialize them instead of a chain of if or when statements.

@acook said:

This would then provide the direct mapping we need and we could also include a sql_type_name (or similar) method on those objects to give the appropriate string when we need it in the DB.