Skip to content

Script Development / Connector Object DFF.CONN

After creating a connector, you can use the built-in function DFF.CONN('...') in your code to operate this connector. The method returns the specified connector operation object.

Example
1
2
3
4
@DFF.API('InfluxDB Operation Demonstration')
def influxdb_demo():
    db = DFF.CONN('demo_influxdb')
    return db.query('SELECT * FROM demo LIMIT 3')

If the connector is configured with a default database, the query will be performed on the default database.

If the connector does not have a default database configured, or if you need to query a different database during the query, you can specify the database parameter when obtaining the connector operation object, like this:

Python
1
db = DFF.CONN('demo_influxdb', database='my_database')

Some databases do not support changing the database during a query. To operate on different databases, you can create multiple connectors.

For DataWay, you can specify the token parameter when obtaining the connector operation object, like this:

Python
1
dataway = DFF.CONN('df_dataway', token='xxxxx')

Since connectors come in different types, the optional parameters and supported methods for each connector operation object may vary when using DFF.CONN(...).

For detailed APIs of specific types of connectors, refer to the respective documentation.