DEDUPED Hot AI repos, turned into use cases Get the Monday 5

How to run SQL in a script and export results to a file with Masume

Run statements headless and write CSV, JSON, or Parquet output for a pipeline.

Short answer: Install Masume with brew install masumedb/tap/masume or another method from the README; then run masume run -p shop-prod -f json 'select count(*) from orders' to check the connection; run masume run ./notes.db -f csv 'select * from notes limit 100000' > notes.csv to export to CSV. All steps.

Who it is forA data engineer or CI maintainer who needs a query result as a file in a shell job.

The problemExporting data by hand from a GUI breaks repeatable reports and nightly jobs.

The outcomeA command writes the query result to a file that a later step can read.

What you need first

  • A terminal on macOS, Linux, or Windows
  • A database you can reach, or a local SQLite file
  • One install method: Homebrew, npm, Go 1.27 or later, or a release package

Steps

  1. Install Masume with brew install masumedb/tap/masume or another method from the README
  2. Run masume run -p shop-prod -f json 'select count(*) from orders' to check the connection
  3. Run masume run ./notes.db -f csv 'select * from notes limit 100000' > notes.csv to export to CSV
  4. Run masume run -p shop -f parquet 'select * from orders' > orders.parquet for a Parquet file

Prompt for your agent

In the masume repo, run `masume run -p <profile> -f json 'select count(*) from <table>'` and report the JSON output. Expected output: one JSON result with a count. Verify that the exit code is 0 before the next step uses the output.

Caveat. Check docs/headless.md for exit codes and format details before depending on them in CI.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for masumedb/masume and "Run SQL in a script and export results to a file"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer