Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include shadowDatabaseUrl in datamodel rendering
It was previously not included in the lowering of the datamodel to an AST (after introspection). closes prisma/prisma#7337
- Loading branch information
Showing
3 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use datamodel::{parse_schema, render_datamodel_and_config_to_string}; | ||
use indoc::indoc; | ||
|
||
#[test] | ||
fn shadow_database_url_round_trips() { | ||
let schema_str = indoc!( | ||
r#" | ||
datasource myds { | ||
provider = "postgresql" | ||
url = "postgres://" | ||
shadowDatabaseUrl = env("EMPTY_SHADOW_DB URL_0129") | ||
} | ||
model Cat { | ||
id Int @id | ||
name String | ||
} | ||
"# | ||
); | ||
|
||
let parsed = parse_schema(schema_str).unwrap(); | ||
let (ref config, ref datamodel) = parsed.subject; | ||
|
||
let rendered = render_datamodel_and_config_to_string(datamodel, config); | ||
|
||
assert_eq!(schema_str, rendered); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod configuration; | ||
pub mod literals; | ||
pub mod simplification; |