Writing custom mount handlers
To mount a custom database into your Splitgraph engine, you have to do three things:
- Install the foreign data wrapper into the engine (either using PGXN or compiling the wrapper by yourself)
- Write a Python class deriving from
ForeignDataWrapperDataSourcethat defines the FDW's class and how command line options map to the FDW's own options. For an example, see
- Register the handler in your
Registering the handler in such a way will also use make it available in the
sgr client as an
sgr mount subcommand, as well as make it available to be used in Splitfiles.
For an end-to-end example of a custom mount handler querying the Firebase Hacker News API, see Splitgraph's GitHub repository.