File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ export class DataSource {
7373 indentString ( `provider="${ this . provider } "\n` ) +
7474 indentString ( `url=${ this . url } \n` ) +
7575 ( this . directUrl ? indentString ( `directUrl=${ this . directUrl } \n` ) : '' ) +
76- ( this . shadowDatabaseUrl ? indentString ( `shadowDatabaseurl =${ this . shadowDatabaseUrl } \n` ) : '' ) +
76+ ( this . shadowDatabaseUrl ? indentString ( `shadowDatabaseUrl =${ this . shadowDatabaseUrl } \n` ) : '' ) +
7777 ( restFields ? restFields + '\n' : '' ) +
7878 `}`
7979 ) ;
Original file line number Diff line number Diff line change @@ -9,6 +9,31 @@ import PrismaSchemaGenerator from '../../src/plugins/prisma/schema-generator';
99import { loadModel } from '../utils' ;
1010
1111describe ( 'Prisma generator test' , ( ) => {
12+ it ( 'datasource coverage' , async ( ) => {
13+ const model = await loadModel ( `
14+ datasource db {
15+ provider = 'postgresql'
16+ url = env("DATABASE_URL")
17+ shadowDatabaseUrl = env("DATABASE_URL")
18+ }
19+
20+ model User {
21+ id String @id
22+ }
23+ ` ) ;
24+
25+ const { name } = tmp . fileSync ( { postfix : '.prisma' } ) ;
26+ await new PrismaSchemaGenerator ( ) . generate ( model , {
27+ name : 'Prisma' ,
28+ provider : '@core/prisma' ,
29+ schemaPath : 'schema.zmodel' ,
30+ output : name ,
31+ } ) ;
32+
33+ const content = fs . readFileSync ( name , 'utf-8' ) ;
34+ await getDMMF ( { datamodel : content } ) ;
35+ } ) ;
36+
1237 it ( 'field type coverage' , async ( ) => {
1338 const model = await loadModel ( `
1439 datasource db {
You can’t perform that action at this time.
0 commit comments