Skip to content
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

feat(sql): add query capabilities to the SQL Policy Store #1571

Conversation

paullatzelsperger
Copy link
Member

@paullatzelsperger paullatzelsperger commented Jun 30, 2022

What this PR changes/adds

Adds dynamic query capabilities to the SqlPolicyDefinitionStore. In particular the following changes have been made:

  • the SQL schema for PolicyDefinition was changed to use the JSON type.
  • the table name was changed to edc_policydefinition to be in accordance with other persistence backends.
  • many of the PolicyDefinitionStatements interface's method names were changed to keep consistent with the other SQL *stores.
  • moved some generic methods (Postgres JSON array function, JSON cast operator,...) to the common-sql package
  • moved the containsAnyLeftOperand method directly to QuerySpec to cut down on code duplication

Why it does that

To enable the query capabilities of the DataManagementApi for SQL Stores as well.

Further notes

this PR concludes the full-query-capability story from a functional perspective, the documentation will be provided in a separate PR.

Linked Issue(s)

Closes #1484

Checklist

  • added appropriate tests?
  • performed checkstyle check locally?
  • added/updated copyright headers?
  • documented public classes/methods?
  • added/updated relevant documentation?
  • added relevant details to the changelog? (skip with label no-changelog)
  • formatted title correctly? (take a look at the CONTRIBUTING and styleguide for details)

@codecov-commenter
Copy link

Codecov Report

Merging #1571 (61894a5) into main (4ea80c2) will increase coverage by 0.06%.
The diff coverage is 97.56%.

@@            Coverage Diff             @@
##             main    #1571      +/-   ##
==========================================
+ Coverage   67.67%   67.73%   +0.06%     
==========================================
  Files         745      747       +2     
  Lines       16311    16339      +28     
  Branches     1064     1067       +3     
==========================================
+ Hits        11039    11068      +29     
+ Misses       4791     4790       -1     
  Partials      481      481              
Impacted Files Coverage Δ
...lipse/dataspaceconnector/sql/SqlQueryExecutor.java 94.44% <ø> (ø)
...econnector/sql/policy/SqlPolicyStoreExtension.java 0.00% <0.00%> (ø)
.../policy/store/schema/SqlPolicyStoreStatements.java 91.66% <50.00%> (ø)
...tor/sql/policy/store/SqlPolicyDefinitionStore.java 89.01% <100.00%> (+2.05%) ⬆️
.../policy/store/schema/BaseSqlDialectStatements.java 100.00% <100.00%> (ø)
...store/schema/postgres/PolicyDefinitionMapping.java 100.00% <100.00%> (ø)
...ore/schema/postgres/PostgresDialectStatements.java 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ea80c2...61894a5. Read the comment docs.

@paullatzelsperger paullatzelsperger force-pushed the feature/1484_query_sqlpolicystore branch from 61894a5 to 5fd1d03 Compare June 30, 2022 19:12
@paullatzelsperger paullatzelsperger marked this pull request as ready for review June 30, 2022 19:23
@paullatzelsperger paullatzelsperger force-pushed the feature/1484_query_sqlpolicystore branch from 5fd1d03 to 9c2ae78 Compare July 1, 2022 05:54
@paullatzelsperger paullatzelsperger force-pushed the feature/1484_query_sqlpolicystore branch from 9c2ae78 to e622463 Compare July 1, 2022 05:57
@paullatzelsperger paullatzelsperger merged commit a9b1017 into eclipse-edc:main Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: add query capabilities to Sql PolicyStore
3 participants