Skip to content

drizzle-team/drizzle-singlestore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webinar Demo: SingleStore + Drizzle ORM

This project demonstrates how to use SingleStore with Drizzle ORM in a modern TypeScript backend, powered by the Hono web framework. It includes a sample events table, endpoints to showcase OLAP query capabilities, and a seeding setup using drizzle-seed.

Project Purpose

The goal of this project is to highlight:

  • How to connect and interact with SingleStore using Drizzle ORM.
  • The Analytical Processing strengths of SingleStore through practical endpoints and queries.
  • How to seed the database with custom data for demos or testing.

Tech Stack

  • Database: SingleStore (cloud or self-hosted)
  • ORM: Drizzle ORM
  • Web Framework: Hono (TypeScript)
  • Seeding: drizzle-seed

Features

  • Events Table: Stores event data for analytics and demo purposes.
  • Backend Endpoints: Several API endpoints demonstrate SingleStore’s analytical query power (e.g., aggregations, groupings, time-based queries).
  • Seeding: Easily populate the database with realistic event data using drizzle-seed
  • Type Safety: End-to-end type safety with TypeScript and Drizzle.

Getting Started

1. Clone the Repository

git clone https://github.com/drizzle-team/webinar-demo.git
cd webinar-demo

2. Install Dependencies

pnpm i

3. Configure Environment

Copy the example environment file and fill in your SingleStore connection details:

cp .env.example .env

Edit .env as needed.

4. Sync your database schema

pnpm drizzle-kit push

5. Start the Server

pnpm start

The server will start on the configured port (default: 3000).

API Endpoints

  • GET /total-pages — Get total number of page_views across all customers
  • GET /page-views?customer&start&end — Page Views by Customer & Time Frame
  • GET /daily-views?customer&start&end — Daily Page Views for a Customer
  • GET /top-10?customer&start&end — Top N Pages by Views
  • GET /unique-visitors?customer&start&end - Unique Visitors (Approximate)
  • POST /events — Add a new event

(See src/index.ts for more endpoints and details.)

Project Structure

src/
  index.ts           # Hono server and API endpoints
  database/
    schema.ts        # Drizzle ORM schema
drizzle.config.ts    # Drizzle configuration
.env.example         # Example environment variables

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published