graphql-engine/server/src-lib/Hasura
David Overton 26dfa3e718 Replace TableObjectType, etc. with the corresponding Logical Model types
## Description

This is the first step in making use of Logical Models with document databases such as MongoDB. As part of schema introspection, a data connector agent can supply a set of custom types that can be used to describe the schema for columns within the tables of the database (or _fields_ within a _document collection_ in MongoDB terminology).

Previously, we were storing these custom types as `TableObjectType`s within the `TableCoreInfo` for each table.

In this PR we
- replace the `TableObjectTypes` with `LogicalModel` types
- store these directly within the `DBObjectsIntrospection` instead of within the `TableCoreInfo` for each table. (The custom types are shared at the source level so there was no reason to have a separate set of types for each table.)
- When building the `SourceInfo`, we combine the `LogicalModel`s from `DBObjectsIntrospection` with `LogicalModel`s from the user's metadata to create the set of `LogicalModels` in the `SourceInfo` within the `SchemaCache`. I.e. we combine the set of types obtained by database introspection with the set of types specified by the user in the metadata. If two types have the same name, we use the type defined in the metadata.

## Limitations and future work

- Provide a way for the user to associate a meta-data defined `LogicalModel` with a table instead of requiring one to be provided by DB introspection
- Provide a way for the user to edit the  `LogicalModel` types provided by introspection and add them to the metadata.
- Allow a `LogicalModel` object type to describe and entire table rather than just individual columns.
- Better handling for "unknown" types, e.g. if the type of a collection (or part of a collection) is unknown we should treat it as a JSON scalar value. This may also involve adding an `_everything` field which returns the full document as a JSON scalar.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9345
GitOrigin-RevId: 5cec72fc1be1380d8600f7be547bbf71aad770bd
2023-05-30 14:05:46 +00:00
..
App Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
Backends Replace TableObjectType, etc. with the corresponding Logical Model types 2023-05-30 14:05:46 +00:00
Cache server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
Eventing Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
Function Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
GraphQL Replace TableObjectType, etc. with the corresponding Logical Model types 2023-05-30 14:05:46 +00:00
LogicalModel Move Logical Model parsers to Hasura.LogicalModel.Schema 2023-05-25 12:30:32 +00:00
LogicalModelResolver Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
Metadata Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
NativeQuery Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
QueryTags Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
RemoteSchema Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
RQL Replace TableObjectType, etc. with the corresponding Logical Model types 2023-05-30 14:05:46 +00:00
Server Catch ErrorCall in runHandler and expose it as a message with status 200 2023-05-30 12:32:45 +00:00
Services Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
SQL Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
StoredProcedure Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
Table Replace TableObjectType, etc. with the corresponding Logical Model types 2023-05-30 14:05:46 +00:00
Tracing Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
App.hs Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
ClientCredentials.hs Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
CredentialCache.hs server: Make HLint pass, by hook or by crook. 2023-04-25 14:03:02 +00:00
GC.hs Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
HTTP.hs Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
Logging.hs Catch ErrorCall in runHandler and expose it as a message with status 200 2023-05-30 12:32:45 +00:00
Name.hs chore(server): delete MySQL native backend 2023-05-05 10:32:56 +00:00
PingSources.hs Fix: Unable to use environment variable for CockroachDB connection string in Cloud 2023-02-14 12:15:58 +00:00
QueryTags.hs Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
Services.hs harmonize network manager handling 2023-02-22 15:55:54 +00:00
Session.hs Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
ShutdownLatch.hs multitenant: make shutdown logic more abstract 2022-11-23 07:53:19 +00:00
Tracing.hs PLAT-438: improve traces from OpenTelemetry 2023-04-26 16:21:29 +00:00