mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
Add D1 Database (#335)
This commit is contained in:
@@ -85,6 +85,7 @@ export async function gatherConfig(
|
||||
flags.dbSetup,
|
||||
results.orm,
|
||||
results.backend,
|
||||
results.runtime,
|
||||
),
|
||||
git: () => getGitChoice(flags.git),
|
||||
packageManager: () => getPackageManagerChoice(flags.packageManager),
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { cancel, isCancel, select } from "@clack/prompts";
|
||||
import pc from "picocolors";
|
||||
import type { Backend, DatabaseSetup, ORM } from "../types";
|
||||
import type { Backend, DatabaseSetup, ORM, Runtime } from "../types";
|
||||
|
||||
export async function getDBSetupChoice(
|
||||
databaseType: string,
|
||||
dbSetup: DatabaseSetup | undefined,
|
||||
orm?: ORM,
|
||||
backend?: Backend,
|
||||
runtime?: Runtime,
|
||||
): Promise<DatabaseSetup> {
|
||||
if (backend === "convex") {
|
||||
return "none";
|
||||
@@ -32,6 +33,15 @@ export async function getDBSetupChoice(
|
||||
label: "Turso",
|
||||
hint: "SQLite for Production. Powered by libSQL",
|
||||
},
|
||||
...(runtime === "workers"
|
||||
? [
|
||||
{
|
||||
value: "d1" as const,
|
||||
label: "Cloudflare D1",
|
||||
hint: "Cloudflare's managed, serverless database with SQLite's SQL semantics",
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{ value: "none" as const, label: "None", hint: "Manual setup" },
|
||||
];
|
||||
} else if (databaseType === "postgres") {
|
||||
|
||||
Reference in New Issue
Block a user