LogoRobo.js
TemplatesDiscord bots

Prisma

A Discord bot template using Prisma ORM for data persistence.

Prisma

A bot using Prisma ORM and TypeScript for type-safe database access.

Getting Started

Create a project with this template:

npx create-robo@next <project-name> --template discord-bots/prisma-ts

Then navigate into your project directory:

cd <project-name>

Configure database connection in .env:

DATABASE_URL="postgresql://user:password@localhost:5432/mybot"

Run migrations:

npx prisma migrate dev

Run development mode:

npm run dev

Features

  • Prisma ORM integration
  • Type-safe database queries
  • Auto-generated client
  • Database migrations
create.ts/user create
fetch.ts/user fetch
_start.ts
_stop.ts
schema.prismaDatabase schema
.envDatabase URL

Schema Example

prisma/schema.prisma
model User {
  id        String   @id
  balance   Int      @default(0)
  createdAt DateTime @default(now())
}

Hosting

npm run deploy

On this page