Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/amanvarshney01/create-better-t-stack/llms.txt

Use this file to discover all available pages before exploring further.

Better-T-Stack supports multiple database systems with automatic ORM configuration and optional managed hosting setup.

Database Types

SQLite

Lightweight, server-less, embedded relational database.Best For:
  • Development and prototyping
  • Small to medium applications
  • Edge deployments (with Turso)
  • Applications with simple data needs
Supported ORMs:
  • Drizzle (recommended)
  • Prisma

PostgreSQL

Powerful, open source object-relational database system.Best For:
  • Production applications
  • Complex queries and transactions
  • Applications requiring ACID compliance
  • Large-scale data management
Supported ORMs:
  • Drizzle (recommended)
  • Prisma
Managed Hosting:
  • Neon
  • Supabase
  • Prisma Postgres

MySQL

Popular open-source relational database system.Best For:
  • Traditional web applications
  • Teams with MySQL experience
  • WordPress-adjacent projects
  • Wide hosting compatibility
Supported ORMs:
  • Drizzle (recommended)
  • Prisma
Managed Hosting:
  • PlanetScale

MongoDB

Open-source NoSQL database that stores data in JSON-like documents (BSON).Best For:
  • Flexible schema requirements
  • Document-oriented data
  • Rapid iteration
  • Hierarchical data structures
Supported ORMs:
  • Mongoose (recommended)
  • Prisma
Managed Hosting:
  • MongoDB Atlas
Runtime Restriction:
MongoDB is not available when using Cloudflare Workers runtime.

ORM Options

Better-T-Stack automatically configures your chosen ORM with the selected database.
Lightweight and performant TypeScript ORM.Features:
  • Type-safe queries
  • Zero runtime overhead
  • SQL-like syntax
  • Excellent TypeScript inference
  • Migration support
Best For:
  • Performance-critical applications
  • Developers who prefer SQL
  • Edge deployments
  • Workers runtime
Compatible Databases:
  • SQLite
  • PostgreSQL
  • MySQL
When Auto-Selected:
  • Workers runtime (default)
  • Any SQL database (recommended)

Database + ORM Compatibility Matrix

DatabaseDrizzlePrismaMongoose
SQLite✅ Recommended
PostgreSQL✅ Recommended
MySQL✅ Recommended
MongoDB✅ Recommended
NoneN/AN/AN/A

Managed Database Setup

During project creation, you can optionally set up managed database hosting:
Turso (Recommended)
  • Edge-replicated SQLite
  • Global distribution
  • HTTP-based access
  • Generous free tier
D1 (Cloudflare)
  • Cloudflare Workers integration
  • Edge-native SQLite
  • Serverless pricing
Neon
  • Serverless Postgres
  • Branch databases
  • Auto-scaling
  • Generous free tier
Supabase
  • Postgres + Auth + Storage
  • Real-time subscriptions
  • Built-in REST API
  • Full-featured platform
Prisma Postgres
  • Managed by Prisma
  • Optimized for Prisma ORM
  • Connection pooling
PlanetScale
  • Serverless MySQL
  • Database branching
  • Non-blocking schema changes
  • Built-in vitess
MongoDB Atlas
  • Official managed MongoDB
  • Global clusters
  • Automatic backups
  • Free tier available
Docker
  • Run any database locally
  • Consistent environments
  • Easy setup with docker-compose
  • Included in project scaffold
None
  • Manual database setup
  • Use existing database
  • Custom configuration

Runtime Compatibility

Cloudflare Workers Restrictions:
  • MongoDB is not available (no TCP connections)
  • Drizzle is recommended for SQLite/PostgreSQL/MySQL
  • Use HTTP-based database solutions (Turso, Neon, PlanetScale)

Backend Compatibility

Automatic Configuration:
  • Convex backend: No database/ORM needed (built-in data layer)
  • No backend: No database configuration
  • All other backends: Full database support

Choosing Your Database

1

Assess Your Data Model

  • Relational data: SQLite, PostgreSQL, MySQL
  • Document/flexible schema: MongoDB
  • Simple key-value: SQLite
2

Consider Your Scale

  • Prototype/MVP: SQLite
  • Production: PostgreSQL
  • High traffic: PostgreSQL or MySQL
  • Flexible schema: MongoDB
3

Check Runtime Constraints

  • Workers runtime: SQLite, PostgreSQL, or MySQL (HTTP-based)
  • Node/Bun: Any database
4

Select Your ORM

  • SQL databases: Drizzle (performance) or Prisma (features)
  • MongoDB: Mongoose or Prisma
  • Workers runtime: Drizzle

Schema Examples

// packages/db/src/schema.ts
import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core'

export const users = sqliteTable('users', {
  id: integer('id').primaryKey({ autoIncrement: true }),
  name: text('name').notNull(),
  email: text('email').notNull().unique(),
  createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),
})

Next Steps

Authentication

Add user authentication to your database

Deployment

Deploy your database and application

Build docs developers (and LLMs) love