Function prisma_fmt::validate

source ·
pub fn validate(validate_params: String) -> Result<(), String>
Expand description

Function that throws a human-friendly error message when the schema is invalid, following the JSON formatting historically used by the Query Engine’s user_facing_errors::common::SchemaParserError. When the schema is valid, nothing happens. When the schema is invalid, the function displays a human-friendly error message indicating the schema lines where the errors lie and the total error count, e.g.:

The `referentialIntegrity` and `relationMode` attributes cannot be used together. Please use only `relationMode` instead.
  -->  schema.prisma:5
  |
4 |   relationMode         = "prisma"
5 |   referentialIntegrity = "foreignKeys"
6 | }
  |

Validation Error Count: 1

This function isn’t supposed to panic.