Skip to content

matlab/matlab-agentic-toolkit / skills-catalog/reporting-and-database-access/matlab-use-duckdb

matlab-use-duckdb

Verified

Use DuckDB from MATLAB via Database Toolbox (R2026a+) as a non-math operations engine on large tabular files (CSV/Parquet/JSON) and as a zero-config embedded database. Use when connecting to DuckDB, querying CSV, Parquet, and JSON files directly with SQL, reducing or profiling large data before MATLAB analysis, creating portable development databases, or installing DuckDB extensions. Triggers on: DuckDB, duckdb(), large CSV/Parquet/JSON, file too large for readtable, filter/aggregate at source, deduplicate, reduce before analysis, profile large file, persistent file import, analytical engine, SQL on CSV, SQL on Parquet, SQL on JSON, query CSV with SQL, query Parquet with SQL, run SQL on files, SQL queries on files, query files directly, SQL without database, in-process SQL.

reference/cards/extensions.md

View on GitHub
# DuckDB Extensions

DuckDB supports extensions for additional functionality. Install and load them using `execute`. See https://duckdb.org/docs/current/core_extensions/overview for the full list.

## Installing and Loading Extensions

```matlab
conn = duckdb();

% Two-step process: install (downloads), then load (activates)
execute(conn, "INSTALL httpfs");
execute(conn, "LOAD httpfs");

close(conn);
```

## Common Extensions

| Extension | Purpose | Example Use Case |
|-----------|---------|-----------------|
| `httpfs` | Read files over HTTP/S3 | Query remote Parquet files |
| `spatial` | Geospatial functions | ST_Distance, ST_Contains queries |
| `json` | Advanced JSON processing | Nested JSON extraction |
| `excel` | Read Excel files | `read_xlsx('file.xlsx')` |
| `sqlite_scanner` | Attach SQLite databases | Cross-database queries |

## Example: Query Remote Parquet Files

```matlab
conn = duckdb();

execute(conn, "INSTALL httpfs");
execute(conn, "LOAD httpfs");

% Query a remote Parquet file over HTTPS
data = fetch(conn, "SELECT * FROM read_parquet('https://example.com/data.parquet') LIMIT 1000");

close(conn);
```

## Example: Attach a SQLite Database

```matlab
conn = duckdb();

execute(conn, "INSTALL sqlite_scanner");
execute(conn, "LOAD sqlite_scanner");

% Attach an existing SQLite file and query it through DuckDB
execute(conn, "ATTACH 'legacy.db' AS legacy (TYPE sqlite)");
data = fetch(conn, "SELECT * FROM legacy.main.customers WHERE active = true");

close(conn);
```

## Notes

- Extension installation requires internet access (first time only — cached afterward).
- Not all extensions are available on all platforms.
- Extensions persist in the DuckDB extension directory — subsequent `LOAD` calls don't re-download.

----

Copyright 2026 The MathWorks, Inc.

----

deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall