diff --git a/generator-prisma-client/bun-with-prisma-driver-adapters/.env.example b/generator-prisma-client/bun-with-prisma-driver-adapters/.env.example deleted file mode 100644 index d6569b9128b4..000000000000 --- a/generator-prisma-client/bun-with-prisma-driver-adapters/.env.example +++ /dev/null @@ -1,2 +0,0 @@ -DATABASE_URL="" -DIRECT_URL="" diff --git a/generator-prisma-client/bun-with-prisma-driver-adapters/.gitignore b/generator-prisma-client/bun-with-prisma-driver-adapters/.gitignore deleted file mode 100644 index a0b63f9253f2..000000000000 --- a/generator-prisma-client/bun-with-prisma-driver-adapters/.gitignore +++ /dev/null @@ -1,180 +0,0 @@ -# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore - -# Logs - -logs -_.log -npm-debug.log_ -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* - -index -prisma/migrations -# Caches - -.cache - -# Diagnostic reports (https://nodejs.org/api/report.html) - -report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json - -# Runtime data - -pids -_.pid -_.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover - -lib-cov - -# Coverage directory used by tools like istanbul - -coverage -*.lcov - -# nyc test coverage - -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) - -.grunt - -# Bower dependency directory (https://bower.io/) - -bower_components - -# node-waf configuration - -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) - -build/Release - -# Dependency directories - -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) - -web_modules/ - -# TypeScript cache - -*.tsbuildinfo - -# Optional npm cache directory - -.npm - -# Optional eslint cache - -.eslintcache - -# Optional stylelint cache - -.stylelintcache - -# Microbundle cache - -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history - -.node_repl_history - -# Output of 'npm pack' - -*.tgz - -# Yarn Integrity file - -.yarn-integrity - -# dotenv environment variable files - -.env -.env.development.local -.env.test.local -.env.production.local -.env.local - -# parcel-bundler cache (https://parceljs.org/) - -.parcel-cache - -# Next.js build output - -.next -out - -# Nuxt.js build / generate output - -.nuxt -dist - -# Gatsby files - -# Comment in the public line in if your project uses Gatsby and not Next.js - -# https://nextjs.org/blog/next-9-1#public-directory-support - -# public - -# vuepress build output - -.vuepress/dist - -# vuepress v2.x temp and cache directory - -.temp - -# Docusaurus cache and generated files - -.docusaurus - -# Serverless directories - -.serverless/ - -# FuseBox cache - -.fusebox/ - -# DynamoDB Local files - -.dynamodb/ - -# TernJS port file - -.tern-port - -# Stores VSCode versions used for testing VSCode extensions - -.vscode-test - -# yarn v2 - -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* - -# IntelliJ based IDEs -.idea - -# Finder (MacOS) folder config -.DS_Store - -/generated/prisma -bun.lockb diff --git a/generator-prisma-client/bun-with-prisma-driver-adapters/README.md b/generator-prisma-client/bun-with-prisma-driver-adapters/README.md deleted file mode 100644 index be82d91eb666..000000000000 --- a/generator-prisma-client/bun-with-prisma-driver-adapters/README.md +++ /dev/null @@ -1,143 +0,0 @@ -# Bun + Prisma ORM + Driver Adapters example - -## Introduction - -A simple web server using [Bun](https://bun.sh/) and [Prisma ORM](https://www.prisma.io/) with [Prisma Postgres](https://www.prisma.io/postgres). This example helps you build a Bun binary that starts a simple HTTP web server that returns all the users from the database. - -This example uses: - -- Bun's built-in HTTP server -- New [`prisma-client` generator](https://www.prisma.io/docs/orm/prisma-schema/overview/generators#prisma-client-preview) and the `bun` runtime -- [Driver Adapters (`node-postgres` driver)](https://www.prisma.io/docs/orm/overview/databases/postgresql#using-the-node-postgres-driver) - -## Prerequisites - -- **Bun**: Make sure you have Bun installed on your system. If not, install it from [bun.sh](https://bun.sh/) -- **Database**: Use a Prisma Postgres database or any other supported database by Prisma. This example uses [Prisma Postgres](https://www.prisma.io/postgres). - -## Getting started - -### 1. Set up environment variables - -Copy the [`.env.example`](./.env.example) file to `.env`: - -```bash -cp .env.example .env -``` - -Run the following command to receive a temporary Prisma Postgres database connection string: - -```bash -npx create-db -``` - -You should have a similar output to the following: - -```bash -┌ 🚀 Creating a Prisma Postgres database -│ -│ Provisioning a temporary database in us-east-1... -│ -│ It will be automatically deleted in 24 hours, but you can claim it. -│ -◇ Database created successfully! -│ -│ -● Connect to your database → -│ -│ Use this connection string optimized for Prisma ORM: -│ -│ $DATABASE_URL -│ -│ -│ Use this connection string for everything else: -│ -│ $DIRECT_URL -│ -│ -◆ Claim your database → -│ -│ Want to keep your database? Claim for free via this link: -│ -│ https://create-db.prisma.io?projectID=proj_cmf0tcods01d6z1ff9eyvqgd0&utm_source=create-db&utm_medium=cli -│ -│ Your temporary database will be deleted in 24 hours if not claimed. -│ -└ -``` - -Get the database URL and paste it in your `.env` file: - -```bash -DATABASE_URL="your_prisma_postgres_connection_string_here" -DIRECT_URL="your_direct_connection_string_here" -``` - -- The `DATABASE_URL` is the connection string optimized for Prisma ORM and helps you perform migrations. -- The `DIRECT_URL` is the connection string for everything else and in this case helps you [perform database queries](./db.ts) using driver adapters. - -> Learn more about `npx create-db` [in our docs](https://www.prisma.io/docs/postgres/introduction/npx-create-db). - -### 2. Install dependencies - -```bash -bun install -``` - -### 3. Run migrations and seed the database - -Create a new migration: - -```bash -bun prisma migrate dev -``` - -Generate the Prisma client: - -```bash -bun prisma generate -``` - -Seed the database: - -```bash -bun prisma db seed -``` - -### 4. Start the server - -```bash -bun run index.ts -``` - -Server runs on `http://localhost:3000` and whenever it is visited it returns all the users in the database. - -### 5. Build and run a Bun executable - -Build the executable: - -```bash -bun build --compile index.ts -``` - -Run the executable: - -```bash -./index -``` - -You should see `Listening on http://localhost:3000` in the console, and when you visit `http://localhost:3000` in your browser, you should see the list of users in the database. - -## Project structure - -```text -├── prisma/ -│ └── schema.prisma # Database schema and Prisma configuration -│ └── seed.ts # Database seed file -├── generated/ # Generated Prisma Client (custom output location) -├── db.ts # Database connection with Prisma driver adapters -├── index.ts # Main server file -├── package.json # Dependencies and scripts -├── prisma.config.ts # Prisma configuration -└── .env.example # Environment variables template -``` diff --git a/generator-prisma-client/bun-with-prisma-driver-adapters/db.ts b/generator-prisma-client/bun-with-prisma-driver-adapters/db.ts deleted file mode 100644 index 8de364027760..000000000000 --- a/generator-prisma-client/bun-with-prisma-driver-adapters/db.ts +++ /dev/null @@ -1,9 +0,0 @@ -import 'dotenv/config' -import { PrismaClient } from './generated/prisma/client' -import { PrismaPg } from '@prisma/adapter-pg' - -const connectionString = `${process.env.DIRECT_URL}` - -const adapter = new PrismaPg({ connectionString }) - -export const prisma = new PrismaClient({ adapter }) diff --git a/generator-prisma-client/bun-with-prisma-driver-adapters/index.ts b/generator-prisma-client/bun-with-prisma-driver-adapters/index.ts deleted file mode 100644 index 55a52aba7a1d..000000000000 --- a/generator-prisma-client/bun-with-prisma-driver-adapters/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { prisma } from './db' - -const server = Bun.serve({ - port: 3000, - async fetch(req) { - const { pathname } = new URL(req.url) - - // Ignore favicon requests - if (pathname === '/favicon.ico') { - return new Response(null, { status: 204 }) // or serve an icon if you have one - } - - // Return all users - const users = await prisma.user.findMany() - - // Count all users - const count = await prisma.user.count() - - // Format the response with JSON - return new Response( - JSON.stringify({ - users: users, - totalUsers: count, - }), - { headers: { 'Content-Type': 'application/json' } }, - ) - }, -}) - -console.log(`Listening on http://localhost:${server.port}`) diff --git a/generator-prisma-client/bun-with-prisma-driver-adapters/package.json b/generator-prisma-client/bun-with-prisma-driver-adapters/package.json deleted file mode 100644 index c91cfb507b52..000000000000 --- a/generator-prisma-client/bun-with-prisma-driver-adapters/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "bun", - "module": "index.ts", - "type": "module", - "devDependencies": { - "bun-types": "1.2.23", - "prisma": "6.15.0" - }, - "peerDependencies": { - "typescript": "5.9.2" - }, - "dependencies": { - "@prisma/adapter-pg": "6.15.0", - "@prisma/client": "6.15.0", - "add": "2.0.6", - "bun": "1.2.21", - "dotenv": "17.2.2" - } -} diff --git a/generator-prisma-client/bun-with-prisma-driver-adapters/prisma.config.ts b/generator-prisma-client/bun-with-prisma-driver-adapters/prisma.config.ts deleted file mode 100644 index fc1870fe046a..000000000000 --- a/generator-prisma-client/bun-with-prisma-driver-adapters/prisma.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import 'dotenv/config' -import { defineConfig } from 'prisma/config' - -export default defineConfig({ - migrations: { - seed: `bun run prisma/seed.ts`, - }, -}) diff --git a/generator-prisma-client/bun-with-prisma-driver-adapters/prisma/schema.prisma b/generator-prisma-client/bun-with-prisma-driver-adapters/prisma/schema.prisma deleted file mode 100644 index fb2431fb101a..000000000000 --- a/generator-prisma-client/bun-with-prisma-driver-adapters/prisma/schema.prisma +++ /dev/null @@ -1,23 +0,0 @@ -// This is your Prisma schema file, -// learn more about it in the docs: https://pris.ly/d/prisma-schema - -// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions? -// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init - -generator client { - provider = "prisma-client" - output = "../generated/prisma" - previewFeatures = ["driverAdapters", "queryCompiler"] - runtime = "bun" -} - -datasource db { - provider = "postgresql" - url = env("DATABASE_URL") -} - -model User { - id Int @id @default(autoincrement()) - email String @unique - name String? -} diff --git a/generator-prisma-client/bun-with-prisma-driver-adapters/prisma/seed.ts b/generator-prisma-client/bun-with-prisma-driver-adapters/prisma/seed.ts deleted file mode 100644 index bd52ddf19b0f..000000000000 --- a/generator-prisma-client/bun-with-prisma-driver-adapters/prisma/seed.ts +++ /dev/null @@ -1,34 +0,0 @@ -// prisma/seed.ts -import { PrismaClient } from '../generated/prisma/client' - -const prisma = new PrismaClient() - -async function main() { - // Create multiple users - await prisma.user.createMany({ - data: [ - { email: 'alice@example.com', name: 'Alice' }, - { email: 'bob@example.com', name: 'Bob' }, - { email: 'charlie@example.com', name: 'Charlie' }, - { email: 'diana@example.com', name: 'Diana' }, - { email: 'eve@example.com', name: 'Eve' }, - { email: 'frank@example.com', name: 'Frank' }, - { email: 'grace@example.com', name: 'Grace' }, - { email: 'henry@example.com', name: 'Henry' }, - { email: 'isabella@example.com', name: 'Isabella' }, - { email: 'jack@example.com', name: 'Jack' }, - ], - skipDuplicates: true, // prevents errors if you run the seed multiple times - }) - - console.log('Seed data inserted!') -} - -main() - .catch((e) => { - console.error(e) - process.exit(1) - }) - .finally(async () => { - await prisma.$disconnect() - }) diff --git a/generator-prisma-client/bun-with-prisma-driver-adapters/tsconfig.json b/generator-prisma-client/bun-with-prisma-driver-adapters/tsconfig.json deleted file mode 100644 index 7556e1d4b08f..000000000000 --- a/generator-prisma-client/bun-with-prisma-driver-adapters/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "lib": ["ESNext"], - "module": "esnext", - "target": "esnext", - "moduleResolution": "bundler", - "moduleDetection": "force", - "allowImportingTsExtensions": true, - "noEmit": true, - "composite": true, - "strict": true, - "downlevelIteration": true, - "skipLibCheck": true, - "jsx": "react-jsx", - "allowSyntheticDefaultImports": true, - "forceConsistentCasingInFileNames": true, - "allowJs": true, - "types": [ - "bun-types" // add Bun global - ] - } -} diff --git a/generator-prisma-client/bun/README.md b/generator-prisma-client/bun/README.md index c1f990a7b475..bbcce44ee2ae 100644 --- a/generator-prisma-client/bun/README.md +++ b/generator-prisma-client/bun/README.md @@ -47,7 +47,7 @@ bun install ### 3. Run database migrations ```bash -bun prisma migrate dev +bun --bun prisma migrate dev ``` ### 4. Start the server diff --git a/generator-prisma-client/bun/bun.lock b/generator-prisma-client/bun/bun.lock new file mode 100644 index 000000000000..2e515001b202 --- /dev/null +++ b/generator-prisma-client/bun/bun.lock @@ -0,0 +1,123 @@ +{ + "lockfileVersion": 1, + "workspaces": { + "": { + "name": "bun", + "dependencies": { + "@prisma/adapter-pg": "^6.18.0", + "@prisma/client": "^6.18.0", + }, + "devDependencies": { + "prisma": "^6.18.0", + }, + "peerDependencies": { + "typescript": "5.9.2", + }, + }, + }, + "packages": { + "@prisma/adapter-pg": ["@prisma/adapter-pg@6.18.0", "", { "dependencies": { "@prisma/driver-adapter-utils": "6.18.0", "pg": "^8.11.3", "postgres-array": "3.0.4" } }, "sha512-eBtBOL1z2Sh0Rc2hwa4dmwoNeFs5T69tsA62AkhBvnzNfTcr/YfLeJae/wjNmvRttYDPmdiuhqZCRPNY1+8fOA=="], + + "@prisma/client": ["@prisma/client@6.18.0", "", { "peerDependencies": { "prisma": "*", "typescript": ">=5.1.0" }, "optionalPeers": ["prisma", "typescript"] }, "sha512-jnL2I9gDnPnw4A+4h5SuNn8Gc+1mL1Z79U/3I9eE2gbxJG1oSA+62ByPW4xkeDgwE0fqMzzpAZ7IHxYnLZ4iQA=="], + + "@prisma/config": ["@prisma/config@6.18.0", "", { "dependencies": { "c12": "3.1.0", "deepmerge-ts": "7.1.5", "effect": "3.18.4", "empathic": "2.0.0" } }, "sha512-rgFzspCpwsE+q3OF/xkp0fI2SJ3PfNe9LLMmuSVbAZ4nN66WfBiKqJKo/hLz3ysxiPQZf8h1SMf2ilqPMeWATQ=="], + + "@prisma/debug": ["@prisma/debug@6.18.0", "", {}, "sha512-PMVPMmxPj0ps1VY75DIrT430MoOyQx9hmm174k6cmLZpcI95rAPXOQ+pp8ANQkJtNyLVDxnxVJ0QLbrm/ViBcg=="], + + "@prisma/driver-adapter-utils": ["@prisma/driver-adapter-utils@6.18.0", "", { "dependencies": { "@prisma/debug": "6.18.0" } }, "sha512-9wgSriEKs4j1ePxlv1/RNfJV9Gu5rzG37Neshg+DfrCcUY3amroERvTjyR04w5J1THdGdOTgGL9VdJcVaKRMmQ=="], + + "@prisma/engines": ["@prisma/engines@6.18.0", "", { "dependencies": { "@prisma/debug": "6.18.0", "@prisma/engines-version": "6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f", "@prisma/fetch-engine": "6.18.0", "@prisma/get-platform": "6.18.0" } }, "sha512-i5RzjGF/ex6AFgqEe2o1IW8iIxJGYVQJVRau13kHPYEL1Ck8Zvwuzamqed/1iIljs5C7L+Opiz5TzSsUebkriA=="], + + "@prisma/engines-version": ["@prisma/engines-version@6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f", "", {}, "sha512-T7Af4QsJQnSgWN1zBbX+Cha5t4qjHRxoeoWpK4JugJzG/ipmmDMY5S+O0N1ET6sCBNVkf6lz+Y+ZNO9+wFU8pQ=="], + + "@prisma/fetch-engine": ["@prisma/fetch-engine@6.18.0", "", { "dependencies": { "@prisma/debug": "6.18.0", "@prisma/engines-version": "6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f", "@prisma/get-platform": "6.18.0" } }, "sha512-TdaBvTtBwP3IoqVYoGIYpD4mWlk0pJpjTJjir/xLeNWlwog7Sl3bD2J0jJ8+5+q/6RBg+acb9drsv5W6lqae7A=="], + + "@prisma/get-platform": ["@prisma/get-platform@6.18.0", "", { "dependencies": { "@prisma/debug": "6.18.0" } }, "sha512-uXNJCJGhxTCXo2B25Ta91Rk1/Nmlqg9p7G9GKh8TPhxvAyXCvMNQoogj4JLEUy+3ku8g59cpyQIKFhqY2xO2bg=="], + + "@standard-schema/spec": ["@standard-schema/spec@1.0.0", "", {}, "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA=="], + + "c12": ["c12@3.1.0", "", { "dependencies": { "chokidar": "^4.0.3", "confbox": "^0.2.2", "defu": "^6.1.4", "dotenv": "^16.6.1", "exsolve": "^1.0.7", "giget": "^2.0.0", "jiti": "^2.4.2", "ohash": "^2.0.11", "pathe": "^2.0.3", "perfect-debounce": "^1.0.0", "pkg-types": "^2.2.0", "rc9": "^2.1.2" }, "peerDependencies": { "magicast": "^0.3.5" }, "optionalPeers": ["magicast"] }, "sha512-uWoS8OU1MEIsOv8p/5a82c3H31LsWVR5qiyXVfBNOzfffjUWtPnhAb4BYI2uG2HfGmZmFjCtui5XNWaps+iFuw=="], + + "chokidar": ["chokidar@4.0.3", "", { "dependencies": { "readdirp": "^4.0.1" } }, "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA=="], + + "citty": ["citty@0.1.6", "", { "dependencies": { "consola": "^3.2.3" } }, "sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ=="], + + "confbox": ["confbox@0.2.2", "", {}, "sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ=="], + + "consola": ["consola@3.4.2", "", {}, "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA=="], + + "deepmerge-ts": ["deepmerge-ts@7.1.5", "", {}, "sha512-HOJkrhaYsweh+W+e74Yn7YStZOilkoPb6fycpwNLKzSPtruFs48nYis0zy5yJz1+ktUhHxoRDJ27RQAWLIJVJw=="], + + "defu": ["defu@6.1.4", "", {}, "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg=="], + + "destr": ["destr@2.0.5", "", {}, "sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA=="], + + "dotenv": ["dotenv@16.6.1", "", {}, "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow=="], + + "effect": ["effect@3.18.4", "", { "dependencies": { "@standard-schema/spec": "^1.0.0", "fast-check": "^3.23.1" } }, "sha512-b1LXQJLe9D11wfnOKAk3PKxuqYshQ0Heez+y5pnkd3jLj1yx9QhM72zZ9uUrOQyNvrs2GZZd/3maL0ZV18YuDA=="], + + "empathic": ["empathic@2.0.0", "", {}, "sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA=="], + + "exsolve": ["exsolve@1.0.7", "", {}, "sha512-VO5fQUzZtI6C+vx4w/4BWJpg3s/5l+6pRQEHzFRM8WFi4XffSP1Z+4qi7GbjWbvRQEbdIco5mIMq+zX4rPuLrw=="], + + "fast-check": ["fast-check@3.23.2", "", { "dependencies": { "pure-rand": "^6.1.0" } }, "sha512-h5+1OzzfCC3Ef7VbtKdcv7zsstUQwUDlYpUTvjeUsJAssPgLn7QzbboPtL5ro04Mq0rPOsMzl7q5hIbRs2wD1A=="], + + "giget": ["giget@2.0.0", "", { "dependencies": { "citty": "^0.1.6", "consola": "^3.4.0", "defu": "^6.1.4", "node-fetch-native": "^1.6.6", "nypm": "^0.6.0", "pathe": "^2.0.3" }, "bin": { "giget": "dist/cli.mjs" } }, "sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA=="], + + "jiti": ["jiti@2.6.1", "", { "bin": { "jiti": "lib/jiti-cli.mjs" } }, "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ=="], + + "node-fetch-native": ["node-fetch-native@1.6.7", "", {}, "sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q=="], + + "nypm": ["nypm@0.6.2", "", { "dependencies": { "citty": "^0.1.6", "consola": "^3.4.2", "pathe": "^2.0.3", "pkg-types": "^2.3.0", "tinyexec": "^1.0.1" }, "bin": { "nypm": "dist/cli.mjs" } }, "sha512-7eM+hpOtrKrBDCh7Ypu2lJ9Z7PNZBdi/8AT3AX8xoCj43BBVHD0hPSTEvMtkMpfs8FCqBGhxB+uToIQimA111g=="], + + "ohash": ["ohash@2.0.11", "", {}, "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ=="], + + "pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="], + + "perfect-debounce": ["perfect-debounce@1.0.0", "", {}, "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA=="], + + "pg": ["pg@8.16.3", "", { "dependencies": { "pg-connection-string": "^2.9.1", "pg-pool": "^3.10.1", "pg-protocol": "^1.10.3", "pg-types": "2.2.0", "pgpass": "1.0.5" }, "optionalDependencies": { "pg-cloudflare": "^1.2.7" }, "peerDependencies": { "pg-native": ">=3.0.1" }, "optionalPeers": ["pg-native"] }, "sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw=="], + + "pg-cloudflare": ["pg-cloudflare@1.2.7", "", {}, "sha512-YgCtzMH0ptvZJslLM1ffsY4EuGaU0cx4XSdXLRFae8bPP4dS5xL1tNB3k2o/N64cHJpwU7dxKli/nZ2lUa5fLg=="], + + "pg-connection-string": ["pg-connection-string@2.9.1", "", {}, "sha512-nkc6NpDcvPVpZXxrreI/FOtX3XemeLl8E0qFr6F2Lrm/I8WOnaWNhIPK2Z7OHpw7gh5XJThi6j6ppgNoaT1w4w=="], + + "pg-int8": ["pg-int8@1.0.1", "", {}, "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw=="], + + "pg-pool": ["pg-pool@3.10.1", "", { "peerDependencies": { "pg": ">=8.0" } }, "sha512-Tu8jMlcX+9d8+QVzKIvM/uJtp07PKr82IUOYEphaWcoBhIYkoHpLXN3qO59nAI11ripznDsEzEv8nUxBVWajGg=="], + + "pg-protocol": ["pg-protocol@1.10.3", "", {}, "sha512-6DIBgBQaTKDJyxnXaLiLR8wBpQQcGWuAESkRBX/t6OwA8YsqP+iVSiond2EDy6Y/dsGk8rh/jtax3js5NeV7JQ=="], + + "pg-types": ["pg-types@2.2.0", "", { "dependencies": { "pg-int8": "1.0.1", "postgres-array": "~2.0.0", "postgres-bytea": "~1.0.0", "postgres-date": "~1.0.4", "postgres-interval": "^1.1.0" } }, "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA=="], + + "pgpass": ["pgpass@1.0.5", "", { "dependencies": { "split2": "^4.1.0" } }, "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug=="], + + "pkg-types": ["pkg-types@2.3.0", "", { "dependencies": { "confbox": "^0.2.2", "exsolve": "^1.0.7", "pathe": "^2.0.3" } }, "sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig=="], + + "postgres-array": ["postgres-array@3.0.4", "", {}, "sha512-nAUSGfSDGOaOAEGwqsRY27GPOea7CNipJPOA7lPbdEpx5Kg3qzdP0AaWC5MlhTWV9s4hFX39nomVZ+C4tnGOJQ=="], + + "postgres-bytea": ["postgres-bytea@1.0.0", "", {}, "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w=="], + + "postgres-date": ["postgres-date@1.0.7", "", {}, "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q=="], + + "postgres-interval": ["postgres-interval@1.2.0", "", { "dependencies": { "xtend": "^4.0.0" } }, "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ=="], + + "prisma": ["prisma@6.18.0", "", { "dependencies": { "@prisma/config": "6.18.0", "@prisma/engines": "6.18.0" }, "peerDependencies": { "typescript": ">=5.1.0" }, "optionalPeers": ["typescript"], "bin": { "prisma": "build/index.js" } }, "sha512-bXWy3vTk8mnRmT+SLyZBQoC2vtV9Z8u7OHvEu+aULYxwiop/CPiFZ+F56KsNRNf35jw+8wcu8pmLsjxpBxAO9g=="], + + "pure-rand": ["pure-rand@6.1.0", "", {}, "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA=="], + + "rc9": ["rc9@2.1.2", "", { "dependencies": { "defu": "^6.1.4", "destr": "^2.0.3" } }, "sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg=="], + + "readdirp": ["readdirp@4.1.2", "", {}, "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg=="], + + "split2": ["split2@4.2.0", "", {}, "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg=="], + + "tinyexec": ["tinyexec@1.0.1", "", {}, "sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw=="], + + "typescript": ["typescript@5.9.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A=="], + + "xtend": ["xtend@4.0.2", "", {}, "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="], + + "pg-types/postgres-array": ["postgres-array@2.0.0", "", {}, "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA=="], + } +} diff --git a/generator-prisma-client/bun/db.ts b/generator-prisma-client/bun/db.ts index dcea8eefb1cf..3e843785556e 100644 --- a/generator-prisma-client/bun/db.ts +++ b/generator-prisma-client/bun/db.ts @@ -1,4 +1,5 @@ -import { PrismaClient } from './generated/prisma/client' -import { withAccelerate } from '@prisma/extension-accelerate' +import { PrismaClient } from './prisma/generated/client' +import { PrismaPg } from "@prisma/adapter-pg" -export const prisma = new PrismaClient().$extends(withAccelerate()) +const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL }) +export const prisma = new PrismaClient({ adapter }) diff --git a/generator-prisma-client/bun/package.json b/generator-prisma-client/bun/package.json index f2a44f6df331..01466b40961f 100644 --- a/generator-prisma-client/bun/package.json +++ b/generator-prisma-client/bun/package.json @@ -3,14 +3,13 @@ "module": "index.ts", "type": "module", "devDependencies": { - "bun-types": "1.2.23", - "prisma": "6.15.0" + "prisma": "^6.18.0" }, "peerDependencies": { "typescript": "5.9.2" }, "dependencies": { - "@prisma/client": "6.15.0", - "@prisma/extension-accelerate": "2.0.2" + "@prisma/adapter-pg": "^6.18.0", + "@prisma/client": "^6.18.0" } -} +} \ No newline at end of file diff --git a/generator-prisma-client/bun/prisma.config.ts b/generator-prisma-client/bun/prisma.config.ts new file mode 100644 index 000000000000..7f5d2884c99f --- /dev/null +++ b/generator-prisma-client/bun/prisma.config.ts @@ -0,0 +1,12 @@ +import { defineConfig, env } from "prisma/config"; + +export default defineConfig({ + schema: "prisma/schema.prisma", + migrations: { + path: "prisma/migrations", + }, + engine: "classic", + datasource: { + url: env("DATABASE_URL"), + }, +}); diff --git a/generator-prisma-client/bun/prisma/schema.prisma b/generator-prisma-client/bun/prisma/schema.prisma index bbe101f86901..100949a5ac63 100644 --- a/generator-prisma-client/bun/prisma/schema.prisma +++ b/generator-prisma-client/bun/prisma/schema.prisma @@ -1,13 +1,11 @@ // This is your Prisma schema file, // learn more about it in the docs: https://pris.ly/d/prisma-schema -// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions? -// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init - generator client { - provider = "prisma-client" - output = "../generated/prisma" - runtime = "bun" + provider = "prisma-client" + output = "./generated/" + runtime = "bun" + engineType = "client" } datasource db { diff --git a/generator-prisma-client/deno-deploy/.env.example b/generator-prisma-client/deno-deploy/.env.example index 78e77b78fe31..50621abdac02 100644 --- a/generator-prisma-client/deno-deploy/.env.example +++ b/generator-prisma-client/deno-deploy/.env.example @@ -1,2 +1 @@ -DIRECT_URL="postgres://..." DATABASE_URL="prisma+postgres://..." diff --git a/generator-prisma-client/deno-deploy/README.md b/generator-prisma-client/deno-deploy/README.md index 5237db857b80..c5d25d9eb995 100644 --- a/generator-prisma-client/deno-deploy/README.md +++ b/generator-prisma-client/deno-deploy/README.md @@ -6,10 +6,7 @@ This project showcases how to use the Prisma ORM with Prisma Postgres in an ESM To successfully run the project, you will need the following: -- Two **Prisma Postgres** connection strings: - - Your **Prisma Postgres + Accelerate connection string** (containing your **Prisma API key**) which you can get by enabling Postgres in a project in your [Prisma Data Platform](https://pris.ly/pdp) account. You will use this connection string to run Prisma migrations. - - Your **Prisma Postgres direct TCP connection string** which you will use with Prisma Client. - Learn more in the [docs](https://www.prisma.io/docs/postgres/database/direct-connections). +- A **Prisma Postgres** connection string. You can create a project in your [Prisma Data Platform](https://pris.ly/pdp) account and enable Postgres to obtain one. ## Tech Stack @@ -47,21 +44,15 @@ Create a `.env` in the root of the project directory: touch .env ``` -Now, open the `.env` file and set the `DATABASE_URL` environment variables with the values of your connection string and your Prisma Postgres connection string: +Now, open the `.env` file and set the `DATABASE_URL` environment variable with your Prisma Postgres connection string: ```bash # .env -# Prisma Postgres connection string (used for migrations) DATABASE_URL="__YOUR_PRISMA_POSTGRES_CONNECTION_STRING__" - -# Postgres connection string (used for queries by Prisma Client) -DIRECT_URL="__YOUR_PRISMA_POSTGRES_DIRECT_CONNECTION_STRING__" ``` -Note that `__YOUR_PRISMA_POSTGRES_CONNECTION_STRING__` is a placeholder value that you need to replace with the values of your Prisma Postgres + Accelerate connection string. Notice that the Accelerate connection string has the following structure: `prisma+postgres://accelerate.prisma-data.net/?api_key=`. - -Note that `__YOUR_PRISMA_POSTGRES_DIRECT_CONNECTION_STRING__` is a placeholder value that you need to replace with the values of your Prisma Postgres direct TCP connection string. The direct connection string has the following structure: `postgres://:@:/`. +Replace `__YOUR_PRISMA_POSTGRES_CONNECTION_STRING__` with your actual Prisma Postgres connection string. ### 3. Generate Prisma Client diff --git a/generator-prisma-client/deno-deploy/deno.jsonc b/generator-prisma-client/deno-deploy/deno.jsonc index 73a7565f67fc..9eccb2ffb45b 100644 --- a/generator-prisma-client/deno-deploy/deno.jsonc +++ b/generator-prisma-client/deno-deploy/deno.jsonc @@ -10,10 +10,10 @@ "imports": { "@std/assert": "jsr:@std/assert@1", "@std/http": "jsr:@std/http@1", - "@prisma/adapter-pg": "npm:@prisma/adapter-pg@6.14.0", - "@prisma/client": "npm:@prisma/client@6.14.0", + "@prisma/adapter-pg": "npm:@prisma/adapter-pg@^6.18.0", + "@prisma/client": "npm:@prisma/client@^6.18.0", "dotenv": "npm:dotenv@^17.2.1", - "prisma": "npm:prisma@6.14.0" + "prisma": "npm:prisma@^6.18.0" }, "nodeModulesDir": "auto", "deploy": { diff --git a/generator-prisma-client/deno-deploy/deno.lock b/generator-prisma-client/deno-deploy/deno.lock index b01cc766f909..d964d39d3582 100644 --- a/generator-prisma-client/deno-deploy/deno.lock +++ b/generator-prisma-client/deno-deploy/deno.lock @@ -14,10 +14,10 @@ "jsr:@std/net@^1.0.4": "1.0.4", "jsr:@std/path@^1.1.1": "1.1.1", "jsr:@std/streams@^1.0.10": "1.0.10", - "npm:@prisma/adapter-pg@6.14.0": "6.14.0", - "npm:@prisma/client@6.14.0": "6.14.0_prisma@6.14.0", + "npm:@prisma/adapter-pg@^6.18.0": "6.18.0", + "npm:@prisma/client@^6.18.0": "6.18.0_prisma@6.18.0", "npm:dotenv@^17.2.1": "17.2.1", - "npm:prisma@6.14.0": "6.14.0" + "npm:prisma@^6.18.0": "6.18.0" }, "jsr": { "@std/assert@1.0.13": { @@ -75,16 +75,16 @@ } }, "npm": { - "@prisma/adapter-pg@6.14.0": { - "integrity": "sha512-heUCNPZ3f2Iv/JId280HCoN7NECWkYckC3K1cOKpTRRjiJv0mN0w99V91vBq7aHHTtlOVpfDPQbUMNAjMegIWg==", + "@prisma/adapter-pg@6.18.0": { + "integrity": "sha512-eBtBOL1z2Sh0Rc2hwa4dmwoNeFs5T69tsA62AkhBvnzNfTcr/YfLeJae/wjNmvRttYDPmdiuhqZCRPNY1+8fOA==", "dependencies": [ "@prisma/driver-adapter-utils", "pg", "postgres-array@3.0.4" ] }, - "@prisma/client@6.14.0_prisma@6.14.0": { - "integrity": "sha512-8E/Nk3eL5g7RQIg/LUj1ICyDmhD053STjxrPxUtCRybs2s/2sOEcx9NpITuAOPn07HEpWBfhAVe1T/HYWXUPOw==", + "@prisma/client@6.18.0_prisma@6.18.0": { + "integrity": "sha512-jnL2I9gDnPnw4A+4h5SuNn8Gc+1mL1Z79U/3I9eE2gbxJG1oSA+62ByPW4xkeDgwE0fqMzzpAZ7IHxYnLZ4iQA==", "dependencies": [ "prisma" ], @@ -93,8 +93,8 @@ ], "scripts": true }, - "@prisma/config@6.14.0": { - "integrity": "sha512-IwC7o5KNNGhmblLs23swnfBjADkacBb7wvyDXUWLwuvUQciKJZqyecU0jw0d7JRkswrj+XTL8fdr0y2/VerKQQ==", + "@prisma/config@6.18.0": { + "integrity": "sha512-rgFzspCpwsE+q3OF/xkp0fI2SJ3PfNe9LLMmuSVbAZ4nN66WfBiKqJKo/hLz3ysxiPQZf8h1SMf2ilqPMeWATQ==", "dependencies": [ "c12", "deepmerge-ts", @@ -102,20 +102,20 @@ "empathic" ] }, - "@prisma/debug@6.14.0": { - "integrity": "sha512-j4Lf+y+5QIJgQD4sJWSbkOD7geKx9CakaLp/TyTy/UDu9Wo0awvWCBH/BAxTHUaCpIl9USA5VS/KJhDqKJSwug==" + "@prisma/debug@6.18.0": { + "integrity": "sha512-PMVPMmxPj0ps1VY75DIrT430MoOyQx9hmm174k6cmLZpcI95rAPXOQ+pp8ANQkJtNyLVDxnxVJ0QLbrm/ViBcg==" }, - "@prisma/driver-adapter-utils@6.14.0": { - "integrity": "sha512-On9vTNiJ7J/O1kVqedLtfdhhrfRYprkUOhxjlmmWEv12WNdG6v5x4PsrfZXdBtZqRZaqK1i1TigO6IdtYh8z+A==", + "@prisma/driver-adapter-utils@6.18.0": { + "integrity": "sha512-9wgSriEKs4j1ePxlv1/RNfJV9Gu5rzG37Neshg+DfrCcUY3amroERvTjyR04w5J1THdGdOTgGL9VdJcVaKRMmQ==", "dependencies": [ "@prisma/debug" ] }, - "@prisma/engines-version@6.14.0-25.717184b7b35ea05dfa71a3236b7af656013e1e49": { - "integrity": "sha512-EgN9ODJpiX45yvwcngoStp3uQPJ3l+AEVoQ6dMMO2QvmwIlnxfApzKmJQExzdo7/hqQANrz5txHJdGYHzOnGHA==" + "@prisma/engines-version@6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f": { + "integrity": "sha512-T7Af4QsJQnSgWN1zBbX+Cha5t4qjHRxoeoWpK4JugJzG/ipmmDMY5S+O0N1ET6sCBNVkf6lz+Y+ZNO9+wFU8pQ==" }, - "@prisma/engines@6.14.0": { - "integrity": "sha512-LhJjqsALFEcoAtF07nSaOkVguaxw/ZsgfROIYZ8bAZDobe7y8Wy+PkYQaPOK1iLSsFgV2MhCO/eNrI1gdSOj6w==", + "@prisma/engines@6.18.0": { + "integrity": "sha512-i5RzjGF/ex6AFgqEe2o1IW8iIxJGYVQJVRau13kHPYEL1Ck8Zvwuzamqed/1iIljs5C7L+Opiz5TzSsUebkriA==", "dependencies": [ "@prisma/debug", "@prisma/engines-version", @@ -124,16 +124,16 @@ ], "scripts": true }, - "@prisma/fetch-engine@6.14.0": { - "integrity": "sha512-MPzYPOKMENYOaY3AcAbaKrfvXVlvTc6iHmTXsp9RiwCX+bPyfDMqMFVUSVXPYrXnrvEzhGHfyiFy0PRLHPysNg==", + "@prisma/fetch-engine@6.18.0": { + "integrity": "sha512-TdaBvTtBwP3IoqVYoGIYpD4mWlk0pJpjTJjir/xLeNWlwog7Sl3bD2J0jJ8+5+q/6RBg+acb9drsv5W6lqae7A==", "dependencies": [ "@prisma/debug", "@prisma/engines-version", "@prisma/get-platform" ] }, - "@prisma/get-platform@6.14.0": { - "integrity": "sha512-7VjuxKNwjnBhKfqPpMeWiHEa2sVjYzmHdl1slW6STuUCe9QnOY0OY1ljGSvz6wpG4U8DfbDqkG1yofd/1GINww==", + "@prisma/get-platform@6.18.0": { + "integrity": "sha512-uXNJCJGhxTCXo2B25Ta91Rk1/Nmlqg9p7G9GKh8TPhxvAyXCvMNQoogj4JLEUy+3ku8g59cpyQIKFhqY2xO2bg==", "dependencies": [ "@prisma/debug" ] @@ -191,8 +191,8 @@ "dotenv@17.2.1": { "integrity": "sha512-kQhDYKZecqnM0fCnzI5eIv5L4cAe/iRI+HqMbO/hbRdTAeXDG+M9FjipUxNfbARuEg4iHIbhnhs78BCHNbSxEQ==" }, - "effect@3.16.12": { - "integrity": "sha512-N39iBk0K71F9nb442TLbTkjl24FLUzuvx2i1I2RsEAQsdAdUTuUoW0vlfUXgkMTUOnYqKnWcFfqw4hK4Pw27hg==", + "effect@3.18.4": { + "integrity": "sha512-b1LXQJLe9D11wfnOKAk3PKxuqYshQ0Heez+y5pnkd3jLj1yx9QhM72zZ9uUrOQyNvrs2GZZd/3maL0ZV18YuDA==", "dependencies": [ "@standard-schema/spec", "fast-check" @@ -322,8 +322,8 @@ "xtend" ] }, - "prisma@6.14.0": { - "integrity": "sha512-QEuCwxu+Uq9BffFw7in8In+WfbSUN0ewnaSUKloLkbJd42w6EyFckux4M0f7VwwHlM3A8ssaz4OyniCXlsn0WA==", + "prisma@6.18.0": { + "integrity": "sha512-bXWy3vTk8mnRmT+SLyZBQoC2vtV9Z8u7OHvEu+aULYxwiop/CPiFZ+F56KsNRNf35jw+8wcu8pmLsjxpBxAO9g==", "dependencies": [ "@prisma/config", "@prisma/engines" @@ -358,10 +358,10 @@ "dependencies": [ "jsr:@std/assert@1", "jsr:@std/http@1", - "npm:@prisma/adapter-pg@6.14.0", - "npm:@prisma/client@6.14.0", + "npm:@prisma/adapter-pg@^6.18.0", + "npm:@prisma/client@^6.18.0", "npm:dotenv@^17.2.1", - "npm:prisma@6.14.0" + "npm:prisma@^6.18.0" ] } } diff --git a/generator-prisma-client/deno-deploy/prisma.config.ts b/generator-prisma-client/deno-deploy/prisma.config.ts index 3848fde0aca1..c08d289b1ffe 100644 --- a/generator-prisma-client/deno-deploy/prisma.config.ts +++ b/generator-prisma-client/deno-deploy/prisma.config.ts @@ -1,4 +1,4 @@ -import { defineConfig } from 'prisma/config' +import { defineConfig, env } from 'prisma/config' // Note: this wouldn't be needed if `deno task --env-file=.env ...` was supported. // See: https://github.com/denoland/deno/issues/27236 @@ -10,4 +10,8 @@ export default defineConfig({ path: './prisma/migrations', seed: 'deno run --allow-all ./prisma/seed.ts', }, -}) + engine: "classic", + datasource: { + url: env("DATABASE_URL"), + }, +}) \ No newline at end of file diff --git a/generator-prisma-client/deno-deploy/prisma/schema.prisma b/generator-prisma-client/deno-deploy/prisma/schema.prisma index cb7de696da85..43ed5e800d66 100644 --- a/generator-prisma-client/deno-deploy/prisma/schema.prisma +++ b/generator-prisma-client/deno-deploy/prisma/schema.prisma @@ -1,14 +1,13 @@ generator client { - provider = "prisma-client" - output = "../src/generated/prisma" - previewFeatures = ["driverAdapters", "queryCompiler"] - runtime = "deno" + provider = "prisma-client" + output = "./generated/" + runtime = "deno" + engineType = "client" } datasource db { - provider = "postgresql" - url = env("DATABASE_URL") - directUrl = env("DIRECT_URL") + provider = "postgresql" + url = env("DATABASE_URL") } enum QuoteKind { @@ -17,8 +16,8 @@ enum QuoteKind { } model Quotes { - id Int @id @default(autoincrement()) + id Int @id @default(autoincrement()) quote String kind QuoteKind @default(Opinion) - createdAt DateTime @default(now()) + createdAt DateTime @default(now()) } diff --git a/generator-prisma-client/deno-deploy/prisma/seed.ts b/generator-prisma-client/deno-deploy/prisma/seed.ts index d1dfb4ed6d58..e103c2d3d2d5 100644 --- a/generator-prisma-client/deno-deploy/prisma/seed.ts +++ b/generator-prisma-client/deno-deploy/prisma/seed.ts @@ -3,12 +3,12 @@ import { QuoteKind } from '../src/prisma-enums.ts' const main = async () => { console.log('Seeding database...') - - if (!Deno.env.get("DIRECT_URL")) { - throw new Error("DIRECT_URL environment variable is not set"); + + if (!Deno.env.get("DATABASE_URL")) { + throw new Error("DATABASE_URL environment variable is not set"); } - const prisma = getDb({ connectionString: Deno.env.get("DIRECT_URL")! }) + const prisma = getDb({ connectionString: Deno.env.get("DATABASE_URL")! }) console.time('Seeding complete 🌱') diff --git a/generator-prisma-client/deno-deploy/src/db.ts b/generator-prisma-client/deno-deploy/src/db.ts index 6730e7d16972..427be5d05638 100644 --- a/generator-prisma-client/deno-deploy/src/db.ts +++ b/generator-prisma-client/deno-deploy/src/db.ts @@ -1,5 +1,5 @@ import { PrismaPg } from '@prisma/adapter-pg' -import { PrismaClient } from './generated/prisma/client.ts' +import { PrismaClient } from '../prisma/generated/client.ts' export type GetDbParams = { connectionString: string diff --git a/generator-prisma-client/deno-deploy/src/main.ts b/generator-prisma-client/deno-deploy/src/main.ts index 9fac0be9acff..7ee4c6f526e0 100644 --- a/generator-prisma-client/deno-deploy/src/main.ts +++ b/generator-prisma-client/deno-deploy/src/main.ts @@ -6,12 +6,12 @@ export default { return new Response("Method Not Allowed", { status: 405 }); } - if (!Deno.env.get("DIRECT_URL")) { - return new Response("DIRECT_URL environment variable is not set", { status: 500 }); + if (!Deno.env.get("DATABASE_URL")) { + return new Response("DATABASE_URL environment variable is not set", { status: 500 }); } const prisma = getDb({ - connectionString: Deno.env.get("DIRECT_URL")!, + connectionString: Deno.env.get("DATABASE_URL")!, }); const quotes = await prisma.quotes.findMany({}) diff --git a/generator-prisma-client/deno-deploy/src/prisma-enums.ts b/generator-prisma-client/deno-deploy/src/prisma-enums.ts index dd3d8a37ea16..b91f951169c8 100644 --- a/generator-prisma-client/deno-deploy/src/prisma-enums.ts +++ b/generator-prisma-client/deno-deploy/src/prisma-enums.ts @@ -1 +1 @@ -export * from "./generated/prisma/enums.ts"; +export * from "../prisma/generated/enums.ts";