Skip to content

daelynum/dify-plugin-cloudbeaver

Repository files navigation

CloudBeaver

This is a Dify tool plugin for CloudBeaver, a web-based database management tool. It lets you run SQL queries against any database connected to your CloudBeaver server, directly from Dify agents and workflows.

Source code: https://github.com/daelynum/dify-plugin-cloudbeaver

Installation

Install the plugin from the Dify Marketplace, or upload the packaged .difypkg file under Plugins -> Install plugin -> Local Package File.

Operations

  • Execute SQL query - run any SQL query with support for limit, offset, ORDER BY, and WHERE filters.

Note: only connections from the Shared project in CloudBeaver are supported.

Credentials

Configure the plugin credentials once:

Field Description
Server URL Base URL of your CloudBeaver server, e.g. https://cloudbeaver.example.com
Username Local access username
Password Local access password
Connection ID ID of the CloudBeaver connection to run queries against (Shared project only)

The plugin authenticates with local access (username/password). The CloudBeaver server must be reachable from wherever Dify runs.

Compatibility

Runs as a tool plugin on Dify Cloud and self-hosted CloudBeaver (Community, Enterprise, or AWS Edition).

Usage

Finding the connection ID

Right-click a database in CloudBeaver's Database Navigator, select Open, and copy the ID from the connection window (e.g. postgres-jdbc-19d5ca3a223-2f46e1a321049b15).

Default database

The Default database field lets you specify which database or catalog to use when running SQL. Leave it empty to use the connection's default. This helps when a single CloudBeaver connection has access to multiple databases and you want to target a specific one.

Parameters

Parameter Required Default Description
default_database no - Database or catalog to run the query against
sql yes - SQL query to execute
limit no 200 Maximum number of rows to return
offset no 0 Number of rows to skip
order_by no - Column(s) to sort by, e.g. name DESC
where no - Extra WHERE condition, e.g. status = 'active'

Execute SQL query

The Where and Order by fields are applied on top of your SQL query:

SQL query:
SELECT id, name, email
FROM users

Where:    status = 'active'
Order by: created_at DESC
Limit:    50

String values in Where must be quoted, e.g. name = 'Africa'. Numbers go without quotes, e.g. id = 3.

Output

The tool returns a JSON message:

{
  "row_count": 2,
  "rows": [
    {
      "id": 1,
      "name": "alice"
    },
    {
      "id": 2,
      "name": "bob"
    }
  ]
}

Getting started

  1. Start CloudBeaver:

    docker run -d -p 8978:8978 dbeaver/cloudbeaver:latest
    
  2. Configure authentication - follow the Local Access Authentication guide. Create a user (login/password) or use admin credentials.

  3. Create a database connection - follow the Create Connection guide.

  4. Get the connection ID - open Database Navigator, right-click a database, select Open, and copy the connection ID.

  5. In Dify:

    • Configure the CloudBeaver plugin credentials (Server URL, username, password, connection ID).
    • Add the tool to an agent or workflow.
    • Call it with a SQL query.

Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages