graphql-engine/server
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
..
benchmarks server/benchmarks: remove introspection from throughput benchmarks 2023-05-11 17:50:03 +00:00
documentation chore(server): delete MySQL native backend 2023-05-05 10:32:56 +00:00
lib feature(server): comparable computed field aggregations for Postgres 2023-05-25 12:55:29 +00:00
src-emit-metadata-openapi harmonize network manager handling 2023-02-22 15:55:54 +00:00
src-exec Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
src-lib Replace TableObjectType, etc. with the corresponding Logical Model types 2023-05-30 14:05:46 +00:00
src-rsr ci: tag release v2.26.0 2023-05-29 11:26:37 +00:00
src-test Replace TableObjectType, etc. with the corresponding Logical Model types 2023-05-30 14:05:46 +00:00
test-manual server/test-manual: A way to start PostgreSQL with a read replica. 2023-03-28 09:20:51 +00:00
test-mssql Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
test-postgres Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
tests-py Remove TemplateHaskell Aeson instances from RQL.Types 2023-05-05 14:38:00 +00:00
.dockerignore update packages (#251) 2018-08-08 13:10:13 +05:30
.gitignore server: Clean up Cabal project files 2022-04-07 07:16:12 +00:00
.ormolu Upgrade Ormolu to v0.5. 2022-11-02 20:55:13 +00:00
commit_diff.txt Rewrite GraphQL schema generation and query parsing (close #2801) (#4111) 2020-08-21 12:27:01 -05:00
COMPILING-ON-MACOS.md chore(server): delete MySQL native backend 2023-05-05 10:32:56 +00:00
CONTRIBUTING.md nix: Switch to nixpkgs-unstable. 2023-03-24 20:36:48 +00:00
graphql-engine.cabal Implement get_table_info for Postgres, Citus, and Cockroach 2023-05-25 09:32:12 +00:00
Makefile ci: misc. cleanup, naming 2022-01-03 06:26:39 +00:00
STYLE.md Nix: Use nixpkgs-fmt to format everything. 2022-06-20 13:02:45 +00:00
testing-guidelines.md Extract the test harness from the Hspec tests 2022-10-04 08:31:26 +00:00
troubleshooting.md Create troubleshooting.md 2022-05-30 09:18:44 +00:00
VERSIONS.json Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00