-
Notifications
You must be signed in to change notification settings - Fork 0
PostgreSQL connection caching and reuse #131
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
452008d
PostgreSQL connection pooling
tmikula-dev 731d259
Updating constants.py
tmikula-dev f9e9f29
SQL queries.
tmikula-dev 9d4cba7
postgres_base.py
tmikula-dev 3cdabd0
writer_postgres.py and reader_postgres.py update based on comments.
tmikula-dev 07712ff
Merge branch 'master' into feature/postgresql-connection-pooling
tmikula-dev 73d8b4d
requirements.txt update
tmikula-dev 2955caf
CodeRabbit review comments implementation.
tmikula-dev 6c3ab3d
Merge branch 'master' into feature/postgresql-connection-pooling
tmikula-dev e579b94
Updating master merge
tmikula-dev 714e0fa
Fixing the requirements.txt dependencies.
tmikula-dev 0e4fbc8
Review comments implementation.
tmikula-dev 9412a5b
Merge branch 'master' into feature/postgresql-connection-pooling
tmikula-dev 747641f
Bug fix.
tmikula-dev 8e64fd5
Solving the issue with having state information in between functions
tmikula-dev 65ef0fe
Pylint fixes.
tmikula-dev 01ad860
Dependency fix.
tmikula-dev 0f8c338
CodeRabbit review comments.
tmikula-dev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| -- name: get_stats(ts_start, ts_end, lim) | ||
| -- Get run/job statistics with keyset pagination. | ||
| SELECT r.event_id, r.job_ref, r.tenant_id, r.source_app, | ||
| r.source_app_version, r.environment, | ||
| r.timestamp_start AS run_timestamp_start, | ||
| r.timestamp_end AS run_timestamp_end, | ||
| j.internal_id, j.country, j.catalog_id, j.status, | ||
| j.timestamp_start, j.timestamp_end, j.message, j.additional_info | ||
| FROM public_cps_za_runs_jobs j | ||
| INNER JOIN public_cps_za_runs r ON j.event_id = r.event_id | ||
| WHERE r.timestamp_start >= :ts_start AND r.timestamp_start <= :ts_end | ||
| ORDER BY j.internal_id DESC | ||
| LIMIT :lim; | ||
|
|
||
| -- name: get_stats_with_cursor(ts_start, ts_end, cursor_id, lim) | ||
| -- Get run/job statistics with cursor-based keyset pagination. | ||
| SELECT r.event_id, r.job_ref, r.tenant_id, r.source_app, | ||
| r.source_app_version, r.environment, | ||
| r.timestamp_start AS run_timestamp_start, | ||
| r.timestamp_end AS run_timestamp_end, | ||
| j.internal_id, j.country, j.catalog_id, j.status, | ||
| j.timestamp_start, j.timestamp_end, j.message, j.additional_info | ||
| FROM public_cps_za_runs_jobs j | ||
| INNER JOIN public_cps_za_runs r ON j.event_id = r.event_id | ||
| WHERE r.timestamp_start >= :ts_start AND r.timestamp_start <= :ts_end | ||
| AND j.internal_id < :cursor_id | ||
| ORDER BY j.internal_id DESC | ||
| LIMIT :lim; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.