graphql-engine/server/src-lib/Hasura/Backends/MSSQL
Samir Talwar eab4f75212 An ErrorMessage type, to encapsulate.
This introduces an `ErrorMessage` newtype which wraps `Text` in a manner which is designed to be easy to construct, and difficult to deconstruct.

It provides functionality similar to `Data.Text.Extended`, but designed _only_ for error messages. Error messages are constructed through `fromString`, concatenation, or the `toErrorValue` function, which is designed to be overridden for all meaningful domain types that might show up in an error message. Notably, there are not and should never be instances of `ToErrorValue` for `String`, `Text`, `Int`, etc. This is so that we correctly represent the value in a way that is specific to its type. For example, all `Name` values (from the _graphql-parser-hs_ library) are single-quoted now; no exceptions.

I have mostly had to add `instance ToErrorValue` for various backend types (and also add newtypes where necessary). Some of these are not strictly necessary for this changeset, as I had bigger aspirations when I started. These aspirations have been tempered by trying and failing twice.

As such, in this changeset, I have started by introducing this type to the `parseError` and `parseErrorWith` functions. In the future, I would like to extend this to the `QErr` record and the various `throwError` functions, but this is a much larger task and should probably be done in stages.

For now, `toErrorMessage` and `fromErrorMessage` are provided for conversion to and from `Text`, but the intent is to stop exporting these once all error messages are converted to the new type.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5018
GitOrigin-RevId: 84b37e238992e4312255a87ca44f41af65e2d89a
2022-07-18 20:27:06 +00:00
..
DDL An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
Execute Move SchemaOptions to its own module, remove magic bools 2022-07-14 17:59:01 +00:00
FromIr Move SchemaOptions to its own module, remove magic bools 2022-07-14 17:59:01 +00:00
Instances An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
Schema Move MkTypename and NamingCase into their own modules. 2022-07-12 14:01:28 +00:00
SQL Remove RQL/Types.hs 2022-04-27 13:58:47 +00:00
Types An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
Connection.hs server/MSSQL: Event Delivery System (Incremental PR - 3) 2022-04-21 07:20:34 +00:00
DDL.hs Move MkTypename and NamingCase into their own modules. 2022-07-12 14:01:28 +00:00
FromIr.hs Tidy up MSSQL.FromIr 2022-03-10 10:34:52 +00:00
Meta.hs An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
Plan.hs server: Remove the Show instance from QErr and anything that touches it. 2022-07-01 11:48:26 +00:00
ToQuery.hs server: fix create event trigger failure on tables with MSSQL reserved keywords as name 2022-06-15 17:11:44 +00:00
Types.hs Add docstrings to the module headers of a few selected mssql modules 2022-01-03 17:17:18 +00:00