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
.
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.
- Database: SingleStore (cloud or self-hosted)
- ORM: Drizzle ORM
- Web Framework: Hono (TypeScript)
- Seeding: drizzle-seed
- 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.
git clone https://github.com/drizzle-team/webinar-demo.git
cd webinar-demo
pnpm i
Copy the example environment file and fill in your SingleStore connection details:
cp .env.example .env
Edit .env
as needed.
pnpm drizzle-kit push
pnpm start
The server will start on the configured port (default: 3000).
GET /total-pages
— Get total number of page_views across all customersGET /page-views?customer&start&end
— Page Views by Customer & Time FrameGET /daily-views?customer&start&end
— Daily Page Views for a CustomerGET /top-10?customer&start&end
— Top N Pages by ViewsGET /unique-visitors?customer&start&end
- Unique Visitors (Approximate)POST /events
— Add a new event
(See src/index.ts
for more endpoints and details.)
src/
index.ts # Hono server and API endpoints
database/
schema.ts # Drizzle ORM schema
drizzle.config.ts # Drizzle configuration
.env.example # Example environment variables
MIT