VS Code Extension
The Arc Database Manager extension for VS Code: saved connections, SQL IntelliSense against your measurements, result grids, CSV import, and test-data generation.
Complete development toolkit for Arc Database directly in Visual Studio Code.
Overview
The Arc Database Manager extension provides a full-featured IDE for working with Arc:
- Connection Management: Multiple saved connections with secure token storage
- SQL IntelliSense: Auto-completion for tables, columns, and SQL functions
- Interactive Results: Export to CSV/JSON/Markdown with automatic chart visualization
- Arc Notebooks: Mix SQL and Markdown in
.arcnbfiles with parameterized queries - Schema Explorer: Browse databases and tables with context menus
- Data Ingestion: CSV import wizard and bulk data generator
- Alerting: Create query-based alerts with desktop notifications
- Query Management: Automatic history and saved queries
- Dark Mode: Automatic theme detection and adaptation
Installation
From VS Code Marketplace
- Open VS Code
- Click Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Arc Database Manager"
- Click Install
Or install directly from the marketplace:
From command line
code --install-extension basekick-labs.arc-db-managerQuick start
1. Connect to Arc server
Option A: From Status Bar
- Click "Arc: Not Connected" in the status bar
- Enter connection details:
- Name:
My Arc Server - Host:
localhost - Port:
8000 - Protocol:
httporhttps
- Name:
- Enter your authentication token
Option B: From Command Palette
- Press
Ctrl+Shift+P/Cmd+Shift+P - Type
Arc: Connect to Server - Follow the prompts
2. Get your API token
# Docker - check logs for admin token
docker logs <container-id> 2>&1 | grep "Admin token"
# Or create a new token
curl -X POST http://localhost:8000/api/v1/auth/tokens \
-H "Authorization: Bearer $ARC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "vscode-extension",
"description": "VS Code extension access"
}'The extension needs a token with the read permission to browse databases and
run queries. Omitting permissions gives Arc's default, read,write.
Tokens scoped to specific databases
Where Arc restricts reads per database, the extension works with a scoped
token but cannot enumerate databases with one β Arc refuses to list them
all rather than returning a partial list, the same bar SHOW DATABASES
applies. Set the database on the connection and the schema explorer,
completions and queries all use that one.
3. Start querying
- Press
Ctrl+Shift+PβArc: New Query - Write your SQL query
- Press
Ctrl+Enter/Cmd+Enterto execute
Example Query:
SELECT
time_bucket(INTERVAL '5 minutes', time) as bucket,
AVG(usage_idle) * -1 + 100 AS cpu_usage,
host
FROM prod.cpu
WHERE cpu = 'cpu-total'
AND time > NOW() - INTERVAL '1 hour'
GROUP BY bucket, host
ORDER BY bucket ASC;Features
SQL IntelliSense
Get auto-completion for:
- Database names
- Table names
- Column names
- SQL functions
- SQL keywords
How to use:
- Start typing and IntelliSense will suggest completions
- Press
Ctrl+Spaceto manually trigger suggestions - Navigate with arrow keys, press
Enterto accept
Interactive results view
After executing a query, results are displayed with:
Export Options:
- CSV format
- JSON format
- Markdown tables
Automatic Visualizations:
- Time-series data is automatically charted
- Line charts for temporal data
- Theme-aware (adapts to VS Code theme)
Table Features:
- Sort by clicking column headers
- Filter rows with search
- View execution time and row count
Arc notebooks
Create analysis documents mixing SQL and Markdown in .arcnb files.
Create a Notebook:
- Press
Ctrl+Shift+PβArc: New Notebook - Save with
.arcnbextension
Notebook Features:
- Mix Markdown documentation with SQL queries
- Parameterized queries with variable substitution
- Execute cells individually or all at once
- Export to Markdown with results
- Auto-save functionality
Example Notebook:
# CPU Performance Analysis
This notebook analyzes CPU usage patterns over time.
Variables:
- interval = 1 HOUR
- threshold = 80
- database = prod
## Average CPU Usage
SELECT
time_bucket(INTERVAL '5 minutes', time) as bucket,
AVG(usage_user) as avg_cpu,
host
FROM ${database}.cpu
WHERE time > NOW() - INTERVAL ${interval}
AND usage_user > ${threshold}
GROUP BY bucket, host
ORDER BY bucket DESC;
## Results
The query shows periods where CPU exceeded ${threshold}% in the last ${interval}.Variable Syntax:
- Define variables in YAML frontmatter
- Reference with
${variable_name} - Variables are replaced before execution
Schema explorer
Browse your Arc databases and tables in the sidebar.
Features:
- Hierarchical view of databases and tables
- Connection status indicator
- Visual refresh button
With a token scoped to specific databases:
The explorer shows the connection's database when one is set. If none is set
it shows a single entry β "Token is scoped β set a database on this
connection" β with the full explanation on hover, rather than an empty tree
or a bare 403. Expanding a database the token has no grant for says
"No read access to <name> with this token" on that node, leaving the rest
of the tree usable.
SQL completions behave the same way: they fall back to the connection's database instead of going empty.
Right-Click Context Menus:
On Tables:
- Show Table Schema - View column names and types
- Preview Data - Show first 100 rows
- Show Table Statistics - Row count and size
- Generate SELECT Query - Create basic query
- Query Last Hour - Filter to recent data
- Query Today - Filter to today's data
Example: Show Table Schema
Right-click table β Show Table Schema
Result:
ββββββββββββββ¬βββββββββββ
β Column β Type β
ββββββββββββββΌβββββββββββ€
β time β TIMESTAMPβ
β host β VARCHAR β
β usage_idle β DOUBLE β
β usage_user β DOUBLE β
ββββββββββββββ΄βββββββββββData ingestion
CSV import wizard
Import CSV files directly into Arc with guided setup.
Steps:
- Press
Ctrl+Shift+PβArc: Import CSV - Select your CSV file
- Configure import settings:
- Auto-detect delimiter and headers
- Select timestamp column
- Choose target database
- Set batch size
Performance:
- Throughput depends on file size, schema, and host hardware
- Uses MessagePack columnar format
- Progress tracking for large files
- Batch processing support
Example:
Import Settings:
- File: metrics.csv
- Delimiter: , (auto-detected)
- Timestamp Column: time
- Database: prod
- Measurement: custom_metrics
- Batch Size: 10,000
Result: 250,000 rows imported in 3.2 secondsBulk data generator
Generate test data for development and testing.
Presets:
- CPU Metrics - System CPU usage data
- Memory Metrics - Memory usage statistics
- Network Metrics - Network traffic data
- IoT Sensor Data - Temperature, humidity sensors
- Custom Schema - Define your own fields
Steps:
- Press
Ctrl+Shift+PβArc: Generate Test Data - Select preset
- Configure:
- Number of rows
- Target database
- Time range
Performance:
- Throughput depends on the selected dataset and host hardware
- Realistic sample data
- Configurable patterns
Alerting & monitoring
Create alerts based on query results with desktop notifications.
Create an Alert:
- Press
Ctrl+Shift+PβArc: Create Alert - Configure alert:
- Name
- SQL query
- Condition type
- Threshold value
- Check interval
Condition Types:
- Greater than
- Less than
- Equals
- Not equals
- Contains
Example Alert:
Name: High CPU Usage
Query: SELECT AVG(usage_user) as cpu FROM prod.cpu WHERE time > NOW() - INTERVAL '5 minutes'
Condition: greater_than
Threshold: 80
Interval: 60sAlert Features:
- Desktop notifications when triggered
- Alert history tracking
- Enable/disable without deletion
- Minimum check interval: 10 seconds
Query management
Query History:
- Every executed query is automatically saved
- View execution time and row counts
- Quick re-run from history
- Search through past queries
Saved Queries:
- Bookmark frequently used queries
- Organize by tags or folders
- Quick access from sidebar
Access:
- Open Arc sidebar
- Navigate to Query History or Saved Queries
- Click query to view or re-run
Token management
Manage Arc authentication tokens directly from VS Code.
Features:
- Create new tokens
- Rotate existing tokens
- Delete tokens
- Verify token validity
- Secure storage in system keychain
Creating a token asks which permissions it should carry β read, write,
delete, admin β defaulting to Arc's own read,write. read is what the
extension itself needs. The created-token message lists the permissions and
notes that RBAC grants narrow them further if the token belongs to a team.
Access:
- Press
Ctrl+Shift+P - Type
Arc: Manage Tokens - Select action
Commands
Access all commands via Command Palette (Ctrl+Shift+P / Cmd+Shift+P):
Connection
Arc: Connect to ServerArc: DisconnectArc: Verify TokenArc: Manage Tokens
Queries
Arc: New QueryArc: Execute Query(Ctrl+Enter / Cmd+Enter)Arc: Save Current QueryArc: Open Query History
Notebooks
Arc: New NotebookArc: Execute Notebook CellArc: Execute All CellsArc: Export Notebook to Markdown
Data
Arc: Import CSVArc: Generate Test Data
Alerts
Arc: Create AlertArc: View AlertsArc: Enable/Disable Alert
Explorer
Arc: Refresh ExplorerArc: Show Table SchemaArc: Preview Table DataArc: Show Table Statistics
Keyboard shortcuts
| Command | Windows/Linux | macOS |
|---|---|---|
| Execute Query | Ctrl+Enter | Cmd+Enter |
| New Query | Ctrl+Shift+P β Arc: New Query | Cmd+Shift+P β Arc: New Query |
| Command Palette | Ctrl+Shift+P | Cmd+Shift+P |
| Toggle Sidebar | Ctrl+B | Cmd+B |
Extension settings
Configure extension defaults in VS Code settings:
{
"arc.defaultHost": "localhost",
"arc.defaultPort": 8000,
"arc.defaultProtocol": "http"
}Available Settings:
| Setting | Description | Default |
|---|---|---|
arc.defaultHost | Default Arc server host | localhost |
arc.defaultPort | Default Arc server port | 8000 |
arc.defaultProtocol | Default protocol | http |
Use cases
Development & testing
Generate Test Data:
1. Arc: Generate Test Data
2. Select: CPU Metrics
3. Rows: 100,000
4. Database: dev
5. Time Range: Last 24 hours
Result: Realistic CPU metrics for testingQuery the Data:
SELECT
time_bucket(INTERVAL '5 minutes', time) as bucket,
AVG(usage_user) as avg_cpu
FROM dev.cpu
WHERE time > NOW() - INTERVAL '1 hour'
GROUP BY bucket
ORDER BY bucket DESC;Data analysis
Create analysis notebooks (.arcnb) with:
- Documentation in Markdown
- Parameterized SQL queries
- Inline results and charts
- Export to Markdown reports
Example Use Case:
# Weekly Performance Report
Variables:
- week_start = 2025-01-10
- database = prod
## CPU Trends
SELECT
DATE_TRUNC('day', time) as day,
AVG(usage_user) as avg_cpu
FROM ${database}.cpu
WHERE time >= '${week_start}'
GROUP BY day
ORDER BY day;Production monitoring
Create Alert:
Name: High Memory Usage
Query: SELECT AVG(used_percent) FROM prod.mem WHERE time > NOW() - INTERVAL '5 minutes'
Condition: greater_than
Threshold: 90
Interval: 60s
β Desktop notification when memory exceeds 90%Data migration
Import CSV Files:
1. Arc: Import CSV
2. Select file: server_metrics.csv
3. Auto-detect: delimiter, headers
4. Set timestamp column: timestamp
5. Target: prod.imported_metrics
6. Batch size: 10,000
β Import complete with progress trackingPerformance
- Query Results: Displays up to 1,000 rows instantly
- CSV Import: throughput depends on file size and host hardware
- Data Generator: throughput depends on the dataset and host hardware
- Batch Processing: Handles millions of rows with progress tracking
Troubleshooting
Cannot connect to Arc server
# 1. Verify Arc is running
curl http://localhost:8000/health
# 2. Check connection details
- Host: localhost
- Port: 8000
- Protocol: http
# 3. Verify token
Arc: Verify Token (from Command Palette)Query timeout
Solutions:
- Add time filters:
WHERE time > NOW() - INTERVAL '1 hour'- Add
LIMITclause:
LIMIT 1000- Check Arc server performance:
curl http://localhost:8000/api/v1/compaction/trigger \
-H "Authorization: Bearer $ARC_TOKEN"CSV import fails
Common Issues:
- Encoding: Ensure UTF-8 encoding
- Delimiter: Verify delimiter is correct (auto-detect usually works)
- File Size: Try smaller file first to test
- Timestamp Format: Ensure timestamp column is recognized
Check Import Settings:
File encoding: UTF-8
Delimiter: , (comma)
Headers: First row
Timestamp column: time
Format: ISO 8601 or Unix timestampExtension not activating
- Check VS Code version: Requires 1.85.0 or higher
- View Output: View β Output β Arc Database Manager
- Reload Window: Ctrl+Shift+P β Reload Window
- Reinstall: Uninstall and reinstall extension
IntelliSense not working
- Refresh Schema: Right-click in Arc Explorer β Refresh
- Reconnect: Disconnect and reconnect to server
- Check Connection: Ensure server is connected (status bar)
Requirements
- VS Code: Version 1.85.0 or higher
- Arc Database: Running instance (v1.0.0+)
- Authentication Token: Valid Arc API token
Release notes
0.2.0 - Latest
New Features:
- Auto-qualified table names in queries
- Right-click queries include database prefix (e.g.,
prod.cpu)
Improvements:
- Fixed query generation to read metadata correctly
- All context menu queries now work without manual editing
0.1.9
β οΈ Breaking Changes:
- Updated all API endpoints to
/api/v1/prefix - Requires Arc v1.0.0 or later
- Not compatible with pre-v1.0 Arc servers
Migration:
- Upgrade Arc to v1.0.0+
- Update extension to v0.1.9
- Reconnect to Arc server
Resources
Next steps
- Getting Started with Arc - Install and configure Arc
- Query API Reference - Learn Arc SQL
- Grafana Integration - Build dashboards
- Telegraf Integration - Collect system metrics
Enjoy using Arc Database Manager!
Made with β€οΈ by Basekick Labs
MQTT Integration
Subscribe Arc directly to MQTT brokers: configure the broker connection, manage topic subscriptions through the API, and map JSON payloads onto measurements.
OpenTelemetry Integration
Export traces, metrics, and logs from the OpenTelemetry Collector into Arc: build the collector with the Arc exporter, configure it, and query spans with SQL.