-
Notifications
You must be signed in to change notification settings - Fork 19
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
(DAL) Support multi pgs connection #1780
Conversation
WalkthroughWalkthroughThis update involves renaming and restructuring components within the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- node/pkg/dal/app.go (1 hunks)
- node/pkg/dal/tests/main_test.go (2 hunks)
- node/pkg/dal/tests/multipgs_test.go (1 hunks)
- node/pkg/dal/utils/initializer/initializer.go (1 hunks)
- node/pkg/dal/utils/multipgs/multipgs.go (1 hunks)
Files skipped from review due to trivial changes (1)
- node/pkg/dal/utils/initializer/initializer.go
Additional comments not posted (14)
node/pkg/dal/app.go (1)
8-8
: LGTM! Import path update and function call adjustment.The import path for
utils
has been correctly updated toinitializer
, and the function call has been adjusted accordingly.Also applies to: 16-16
node/pkg/dal/utils/multipgs/multipgs.go (8)
19-38
: LGTM! Ensure connection string retrieval is correct.The function correctly handles the creation and retrieval of PostgreSQL database connections. Ensure the
loadPgsqlConnectionString
function correctly retrieves the connection string.
40-46
: LGTM! Close all database connections.The function correctly iterates over the
dbInstances
map and closes each PostgreSQL database connection.
48-50
: LGTM! Retrieve connection string from secrets.The function correctly retrieves the PostgreSQL connection string from secrets.
52-54
: LGTM! Establish PostgreSQL connection.The function correctly establishes a connection to PostgreSQL using the provided connection string and handles errors.
56-58
: LGTM! Execute PostgreSQL query.The function correctly executes a query on the PostgreSQL database using the provided connection pool and query string.
60-73
: LGTM! Ensure query execution is correct.The function correctly handles database connections, executes the query, and logs errors. Ensure the
query
function correctly executes the query.
75-95
: LGTM! Ensure result mapping is correct.The function correctly handles database connections, executes the query, and maps the result to the expected type. Ensure the
pgx.CollectOneRow
function correctly maps the result.
97-117
: LGTM! Ensure result mapping is correct.The function correctly handles database connections, executes the query, and maps the results to the expected types. Ensure the
pgx.CollectRows
function correctly maps the results.node/pkg/dal/tests/main_test.go (1)
17-17
: LGTM! Import path update and function call adjustment.The import path for
utils
has been correctly updated toinitializer
, and the function call has been adjusted accordingly.Also applies to: 85-85
node/pkg/dal/tests/multipgs_test.go (4)
10-24
: LGTM! Test valid and invalid database connections.The test function correctly validates the creation of a new database with both valid and invalid connection strings and checks for expected errors.
26-64
: LGTM! Test query execution without result and cleanup.The test function correctly handles database connections, executes the query, and checks for expected errors. The cleanup of temporary resources is handled properly.
66-106
: LGTM! Test query execution with single row result and cleanup.The test function correctly handles database connections, executes the query, and maps the result to the expected type. The cleanup of temporary resources is handled properly.
108-148
: LGTM! Test query execution with multiple row results and cleanup.The test function correctly handles database connections, executes the query, and maps the results to the expected types. The cleanup of temporary resources is handled properly.
will close this pr since decided to take different approach |
Description
DAL will refer to
node db
to get config id and otherwise, use its own db having different db connection url.Type of change
Please delete options that are not relevant.
Checklist before requesting a review
Deployment