-
Notifications
You must be signed in to change notification settings - Fork 157
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
Support direct connections to ent from the rest api #1932
Conversation
Very nice! @mdeicas |
2cc22b2
to
3734059
Compare
Hmm, won't this create opportunities for the two backends to get out of sync? You'll now be able to write data that would not pass graphql ontology validations. |
Good point, that's true. This should only be for read access to the database, though. I think we can enforce this by adding a hook to the ent client to reject all writes, and also generally through code reviews. |
If we make it only read queries that works for me |
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.
Thank you!
Signed-off-by: Marco Deicas <mdeicas@google.com>
Description of the PR
Adds configuration to allow endpoints from the REST API to connect directly to Ent. This will allow bypassing the GraphQl API to use database native functionality.
This option can be enabled with
guacrest --db-direct-connection
. Current endpoint implementations can be overridden to use this optimized implementation by adding methods toEntConnectedServer
. If--db-direct-connection
is specified but an endpoint does not have a correspondingEntConnectedServer
implementation, then the default one will be used.PR Checklist
-s
flag togit commit
.make generate
has been runmake generate
has been runcollectsub
protobuf has been changed,make proto
has been run