-
-
Notifications
You must be signed in to change notification settings - Fork 175
Open
Description
Add support for SingleStore as a database option with SingleStore Helios (managed cloud) as a database setup option. SingleStore is a high-performance distributed SQL database that combines the best of SQL and NoSQL, offering real-time analytics and operational workloads in a single platform.
Motivation
- Performance: SingleStore offers exceptional performance for both transactional and analytical workloads
- Modern Stack: Excellent TypeScript/Drizzle ORM integration with official support
- Cloud-First: Helios provides a managed, serverless experience similar to existing options (Neon, Turso)
- Developer Experience: Full Drizzle ORM compatibility with SingleStore-specific optimizations
- Growing Adoption: Increasing popularity in modern application development
Proposed Changes
Database Option
Add singlestore
to the database choices:
--database singlestore
Database Setup Option
Add singlestore-helios
to the database setup choices:
--db-setup singlestore-helios
Example Usage
# SingleStore with Helios cloud setup
bun create better-t-stack@latest my-app --database singlestore --db-setup singlestore-helios --orm drizzle
# SingleStore with basic setup (self-hosted)
bun create better-t-stack@latest my-app --database singlestore --db-setup none --orm drizzle
Technical Implementation Details
ORM Compatibility
- Drizzle: ✅ Full support (only supported ORM)
- Prisma: ❌ Not supported by SingleStore
- Mongoose: ❌ Not applicable (SQL database)
Connection Requirements
- Driver:
mysql2
(SingleStore uses MySQL protocol) - Drizzle Dialect:
drizzle-orm/singlestore
- Connection String Format:
singlestore://username:password@host:port/database?ssl={}
SingleStore-Specific Features
// Example schema with SingleStore-specific types
import { singlestoreTable, bigint, varchar, json, vector } from 'drizzle-orm/singlestore-core';
export const users = singlestoreTable('users', {
id: bigint('id', { mode: 'number' }).autoincrement().primaryKey(), // Use bigint, not serial
name: varchar({ length: 255 }).notNull(),
metadata: json('metadata'),
embedding: vector({ dimensions: 1536 }), // AI/ML vector support
});
Environment Configuration
SingleStore Helios
# Connection string format (SSL required)
DATABASE_URL="singlestore://username:password@host:port/database?ssl={}"
Drizzle Configuration
// drizzle.config.ts
import { defineConfig } from "drizzle-kit";
export default defineConfig({
schema: "./src/db/schema",
out: "./src/db/migrations",
dialect: "singlestore", // SingleStore-specific dialect
dbCredentials: {
url: process.env.DATABASE_URL,
},
});
Breaking Changes
None. This is a purely additive feature that doesn't affect existing functionality.
References
I can start working on this feature if there's interest from the maintainers. Let me know if you'd like me to proceed with a PR implementing this functionality. I work at SingleStore btw.
/cc @AmanVarshney01
Metadata
Metadata
Assignees
Labels
No labels