-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
postgres functions as custom queries (close #333) #1073
Conversation
TODO:- -> functions as mutations -> permissions -> tests
Resolve Conflicts: console/src/components/Services/Data/Metadata/Metadata.js server/src-exec/Ops.hs server/src-lib/Hasura/GraphQL/Resolve.hs server/src-lib/Hasura/GraphQL/Resolve/BoolExp.hs server/src-lib/Hasura/GraphQL/Resolve/Select.hs server/src-lib/Hasura/GraphQL/Schema.hs server/src-lib/Hasura/RQL/DDL/Schema/Table.hs server/src-lib/Hasura/SQL/DML.hs server/src-lib/Hasura/SQL/Types.hs server/src-lib/Hasura/Server/Query.hs server/tests-py/test_graphql_queries.py
Resolve Conflicts: server/src-lib/Hasura/GraphQL/Resolve/Mutation.hs server/src-lib/Hasura/GraphQL/Resolve/Select.hs
Resolve Conflicts: server/src-exec/Ops.hs server/src-lib/Hasura/GraphQL/Resolve/BoolExp.hs server/src-lib/Hasura/GraphQL/Resolve/Mutation.hs server/src-lib/Hasura/GraphQL/Resolve/Select.hs server/src-lib/Hasura/GraphQL/Schema.hs server/src-lib/Hasura/RQL/DDL/Schema/Table.hs server/src-lib/Hasura/RQL/Types/SchemaCache.hs
Review app available at: https://hge-ci-pull-1073.herokuapp.com |
Review app available at: https://hge-ci-pull-1073.herokuapp.com |
How about sql function as |
@revskill10 We'll add them in the coming iterations. |
Resolve Conflicts: server/src-exec/Ops.hs server/src-exec/TH.hs server/src-lib/Hasura/GraphQL/Resolve/Context.hs server/src-lib/Hasura/GraphQL/Schema.hs server/src-lib/Hasura/Prelude.hs server/src-lib/Hasura/RQL/DDL/Schema/Table.hs server/src-lib/Hasura/RQL/DML/Select.hs server/src-lib/Hasura/RQL/Types/SchemaCache.hs server/src-lib/Hasura/Server/App.hs server/src-lib/Hasura/Server/Query.hs server/src-rsr/hdb_metadata.yaml server/src-rsr/initialise.sql
So as i see, there won't be a subscription for the same query with custom sql function ?
|
@revskill10 Subscription allows custom queries as well. |
Review app for commit ee4d7e3 deployed to Heroku: https://hge-ci-pull-1073.herokuapp.com |
@rakeshkky this would be a really useful feature. Any idea on when this will land? |
@jasonmorganson This should take another week or two. |
Resolve Conflicts: server/src-exec/Ops.hs server/src-exec/TH.hs server/src-lib/Hasura/GraphQL/Context.hs server/src-lib/Hasura/GraphQL/Resolve/Select.hs server/src-lib/Hasura/GraphQL/Schema.hs server/src-lib/Hasura/Prelude.hs server/src-lib/Hasura/RQL/DDL/Schema/Table.hs server/src-lib/Hasura/RQL/DML/Select.hs server/src-lib/Hasura/Server/Query.hs server/src-rsr/migrate_from_5_to_6.sql
Review app for commit 5027a8c deployed to Heroku: https://hge-ci-pull-1073.herokuapp.com |
=> QualifiedFunction -> m () | ||
trackFunctionP2Setup qf = do | ||
fi <- withPathK "name" $ liftTx $ getFunctionInfo qf | ||
void $ askTabInfo $ fiReturnType fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this to check if the return table is tracked? If so, it should catch the error and return a more useful error message along these lines: "the return table: tname has to be tracked before the function can be tracked"
Review app for commit 4fae992 deployed to Heroku: https://hge-ci-pull-1073.herokuapp.com |
-> now fetch 'returns_table' bool value in 'raw_function_info' SQL -> move 'raw_function_info' fetch SQL to separate file (src-rsr/function_info.sql) -> throw "table <table-name> is not tracked" error message
Review app for commit a22808e deployed to Heroku: https://hge-ci-pull-1073.herokuapp.com |
Review app for commit f2d8a54 deployed to Heroku: https://hge-ci-pull-1073.herokuapp.com |
console/src/components/Services/Data/Function/Modify/ModifyCustomFunction.js
Outdated
Show resolved
Hide resolved
console/src/components/Services/Data/Function/customFunctionReducer.js
Outdated
Show resolved
Hide resolved
console/src/components/Services/Data/Function/customFunctionReducer.js
Outdated
Show resolved
Hide resolved
console/src/components/Services/Data/Function/customFunctionReducer.js
Outdated
Show resolved
Hide resolved
Review app for commit f068d2f deployed to Heroku: https://hge-ci-pull-1073.herokuapp.com |
Review app for commit 0b00abf deployed to Heroku: https://hge-ci-pull-1073.herokuapp.com |
Review app https://hge-ci-pull-1073.herokuapp.com is deleted |
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.127 to 1.0.128. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/serde-rs/json/releases">serde_json's releases</a>.</em></p> <blockquote> <h2>1.0.128</h2> <ul> <li>Support serializing maps containing 128-bit integer keys to serde_json::Value (<a href="https://redirect.github.com/serde-rs/json/issues/1188">#1188</a>, thanks <a href="https://github.com/Mrreadiness"><code>@Mrreadiness</code></a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/serde-rs/json/commit/d96b1d9b643b49a0bb92a8cf280daf6aa08f37cc"><code>d96b1d9</code></a> Release 1.0.128</li> <li><a href="https://github.com/serde-rs/json/commit/599228d5dc52a0f1595fe4bd901821f70d0317a5"><code>599228d</code></a> Merge pull request <a href="https://redirect.github.com/serde-rs/json/issues/1188">#1188</a> from Mrreadiness/feat/add-hashmap-key-128-serializer</li> <li><a href="https://github.com/serde-rs/json/commit/5416cee6c5ad355907f6e9d5f6039b994c69f768"><code>5416cee</code></a> feat: add support for 128 bit HashMap key serialization</li> <li><a href="https://github.com/serde-rs/json/commit/27a4ca9d7a62394fe8f0103f3d91de59f055a4c4"><code>27a4ca9</code></a> Upload CI Cargo.lock for reproducing failures</li> <li>See full diff in <a href="https://github.com/serde-rs/json/compare/1.0.127...1.0.128">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde_json&package-manager=cargo&previous-version=1.0.127&new-version=1.0.128)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> V3_GIT_ORIGIN_REV_ID: c6df67f3a862c0eabd372688d42c4b68ca56a939
Description
What component does this PR affect?
Requires changes from other components? If yes, please mark the components:
Related Issue
close #333
Solution and Design
For table
article
.Define a function
search_articles
as following:-Then GraphQL Engine generates custom query field on
search_articles
:-Sample GraphQL query:-
Metadata API:-
Adding a function
Removing a function
Type
Checklist: