SampleDest
. When you’re building your own destination, you can swap out the SampleDest
name for the real name of your new destination.
mage_integrations/destinations/
directory, add a new directory named after your destination.
Use snake case and lowercase for your directory name: mage_integrations/destinations/sample_dest/
.
In this new directory, create the following subdirectories and files:
mage_integrations/destinations/sample_dest/templates/config.json
mage_integrations/destinations/sample_dest/__init__.py
mage_integrations/destinations/sample_dest/README.md
config.json
file contains keys and values that are used to configure the
behavior of the destination as well as credentials to authenticate requests to the destination.
config.json
.
__init__.py
mage_integrations/destinations/amazon_s3/__init__.py
README.md
README.md
file.
mage_integrations/destinations/sample_dest/__init__.py
,
create a new class named after your destination and subclass the
base destination class.
If you’re adding a destination for a SQL data warehouse or database, you can subclass the
base sql destination class
export_batch_data
methodDestination
class has an instance method called export_batch_data
. Here is the interface:
mage_integrations/destinations/sample_dest/__init__.py
, add the main function to the bottom of the file
like below:
DESTINATIONS
list constant in this file: https://github.com/mage-ai/mage-ai/blob/master/mage_ai/data_integrations/destinations/constants.py
mage_integrations
module by running the following commands in Mage terminal: