rtx install bun
rtx use -g bun
bun create elysia test-elysia
cd test-elysia
bun install prisma --save-dev
bun x prisma init --datasource-provider sqlite
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
model Fighter {
id Int @id @default(autoincrement())
name String @unique
skill String
created_at DateTime @default(now())
updated_at DateTime?
@@map("fighter")
}
# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
DATABASE_URL="file:./fighter.db"
bun x prisma migrate dev --name init-fighter-schema
bun x prisma generate
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
bun src/index.ts
or
bun start
or
./deploy.sh 1
# start with 4 instances
./deploy.sh 4