jgaskins / perpetuity-postgres

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

Converting type map to a hash lookup. #14

Closed acook closed 10 years ago

acook commented 10 years ago

A next step might be to make constants for the SQL types.

jgaskins commented 10 years ago

Sweet, thanks!

jgaskins commented 10 years ago

Also, now that you mention it, we've already got constants for (well, some of) the SQL types to serialize them to the database:

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 commented 10 years ago

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. I'll create a new issue for this.

acook commented 10 years ago

Created here: #16