Foreign Data Wrappers

PostgreSQL has a feature called Foreign Data Wrappers: plugins that allow the user to write a custom handler for any external data source, representing it as a set of foreign tables.

Foreign tables act similarly to normal tables and can accept the same SQL queries. Splitgraph extends on this idea by building some scaffolding around foreign data wrappers allowing the user to add external databases into the engine from the sgr command line client or a Splitfile.

In Splitgraph terminology, this is called "mounting", kind of like mounting a filesystem to mount points in the directory tree. You can snapshot these mounted tables, turning them into Splitgraph images, with the sgr import command.

The Splitgraph engine ships with several open-source foreign data wrappers: postgres_fdw, mongo_fdw and mysql_fdw.