feat: database version query#309
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughNew methods for retrieving the database version have been added to the SQLDataSource, OracleDataSource, and PostgresDataSource classes. Each method accepts an optional custom SQL query, defaults to a database-specific version query if none is provided, executes it, and returns the version string or None if no result is found. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant DataSource
Caller->>DataSource: query_get_database_version(optional_query)
alt Custom query provided
DataSource->>DataSource: Execute custom query
else No custom query
DataSource->>DataSource: Execute default version query
end
DataSource->>Caller: Return version string or None
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
c9e3d56 to
6972c7c
Compare
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
User description
###Implements #
Description
Summary Goes here.
Type of change
Delete irrelevant options.
How Has This Been Tested?
PR Type
Enhancement
Description
• Add database version query method to SQL datasources
• Implement version queries for SQL Server, Oracle, and PostgreSQL
• Support custom version queries with optional parameter
• Add Optional type import to all modified files
Changes walkthrough 📝
sql_datasource.py
Add database version query to base SQL datasourcedcs_core/core/datasource/sql_datasource.py
• Add
query_get_database_versionmethod with SQL Server version query• Import
Optionaltype for method parameter• Use
SELECT @@versionasdefault query with custom query fallback
oracle.py
Implement Oracle database version querydcs_core/integrations/databases/oracle.py
• Add
query_get_database_versionmethod with Oracle-specific query•
Import
Optionaltype for method parameter• Use
SELECT BANNER FROMv$versionas Oracle version querypostgres.py
Implement PostgreSQL database version querydcs_core/integrations/databases/postgres.py
• Add
query_get_database_versionmethod with PostgreSQL query• Import
Optionaltype for method parameter• Use
SELECT version()asPostgreSQL version query
Summary by CodeRabbit