TurboETH includes support for prisma to automatically backend database bindings.

Quickly Create New Datbase

Quick Start

  1. Set the DATABASE_URL in the .env file to point to your existing database. If your database has no tables yet, read https://pris.ly/d/getting-started

  2. Set the provider of the datasource block in schema.prisma to match your database: postgresql, mysql, sqlite, sqlserver, mongodb or cockroachdb.

  3. Run prisma db pull to turn your database schema into a Prisma schema.

  4. Run prisma generate to generate the Prisma Client. You can then start querying your database.

More information in our documentation: https://pris.ly/d/getting-started

Integration

  • Schema - prisma/schema.prisma

Generate

Run the generate command to automatically generat database client with typings

Only required when adding updating the database schema.

pnpm prisma generate

Example

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "mongodb"
  url      = env("DATABASE_URL")
}

model User {
  id        String @id @map("_id")
  createdAt DateTime  @default(now())
  updatedAt DateTime  @updatedAt
  address   String
}