Skip to content

feat: add demo database seeding for end-to-end exploration - #37

Merged
venkateshsakamuri-lab merged 1 commit into
mainfrom
cursor/seed-demo-data-c497
Aug 9, 2026
Merged

feat: add demo database seeding for end-to-end exploration#37
venkateshsakamuri-lab merged 1 commit into
mainfrom
cursor/seed-demo-data-c497

Conversation

@venkateshsakamuri-lab

Copy link
Copy Markdown
Contributor

Summary

Add a comprehensive demo seeding system that gives new users a ready-to-explore e-commerce database with realistic data and pre-configured recommendations. This allows users to immediately see DeepSQL's full capabilities without connecting their own database first.

What's Included

Demo Shop Database (docker/postgres/init/10_create_demo_shop.sql)

A realistic e-commerce database with:

  • 100 products across 6 categories (Electronics, Clothing, Home & Garden, Sports, Books, Health)
  • 500 customers with loyalty tiers (bronze, silver, gold, platinum)
  • 5,000+ orders spanning the last 2 years with realistic status distribution
  • 15,000+ order items with proper foreign key relationships
  • 1,500 product reviews with ratings and verification status
  • 10,000 inventory movements (purchases, sales, adjustments)
  • 50,000 audit log entries for growth pattern analysis

The schema includes intentionally suboptimal patterns that will trigger recommendations:

  • Missing composite indexes on frequently filtered columns
  • Separate single-column indexes that should be combined
  • A growing audit_log table (partition candidate)
  • Queries using functions on indexed columns (LOWER())

Seed Script (scripts/self-host/seed-demo-data.sh)

Orchestrates the full seeding process:

  1. Creates the demo_shop database with sample data
  2. Creates a "Demo Shop (E-commerce)" connection
  3. Seeds saved queries in the SQL Editor:
    • Revenue & Sales queries (daily revenue, top products, customer LTV)
    • Operations queries (low stock, pending shipments, inventory movements)
    • Analytics queries (category performance, customer tiers, hourly patterns)
    • Example slow queries demonstrating optimization opportunities
  4. Seeds performance data:
    • Slow query history with analysis results
    • Index recommendations with ROI metrics
    • Performance actions with prioritized tasks
  5. Seeds sample agent conversation history

Integration with Install

  • Set DEEPSQL_SEED_DEMO_DATA=1 to automatically seed during install
  • Can also run manually: ./scripts/self-host/seed-demo-data.sh
  • Added to useful commands list in install.sh output

Usage

Manual seeding after install:

./scripts/self-host/seed-demo-data.sh

Automatic seeding during install:

DEEPSQL_SEED_DEMO_DATA=1 ./scripts/self-host/install.sh

Testing

  • Verified SQL script creates all tables and data correctly
  • Verified shell script syntax passes bash -n
  • Tested demo_shop database creation with correct row counts:
    • 100 products, 500 customers, 5000 orders
    • 15000 order items, 1500 reviews, 10000 inventory movements
    • 50000 audit log entries

Environment Variables

Variable Default Description
DEEPSQL_SEED_DEMO_DATA 0 Set to 1 to seed during install
DEEPSQL_SEED_CONNECTION_NAME Demo Shop (E-commerce) Name for the demo connection
DEEPSQL_SEED_SKIP_DEMO_DB 0 Set to 1 to skip database creation

Files Changed

  • Added: docker/postgres/init/10_create_demo_shop.sql - E-commerce schema and data
  • Added: scripts/self-host/seed-demo-data.sh - Seeding orchestration script
  • Modified: scripts/self-host/install.sh - Optional demo seeding integration
  • Modified: .env.example - Document new environment variables
  • Modified: README.md - Document demo database and seed script
Open in Web Open in Cursor 

Add a comprehensive demo seeding system that gives new users a ready-to-explore
e-commerce database with:

- demo_shop database: 100 products, 500 customers, 5000+ orders with realistic
  data patterns including intentionally suboptimal queries for recommendations
- Pre-configured index recommendations and slow query analysis
- Sample saved queries in the SQL Editor (revenue reports, analytics, examples)
- Sample agent conversation history
- Scoped demo users (analyst, developer, viewer)

Usage:
  - Manual: ./scripts/self-host/seed-demo-data.sh
  - Auto during install: DEEPSQL_SEED_DEMO_DATA=1 ./scripts/self-host/install.sh

Files added:
  - docker/postgres/init/10_create_demo_shop.sql: E-commerce schema + sample data
  - scripts/self-host/seed-demo-data.sh: Orchestration script for full seeding

Files modified:
  - scripts/self-host/install.sh: Optional demo seeding integration
  - .env.example: Document new DEEPSQL_SEED_* environment variables
  - README.md: Document demo database and seed-demo-data.sh script

Co-authored-by: Venkat SF <venkatesh.sakamuri@stayflexi.com>
@venkateshsakamuri-lab
venkateshsakamuri-lab marked this pull request as ready for review August 9, 2026 13:02
@cursor

cursor Bot commented Aug 9, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@venkateshsakamuri-lab
venkateshsakamuri-lab merged commit ddae0a8 into main Aug 9, 2026
7 checks passed
@venkateshsakamuri-lab
venkateshsakamuri-lab deleted the cursor/seed-demo-data-c497 branch August 9, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants