Skip to content

Interface and Operations / Connectors

When users need to access external databases or third-party systems, besides directly implementing it in the code, they can also use the "connector" feature provided by DataFlux Func.

Even without using connectors, users can still normally write Python scripts themselves to access external databases or third-party systems

Connector List

Select the "Connector" tab in the left sidebar to display a list of all added connectors.

connector-aside.png

Using Connectors

After adding a connector properly, you can use the connector ID in the script to obtain the corresponding connector's operation object.

connector-id.png

Assume there is a Redis connector with its ID set as redis. The code for obtaining the connector's operation object would be as follows:

Python
1
2
3
redis = DFF.CONN('redis')
redis.query('SET', 'some_key', 'some_value')
print(redis.query('GET', 'some_key'))

You can also directly copy the basic example code from the connector tooltip to reduce keyboard input:

connector-code-example.png


Reference Documentation

For details on how to use connectors within scripts, refer to the documentation Script Development / Connector Object DFF.CONN

Some connectors support subscribing to messages and executing functions; refer to the documentation Script Development / Connector Subscription