Skip to content

gigapi/gigapi-querier-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

GigAPI Query Engine

GigAPI Bun provides a SQL interface to query time-series using GigAPI Catalog Metadata and DuckDB

Quick Start

# Install dependencies
bun install

# Start the server
bun start

Configuration

  • PORT: Server port (default: 8080)
  • DATA_DIR: Path to data directory (default: ./data)

API Endpoints

Query Data

$ curl -X POST "http://localhost:9999/query?db=mydb" \
  -H "Content-Type: application/json"  \
{"query": "SELECT time, location, temperature FROM weather WHERE time >= '2025-04-01T00:00:00'"}

Debug Endpoints

  • GET /debug/{db}/{table}: Inspect metadata and file structure
  • GET /fs/{path}: Browse files and directories
  • POST /sql: Execute raw DuckDB queries

Data Structure

/data
  /mydb
    /weather
      /date=2025-04-10
        /hour=14
          *.parquet
          metadata.json

Query Processing Logic

  1. Parse SQL query to extract measurement name and time range
  2. Find relevant parquet files using metadata
  3. Use DuckDB to execute optimized queries against selected files
  4. Post-process results to handle BigInt timestamps

Notes for Developers

  • File paths in metadata.json may contain absolute paths; the system handles both absolute and relative paths
  • Time fields are converted from nanosecond BigInt to ISO strings
  • Add ?debug=true to query requests for detailed troubleshooting information

License

Gigapipe is released under the GNU Affero General Public License v3.0 ©️ HEPVEST BV, All Rights Reserved.

About

Bun/JS DuckDB Query Engine for GigAPI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published