Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 740 Bytes

README.md

File metadata and controls

44 lines (30 loc) · 740 Bytes

Node TypeORM Example

Example of using TimescaleDB with Node.js and TypeORM.

What it does

  • Tracks page views with user agent data
  • Uses hypertables for time-series data
  • Handles data compression automatically

Quick Start

# Setup
cp .env.example .env  # Update DATABASE_URL
pnpm install
pnpm build
pnpm migrate

# Run
pnpm start

# or

# Test
pnpm test

API

# Record page view
POST /api/pageview

# Get stats for time range
GET /api/stats?start=2025-01-01&end=2025-01-02

# Check compression status
GET /api/compression

Note

This example uses the legacy approach with raw SQL queries. Check back for the new @timescaledb/core package that will make this much simpler.