Database
Define SQL tables in TypeScript and query them from your routes, with typed rows.
src/database.tsSame on every host
import { defineDatabase } from 'vite-hub/database'
import {
integer,
sqliteTable,
text,
} from 'drizzle-orm/sqlite-core'
// Your tables, written with Drizzle
export default defineDatabase({
schema: {
notes: sqliteTable('notes', {
id: integer('id').primaryKey(),
title: text('title').notNull(),
}),
},
})Deploy on
Node / Docker: SQLite / libSQL / Postgres
Tables in one file
Write your tables with Drizzle in
src/database.ts. ViteHub finds the file and makes migrations.Local first, hosted later
Use a local SQLite file while you develop. Move to Turso or Cloudflare D1 with the same routes.