graphql-engine/v3/crates/sql/src
Daniel Chambers e44589931c Reimplement most OpenDD newtypes using SmolStr and a macro (#797)
This PR replaces most of the string newtypes in the open-dds crate with
new implementations based on `SmolStr`, using a macro adapted from the
macro used in ndc-models. `SmolStr` usage should result in less heap
allocations and the macro ensures all the newtypes get all the same
trait implementations (such as various `From` and `Borrow` instances)
and helper impl functions (such as `as_str`).

The new macro, `str_newtype`, creates a newtype wrapper around `SmolStr`
or another type (typically `Identifier`), and writes out all the various
trait implementations. It also takes a documentation string which
ensures that every newtype has a description in JSON Schema.

The changes in the downstream crates are just adjusting to use the new
newtypes.

Also:
* `QueryGraphqlConfig` used a lot of String typed-properties; these have
been changed for the appropriate `GraphQlTypeName` and
`GraphQlFieldName` types.
* metadata-resolve had a duplicate newtype called
`ConnectorArgumentName`, which duplicated open-dds's
`DataConnectorArgumentName`. This has been removed and replaced.
* A new newtype called `CollectionName` has been added in open-dds to
represent the name of the ndc collection that a model points to. This
was previously just a string.
V3_GIT_ORIGIN_REV_ID: d5a33756ef0e110b2255478358a38e42e6ff89a2
2024-07-05 10:16:33 +00:00
..
catalog Experimental SQL interface (#742) 2024-06-25 18:46:39 +00:00
execute Reimplement most OpenDD newtypes using SmolStr and a macro (#797) 2024-07-05 10:16:33 +00:00
catalog.rs Experimental SQL interface (#742) 2024-06-25 18:46:39 +00:00
execute.rs Experimental SQL interface (#742) 2024-06-25 18:46:39 +00:00
lib.rs Experimental SQL interface (#742) 2024-06-25 18:46:39 +00:00
plan.rs Reimplement most OpenDD newtypes using SmolStr and a macro (#797) 2024-07-05 10:16:33 +00:00