File tree Expand file tree Collapse file tree 3 files changed +5
-17
lines changed Expand file tree Collapse file tree 3 files changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ anyhow = "1.0.26"
8
8
colored = " 2"
9
9
structopt = " 0.3.8"
10
10
enumflags2 = " 0.7"
11
+ dmmf = { path = " ../../query-engine/dmmf" }
11
12
migration-core = { path = " ../../migration-engine/core" }
12
13
migration-connector = { path = " ../../migration-engine/connectors/migration-connector" }
13
14
introspection-core = { path = " ../../introspection-engine/core" }
Original file line number Diff line number Diff line change @@ -47,10 +47,6 @@ enum Command {
47
47
48
48
#[ derive( Debug , StructOpt ) ]
49
49
struct DmmfCommand {
50
- /// The path to the `query-engine` binary. Defaults to the value of the `PRISMA_BINARY_PATH`
51
- /// env var, or just `query-engine`.
52
- #[ structopt( env = "PRISMA_BINARY_PATH" , default_value = "query-engine" ) ]
53
- query_engine_binary_path : String ,
54
50
/// A database URL to introspect and generate DMMF for.
55
51
#[ structopt( long = "url" ) ]
56
52
url : Option < String > ,
@@ -340,19 +336,9 @@ async fn generate_dmmf(cmd: &DmmfCommand) -> anyhow::Result<()> {
340
336
}
341
337
} ;
342
338
343
- eprintln ! (
344
- "{} {}" ,
345
- "Using the query engine binary at" . yellow( ) ,
346
- cmd. query_engine_binary_path. bold( )
347
- ) ;
348
-
349
- let cmd = std:: process:: Command :: new ( & cmd. query_engine_binary_path )
350
- . arg ( "cli" )
351
- . arg ( "dmmf" )
352
- . env ( "PRISMA_DML_PATH" , schema_path)
353
- . spawn ( ) ?;
354
-
355
- cmd. wait_with_output ( ) ?;
339
+ let prisma_schema = std:: fs:: read_to_string ( schema_path) . unwrap ( ) ;
340
+ let result = dmmf:: dmmf_json_from_schema ( & prisma_schema) ;
341
+ println ! ( "{result}" ) ;
356
342
357
343
Ok ( ( ) )
358
344
}
You can’t perform that action at this time.
0 commit comments