Commit Graph

14 Commits

Author SHA1 Message Date
Daniel Harvey
4e89dd40eb Use BooleanExpressionType in new plan filtering (#1334)
<!-- The PR description should answer 2 important questions: -->

### What

Previously the OpenDD pipeline has ignored `BooleanExpressionType` as
they were not available outside GraphQL. Now they are, so we use them,
and test them in the JSONAPI pipeline.

This means that the SQL frontend cannot use filtering unless models have
a `BooleanExpressionType` defined. These are generated by the CLI, so
hopefully this is fine.

Depends on #1336

V3_GIT_ORIGIN_REV_ID: 4037585ef36bc99c99a482361084ccd09c5c6bb1
2024-11-14 16:27:47 +00:00
paritosh-08
104365205c wip: plan refactor type changes (part 1) (#1339)
---------

Co-authored-by: Anon Ray <ecthiender@users.noreply.github.com>
V3_GIT_ORIGIN_REV_ID: c1b88c89d2ad9ad80e20a1763f036db85798ec3b
2024-11-13 06:41:46 +00:00
Daniel Harvey
056b1c18fc Stop Nix rebuilding (#1329)
<!-- The PR description should answer 2 important questions: -->

### What

Our Nix build was building all the workspace crates as part of it's deps
step. This means when any library crate is changed, we throw away all
the caching, which isn't ideal. This filters the source files out of
those builds, so that we get more cache hits. We also move all Cargo
features into the workspace, which I've been meaning to do for ages, so
things are more consistent, and again, we get more cache hits generally.

V3_GIT_ORIGIN_REV_ID: c724b152692575edf6c00ab426e48ecca13aa998
2024-11-11 12:06:31 +00:00
Daniel Harvey
1879d1bb75 Enable argument presets in OpenDD pipeline (#1228)
<!-- The PR description should answer 2 important questions: -->

### What

This PR enables argument presets in the OpenDD pipeline by using
functions from `graphql_ir`. In the ideal future we'd flip the
dependency and move these functions out of `graphql_ir` and into the
`plan` crate, however we can't do that until `execute` crate is no
longer in active development as it will involve making a big mess there.

### How

- Calculate argument presets in the `plan/query/model_target` module
using functions from `graphql_ir`
- We also begin adding boolean expression resolve, then back away slowly
as it's a massive job and better tackled when we start making `where`
clauses work in this pipeline, to stop this PR ballooning insanely.

V3_GIT_ORIGIN_REV_ID: 47867452b7366e83f71b118e37302de93d9bde72
2024-10-17 10:48:04 +00:00
Daniel Harvey
79decc86e2 Fix a few small JSONAPI bugs (#1230)
<!-- The PR description should answer 2 important questions: -->

Fixes
- offset / limit didn't work - fixed by updating the `hasura/jsonapi`
library to use `offset` / `limit` instead of `number` / `page` - this
was a change in JSONAPI 1.1
- Render type names as `subgraph_typename`
- Send `OrderBy` as `None` when it contains no columns - `Some(vec![])`
was upsetting Mongo, so let's be more stringent.

No functional changes as feature is behind flag.

V3_GIT_ORIGIN_REV_ID: 419993a3acd955ef74872078d11769f564c7fc36
2024-10-17 10:44:49 +00:00
Daniel Harvey
bec9dee021 Move argument presets resolve into metadata-resolve (#1226)
<!-- The PR description should answer 2 important questions: -->

### What

Previously we were doing the business of calculating which arguments
(and parts of arguments) were preset in the GraphQL `schema` crate. This
meant we would have to reimplement the logic for each backend. Now we
move it into `metadata-resolve` so the results can be shared by all
frontends.

### How

Move argument preset resolve into `metadata-resolve`. What's left in
`graphql-schema` is all the stuff relating to `Annotation`s of various
kinds.

A lot of the diff is changing `ModelWithPermissions` and
`CommandWithPermissions` to `ModelWithArgumentPresets` and
`CommandWithArgumentPresets` in crates after `metadata-resolve`.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: b1b0983abb9f6282652c8689b02e0796026752f5
2024-10-15 14:16:26 +00:00
Daniel Harvey
ad6c47a070 Move plan types out of GraphQL IR (#1203)
<!-- The PR description should answer 2 important questions: -->

### What

A lot of the `graphql_ir` is generally useful and not GraphQL specific.
Before we can move it into `plan` and share it we need to pull a few
shared types out of the package and somewhere more general too.

### How

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 3fe8ca737ef3d8c7ce09ea695453645e303d7030
2024-10-04 13:53:06 +00:00
Daniel Harvey
e313123ed7 Move commands from sql to plan (#1188)
<!-- The PR description should answer 2 important questions: -->

### What

Move the function/procedure planning from `sql` to the shared OpenDD IR
pipeline in `plan`. This should be a no-op for `sql`

### How

Move code, fix type errors.

V3_GIT_ORIGIN_REV_ID: 7da797ffedbc40a44692670679aa176817f2c65e
2024-10-03 10:28:39 +00:00
Daniel Harvey
4015612091 Extract NDCFunction and NDCProcedure in sql command planning (#1172)
<!-- The PR description should answer 2 important questions: -->

### What

Before we pull the command planning into `plan`, let's split the types
so the general and DataFusion stuff don't live in the same place.

### How

Move types, follow errors. Functional no-op.

V3_GIT_ORIGIN_REV_ID: bb4adbc6897a79f47be37d5ad1a13b7b8efb5e93
2024-09-30 10:35:53 +00:00
Daniel Harvey
a8deb88f4e Move model aggregate planning to 'plan' crate (#1171)
<!-- The PR description should answer 2 important questions: -->

### What

Much in the vein of https://github.com/hasura/v3-engine/pull/1166, we
move the model aggregate planning from `sql` to the `plan` crate. No
tests actually exercise this code in the OpenDD IR pipeline yet, perhaps
if we extend the GraphQL -> OpenDD IR pipeline we can put it under test.

### How

Move the code, fix the errors. Functional no-op.

V3_GIT_ORIGIN_REV_ID: 7beee0aec828296fefa24c975d4662a20aa0d2e5
2024-09-30 09:09:38 +00:00
Daniel Harvey
649b3c29b0 Move model planning from sql to plan (#1166)
<!-- The PR description should answer 2 important questions: -->

### What

We're building a new OpenDD IR pipeline. The `sql` crate already has a
lot of what we need, so let's take the model selection parts (ie, not
aggregates yet), pull them into the `plan` crate, and re-use them for
both `sql` and the `jsonapi` pipelines.

The broad idea here is that the shared `plan` will get incrementally
bigger, and `sql` will get smaller.

This is a functional no-op for `sql`, and slightly improves the WIP
JSONAPI pipeline as we enjoy better permission checks.

### How

- Copy model planning and helper functions from `sql` into `plan`
- Replace instances `DataFusionError` with a smaller local `PlanError`
- Fix JSONAPI to use these new `plan` functions
- Remove the code in `sql`, instead using the shared `plan` functions in
planning, mapping back into `DataFusionError` as appropriate.

V3_GIT_ORIGIN_REV_ID: 50314442b9b56f31d2b38a0cf6f104e265bc3886
2024-09-27 14:21:19 +00:00
Daniel Harvey
a6719bee76 Replace references to DataConnectorLink with Arc (#1162)
<!-- The PR description should answer 2 important questions: -->

### What

The references are making multiple frontends difficult to implement,
let's wrap them with `Arc` instead and have an easier time.

### How

Change the types, follow the errors. Functional no-op.

V3_GIT_ORIGIN_REV_ID: 8baea2bd6c0e56e8bfb1f899b8d15731eebfa976
2024-09-27 09:00:16 +00:00
Daniel Harvey
b13cd460ae Move NdcFieldAlias to new plan-types crate (#1161)
### What

We'd like to use `NdcFieldAlias` in the `plan` crate, however because of
the ways deps between `graphql_ir` and `execute` work we cannot without
a cycle. Functional no-op.

### How

Create a new crate that depends on nothing for planning-related domain
types.

V3_GIT_ORIGIN_REV_ID: c441f2de2eba01bda59ce16e1e4b0e4d9f765d78
2024-09-27 09:00:10 +00:00
Daniel Harvey
2839170ddf Create plan crate (#1149)
<!-- The PR description should answer 2 important questions: -->

### What

We are creating a new build pipeline. This makes a new crate for it
called `plan` and puts the existing work from JSONAPI into it. JSONAPI
uses the new plan so we have a quick way of testing it works.

### How

Mostly moving code around. All behind feature flags, so functional
no-op.

V3_GIT_ORIGIN_REV_ID: af4901c93415c7ced2b0f537e600512d28fc5766
2024-09-24 14:40:11 +00:00