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: support \l meta command #215

Merged
merged 6 commits into from
Jun 23, 2022
Merged

feat: support \l meta command #215

merged 6 commits into from
Jun 23, 2022

Conversation

olavloite
Copy link
Collaborator

Adds support for the \l psql meta command to list all databases on the same 'server'. The meta command behaves as follows in PGAdapter:

  1. If PGAdapter has been started with -d (a fixed database) it will only show the current database, as no other database can be 'reached' by using \c.
  2. If -d has not been specified, PGAdapter shows all the databases on the same instance as the current connection.
  3. The databases in step 2 are shown with only the database id if the current connection is to the default instance of this instance of PGAdapter. Otherwise, the fully qualified name is shown.

@codecov
Copy link

codecov bot commented Jun 17, 2022

Codecov Report

Merging #215 (cbd6d9b) into postgresql-dialect (087cb1d) will increase coverage by 0.15%.
The diff coverage is 87.87%.

@@                   Coverage Diff                    @@
##             postgresql-dialect     #215      +/-   ##
========================================================
+ Coverage                 80.56%   80.72%   +0.15%     
- Complexity                 1051     1067      +16     
========================================================
  Files                        91       92       +1     
  Lines                      3556     3647      +91     
  Branches                    426      431       +5     
========================================================
+ Hits                       2865     2944      +79     
- Misses                      525      537      +12     
  Partials                    166      166              
Flag Coverage Δ
all_tests 80.72% <87.87%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ud/spanner/pgadapter/metadata/OptionsMetadata.java 78.78% <0.00%> (-3.94%) ⬇️
...gle/cloud/spanner/pgadapter/ConnectionHandler.java 79.52% <75.00%> (-0.16%) ⬇️
...ogle/cloud/spanner/pgadapter/commands/Command.java 100.00% <100.00%> (ø)
.../cloud/spanner/pgadapter/commands/ListCommand.java 100.00% <100.00%> (ø)
...panner/pgadapter/statements/BackendConnection.java 93.04% <100.00%> (+0.62%) ⬆️
...apter/statements/ExtendedQueryProtocolHandler.java 100.00% <100.00%> (ø)
...apter/statements/local/ListDatabasesStatement.java 100.00% <100.00%> (ø)
...ud/spanner/pgadapter/utils/ClientAutoDetector.java 96.66% <100.00%> (+0.37%) ⬆️

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 087cb1d...cbd6d9b. Read the comment docs.

@olavloite olavloite marked this pull request as ready for review June 18, 2022 10:51
@olavloite olavloite added the release-please:force-run Forces release-please to run label Jun 23, 2022
@release-please release-please bot removed the release-please:force-run Forces release-please to run label Jun 23, 2022
@olavloite olavloite added the release-please:force-run Forces release-please to run label Jun 23, 2022
@release-please release-please bot removed the release-please:force-run Forces release-please to run label Jun 23, 2022
@olavloite olavloite merged commit b9d0363 into postgresql-dialect Jun 23, 2022
@olavloite olavloite deleted the backslash-l branch June 23, 2022 07:29
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.

None yet

1 participant