Skip to content

aopstudio/dify-csv-sql-query-plugin

Repository files navigation

CSV SQL Formatter Plugin for Dify

A smart and efficient tool that lets you run SQL queries directly on uploaded CSV files—and get results as structured JSON or clean Markdown tables.

Overview

While Dify offers many database query plugin, they all require pre-configured database credentials (host, username, password, etc.), making it impractical for ad-hoc analysis of user-uploaded csv data.

This plugin fills a critical gap: it enables zero-setup SQL querying on any CSV file—no database, no credentials, no infrastructure. Just upload, write a query, and get instant results.

Perfect for analysts, product teams, or anyone who needs to explore or transform tabular data within a Dify workflow—without leaving the chat interface.

Available Tools

1. CSV SQL Query Executor

Executes a SQL query on an uploaded CSV file and returns formatted results.

Parameters:

  • csv_file (required): A single .csv file to query
    • Only files with .csv extension are accepted
    • Must be valid UTF-8 encoded CSV (headers recommended)
  • sql_query (required): A SQL query string
    • The virtual table name is data
    • Example: SELECT name, salary FROM data WHERE department = 'Engineering' ORDER BY salary DESC LIMIT 10
  • output_format (optional): Output format
    • json → Returns a JSON object with a result array (ideal for downstream logic)
    • markdown → Returns a formatted Markdown table (ideal for chat UI)
    • Default: markdown

Requirements

  • pandas
  • duckdb

Author

Created by aopstudio

Repository

https://github.com/aopstudio/dify-csv-sql-query-plugin

About

A Dify plugin can run sql query on csv file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages