Markdown Converter
Agent skill for markdown-converter
This prompt provides context for working with the `positron-duckdb` extension, which provides DuckDB WebAssembly support for headless data exploration in Positron.
Sign in to like and favorite skills
This prompt provides context for working with the
positron-duckdb extension, which provides DuckDB WebAssembly support for headless data exploration in Positron.
Related documentation:
.claude/build-system.md - For daemon management and compilation.claude/data-explorer.md - For frontend components that use this extension.claude/e2e-testing.md - For E2E tests involving data explorationPurpose: Provides DuckDB support for headless data explorers for previewing data files
Display Name: "Positron DuckDB Wasm Support"
Location:
extensions/positron-duckdb/src/extension.ts@duckdb/duckdb-wasm, apache-arrow, web-worker
extensions/positron-duckdb/ ├── package.json # Extension manifest ├── package.nls.json # Localized strings ├── src/ │ ├── extension.ts # Main extension logic │ ├── interfaces.ts # Type definitions and RPC interfaces │ └── test/ │ ├── extension.test.ts # Unit tests │ ├── README.md # Test instructions │ └── data/ # Test datasets │ ├── flights.csv │ └── flights.parquet ├── tsconfig.json # TypeScript configuration └── extension.webpack.config.js # Build configuration
Ensure build daemons are running (see
.claude/build-system.md):
# Check daemon status first ps aux | grep -E "npm.*watch-extensionsd" | grep -v grep # Start if not running npm run watch-extensionsd & sleep 30 # Wait for compilation
# Run all DuckDB extension tests npm run test-extension -- -l positron-duckdb # Test specific functionality npm run test-extension -- -l positron-duckdb --grep "histogram" npm run test-extension -- -l positron-duckdb --grep "csv" npm run test-extension -- -l positron-duckdb --grep "filter"
extensions/positron-duckdb/src/extensions/positron-duckdb/src/test/data/Manages the DuckDB WebAssembly runtime:
Implements data explorer backend protocol:
Statistical computation engine:
The extension implements the full Data Explorer RPC protocol:
OpenDataset: Import files or connect to tablesGetSchema: Retrieve column informationGetDataValues: Query formatted cell valuesSetRowFilters: Apply WHERE clause filtersSetSortColumns: Apply ORDER BY sortingGetColumnProfiles: Generate statistical summariesExportDataSelection: Export data in various formatsIMPORTANT: Protocol Types Location The standard Data Explorer protocol types are auto-generated from
positron/comms/data_explorer-backend-openrpc.json into src/vs/workbench/services/languageRuntime/common/positronDataExplorerComm.ts. Do NOT manually edit positronDataExplorerComm.ts - changes must be made in the OpenRPC schema and regenerated.
DuckDB-specific extensions to the protocol (like
SetDatasetImportOptions for CSV import options) should be defined in:
src/vs/workbench/services/positronDataExplorer/common/positronDataExplorerDuckDBBackend.ts (core types)extensions/positron-duckdb/src/interfaces.ts (extension types - must mirror the core types)NULL values: Proper null handling across all typesNaN, Inf, -Inf: Special numeric value formattingimport { DataExplorerRpc, DataExplorerBackendRequest } from '../interfaces'; // Helper functions async function dxExec(rpc: DataExplorerRpc): Promise<any> { } async function runQuery<Type>(query: string): Promise<Array<Type>> { } function makeTempTableName(): string { } // Test patterns suite('DuckDB Extension Tests', () => { test('should handle CSV files', async () => { // Test CSV import and querying }); test('should compute histograms', async () => { // Test statistical profiling }); test('should filter data correctly', async () => { // Test row filtering }); });
flights.csv: Sample airline data for testingflights.parquet: Same data in Parquet formatcreateTableFromUri() methodRowFilterType enummakeWhereExpr() functionColumnProfileType enumColumnProfileEvaluatorSet
DEBUG_LOG = true in extension.ts for query logging
registerFileBuffer()quoteIdentifier()makeTempTableName() for unique table namespositron-duckdb.runQuery, positron-duckdb.dataExplorerRpc