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. sgr
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 sgr
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 sgr
engine ships with several open-source foreign data wrappers:
postgres_fdw
,
mongo_fdw
,
mysql_fdw
and
pg_es_fdw
.