Skip to content

Script Development / Connector Object DFF.CONN

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

Example
1
2
3
4
@DFF.API('InfluxDB Operation Demo')
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 in the default database.

If the Connector is not configured with a default database, or if you need to query a different database during the query, you can specify the database parameter when obtaining the Connector operation object, such as:

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

Some databases do not support changing databases during queries. To operate on different databases, you can create multiple Connectors.

For DataWay, you can specify the token parameter when obtaining the Connector operation object, such as:

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

Since Connectors have different types, when using DFF.CONN(...), the optional parameters and supported methods of each Connector operation object are not the same.

For detailed API interfaces of different types of Connectors, please refer to the specific documentation.