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 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 executed on the default database.

If the connector is not configured with a default database, or if you need to query a different database, you can specify the database parameter when obtaining the connector operation object, for example:

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

Some databases do not support switching 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, for example:

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 specific connector types, please refer to the respective documentation.