node-postgres has undocumented support for custom serialization if an object has a toPostgres method on it.
This PR adds such a function to the Range class so that you can give an instance as a parameter to node-postgres (or Knex or whatever might sit on top) without having to explicitly serialize it.
Since node-pg-types uses this library per default, it felt like the right place to add this so that it works both ways out of the box. Let me know what you think!
node-postgres has undocumented support for custom serialization if an object has a
toPostgres
method on it.This PR adds such a function to the Range class so that you can give an instance as a parameter to node-postgres (or Knex or whatever might sit on top) without having to explicitly serialize it.
Since node-pg-types uses this library per default, it felt like the right place to add this so that it works both ways out of the box. Let me know what you think!