File tree Expand file tree Collapse file tree 9 files changed +54
-52
lines changed
generator-prisma-client/deno-deploy Expand file tree Collapse file tree 9 files changed +54
-52
lines changed Original file line number Diff line number Diff line change 1- DIRECT_URL = " postgres://..."
21DATABASE_URL = " prisma+postgres://..."
Original file line number Diff line number Diff line change 1010 "imports" : {
1111 "@std/assert" : " jsr:@std/assert@1" ,
1212 "@std/http" : " jsr:@std/http@1" ,
13- "@prisma/adapter-pg" : " npm:@prisma/adapter-pg@6.14 .0" ,
14- "@prisma/client" : " npm:@prisma/client@6.14 .0" ,
13+ "@prisma/adapter-pg" : " npm:@prisma/adapter-pg@^6.18 .0" ,
14+ "@prisma/client" : " npm:@prisma/client@^6.18 .0" ,
1515 "dotenv" : " npm:dotenv@^17.2.1" ,
16- "prisma" : " npm:prisma@6.14 .0"
16+ "prisma" : " npm:prisma@^6.18 .0"
1717 },
1818 "nodeModulesDir" : " auto" ,
1919 "deploy" : {
Original file line number Diff line number Diff line change 1- import { defineConfig } from 'prisma/config'
1+ import { defineConfig , env } from 'prisma/config'
22
33// Note: this wouldn't be needed if `deno task --env-file=.env ...` was supported.
44// See: https://github.com/denoland/deno/issues/27236
@@ -10,4 +10,8 @@ export default defineConfig({
1010 path : './prisma/migrations' ,
1111 seed : 'deno run --allow-all ./prisma/seed.ts' ,
1212 } ,
13- } )
13+ engine : "classic" ,
14+ datasource : {
15+ url : env ( "DATABASE_URL" ) ,
16+ } ,
17+ } )
Original file line number Diff line number Diff line change 11generator client {
2- provider = " prisma-client "
3- output = " ../src/ generated/prisma "
4- previewFeatures = [ " driverAdapters " , " queryCompiler " ]
5- runtime = " deno "
2+ provider = " prisma-client "
3+ output = " ./ generated/ "
4+ runtime = " deno "
5+ engineType = " client "
66}
77
88datasource db {
9- provider = " postgresql "
10- url = env (" DATABASE_URL " )
11- directUrl = env (" DIRECT_URL " )
9+ provider = " postgresql "
10+ url = env (" DATABASE_URL " )
1211}
1312
1413enum QuoteKind {
@@ -17,8 +16,8 @@ enum QuoteKind {
1716}
1817
1918model Quotes {
20- id Int @id @default (autoincrement () )
19+ id Int @id @default (autoincrement () )
2120 quote String
2221 kind QuoteKind @default (Opinion )
23- createdAt DateTime @default (now () )
22+ createdAt DateTime @default (now () )
2423}
Original file line number Diff line number Diff line change @@ -3,12 +3,12 @@ import { QuoteKind } from '../src/prisma-enums.ts'
33
44const main = async ( ) => {
55 console . log ( 'Seeding database...' )
6-
7- if ( ! Deno . env . get ( "DIRECT_URL " ) ) {
8- throw new Error ( "DIRECT_URL environment variable is not set" ) ;
6+
7+ if ( ! Deno . env . get ( "DATABASE_URL " ) ) {
8+ throw new Error ( "DATABASE_URL environment variable is not set" ) ;
99 }
1010
11- const prisma = getDb ( { connectionString : Deno . env . get ( "DIRECT_URL " ) ! } )
11+ const prisma = getDb ( { connectionString : Deno . env . get ( "DATABASE_URL " ) ! } )
1212
1313 console . time ( 'Seeding complete 🌱' )
1414
Original file line number Diff line number Diff line change 11import { PrismaPg } from '@prisma/adapter-pg'
2- import { PrismaClient } from './generated/ prisma/client.ts'
2+ import { PrismaClient } from '../ prisma/generated /client.ts'
33
44export type GetDbParams = {
55 connectionString : string
Original file line number Diff line number Diff line change @@ -6,12 +6,12 @@ export default {
66 return new Response ( "Method Not Allowed" , { status : 405 } ) ;
77 }
88
9- if ( ! Deno . env . get ( "DIRECT_URL " ) ) {
10- return new Response ( "DIRECT_URL environment variable is not set" , { status : 500 } ) ;
9+ if ( ! Deno . env . get ( "DATABASE_URL " ) ) {
10+ return new Response ( "DATABASE_URL environment variable is not set" , { status : 500 } ) ;
1111 }
1212
1313 const prisma = getDb ( {
14- connectionString : Deno . env . get ( "DIRECT_URL " ) ! ,
14+ connectionString : Deno . env . get ( "DATABASE_URL " ) ! ,
1515 } ) ;
1616
1717 const quotes = await prisma . quotes . findMany ( { } )
Original file line number Diff line number Diff line change 1- export * from "./generated/ prisma/enums.ts" ;
1+ export * from "../ prisma/generated /enums.ts" ;
You can’t perform that action at this time.
0 commit comments