-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add Redis DB support for bal persist #4
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4 +/- ##
=======================================
Coverage ? 86.59%
Complexity ? 9
=======================================
Files ? 7
Lines ? 649
Branches ? 381
=======================================
Hits ? 562
Misses ? 84
Partials ? 3 ☔ View full report in Codecov by Sentry. |
name: Run Build Workflow | ||
if: ${{ github.repository_owner == 'ballerina-platform' }} | ||
uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@main | ||
secrets: inherit |
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.
secrets: inherit | |
secrets: inherit | |
.github/workflows/trivy-scan.yml
Outdated
name: Run Trivy Scan Workflow | ||
if: ${{ github.repository_owner == 'ballerina-platform' }} | ||
uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@main | ||
secrets: inherit |
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.
secrets: inherit | |
secrets: inherit | |
ballerina/Module.md
Outdated
@@ -0,0 +1,50 @@ | |||
# Module Overview |
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.
# Module Overview | |
# Overview |
import ballerina/test; | ||
import ballerina/persist; |
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.
import ballerina/test; | |
import ballerina/persist; | |
import ballerina/persist; | |
import ballerina/test; |
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.
check for other places
private typedesc<record {}> targetType; | ||
private map<anydata> typeMap; | ||
|
||
public isolated function init(stream<record {}, error?>? anydataStream, typedesc<record {}> targetType, map<anydata> typeMap, string[] fields, string[] include, any[] typeDescriptions, RedisClient persistClient, persist:Error? err = ()) { |
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.
Check for the lines which are exceeding the maximum length
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.
@dinukaamarasinghe817 can you break it down to multiple lines?
Fix formatting issues
Fix issues with metadata visibility
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.
Add minor comments. Overall LGTM
Update configs to use Redis connector v3
Please note that I have updated the configurations to use the new |
Update git ignore to omit IDEA generated files
Update git ignore to omit IDEA generated files
Add a new line in Config.toml file
Purpose
To make data persistence easier for
bal persist
with Redis DB.Addressing : https://github.com/ballerina-platform/persist-tools/issues/328
Goals
To support Redis as a database for the
bal persist
feature which allows users to manage data persistence without writing database queries inside the code. We need to generate the persistence client code for Redis when the ‘bal persist generate’ command gets executed.Architecture
Approach
Implements a generic client for Redis which contains resource methods to get, insert, update and delete records. This utilizes main data types supported by Redis which are Hashes and Sets. This also includes a Java native processor to support dependent types in get resource methods.
Documentation
Design Documentation : Link
Related PRs
Related to : #3
Related to : #2
Future Improvements
Revisit after : ballerina-platform/ballerina-library#6136
Revisit after : ballerina-platform/ballerina-library#6137