3 ms·
My favorite usage of the information schema stuff was with unit testing. We have a VERY small ORM-ish library called PG-Promise that we use in a node.js applic
by Klathmon 9y ago
My favorite usage of the information schema stuff was with unit testing.
We have a VERY small ORM-ish library called PG-Promise that we use in a node.js application. It's basically just a nice interface to the database, but it does include some small functionality where you can define the database layout in javascript and it will auto-convert most of your data from JSON to the correct columns and in many cases types.
We wrote tests that use information schema to compare those objects and ensure that there aren't any missing or extra on either side, and to make sure that the javascript types match the database types.