Skip to content

Conversation

@goldmedal
Copy link
Collaborator

@goldmedal goldmedal commented Aug 8, 2025

Description

  • Fix the connection info mapping for Postgres
  • Add type mapping for Postgres
  • Add the connection info mapping for MySQL
  • Add type mapping for MySQL

The type mapping tables follows the logic of wren eninge

Summary by CodeRabbit

  • New Features

    • Added support for MySQL data sources in DBT project conversion and explicit PostgreSQL database-name support.
  • Bug Fixes

    • Improved validation and port handling for PostgreSQL and MySQL connection configurations.
  • Documentation

    • Added DBT project requirements (which JSON outputs and profile configuration are needed).
  • Tests

    • Added and updated tests covering MySQL validation and PostgreSQL database-name handling.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 8, 2025

Walkthrough

Adds MySQL data source support, changes Postgres port to string and adds DbName/SslDisable handling, updates profile parsing and tests, and augments the dbt README with required generated files and profile preparation.

Changes

Cohort / File(s) Change Summary
MySQL data source support
wren-launcher/commands/dbt/data_source.go, wren-launcher/commands/dbt/converter.go
Added WrenMysqlDataSource type with GetType/Validate/MapType, implemented convertToMysqlDataSource, and added MySQL handling in conversion (host, port, database, user, password, sslMode).
Postgres port & DbName changes
wren-launcher/commands/dbt/data_source.go, wren-launcher/commands/dbt/converter.go
Changed WrenPostgresDataSource.Port from int to string; conversion prefers DbName over Database, defaults empty port to "5432", and updates validation to parse/validate string ports.
Profiles struct & parsing
wren-launcher/commands/dbt/profiles.go, wren-launcher/commands/dbt/profiles_analyzer.go
Added DbName string and SslDisable bool to DbtConnection; parseConnection extracts dbname and ssl_disable and marks them known fields.
Tests updated / added
wren-launcher/commands/dbt/data_source_test.go
Updated Postgres tests to use string ports and DbName scenarios; added TestMysqlDataSourceValidation covering valid/invalid MySQL configs and port validation.
Documentation
wren-launcher/commands/dbt/README.md
Added "Requirement for DBT project" section requiring catalog.json and manifest.json (via dbt build and dbt docs generate) and a prepared profiles.yml with DB connection info.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ProfilesAnalyzer
    participant Converter
    participant DataSource

    User->>ProfilesAnalyzer: Provide dbt profiles.yml
    ProfilesAnalyzer->>Converter: Parsed DbtConnection (type, host, port, dbname, ssl_disable)
    Converter->>DataSource: Determine datasource type
    alt mysql
        DataSource->>DataSource: convertToMysqlDataSource()
        DataSource->>DataSource: Validate & MapType()
        DataSource-->>Converter: WrenMysqlDataSource
    else postgres
        DataSource->>DataSource: convertToPostgresDataSource()
        DataSource->>DataSource: Validate & MapType()
        DataSource-->>Converter: WrenPostgresDataSource
    end
    Converter-->>User: Converted data source config
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • douenergy
  • wwwy3y3

Poem

In my burrow of bytes I nibble and test,
MySQL hops in and finds a new nest.
Ports now as strings, DbName takes flight,
Profiles polished, docs ready to light.
A cheerful little rabbit, coding through night 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dd7eff9 and 0189f61.

📒 Files selected for processing (2)
  • wren-launcher/commands/dbt/data_source.go (9 hunks)
  • wren-launcher/commands/dbt/profiles_analyzer.go (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • wren-launcher/commands/dbt/profiles_analyzer.go
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-09T02:43:20.433Z
Learnt from: goldmedal
PR: Canner/WrenAI#1827
File: wren-launcher/commands/dbt/data_source.go:50-53
Timestamp: 2025-07-09T02:43:20.433Z
Learning: In wren-launcher/commands/dbt/data_source.go, when encountering unsupported database types in convertConnectionToDataSource function, the user prefers to log a warning and continue processing instead of failing. The function should return nil, nil to allow processing to continue.

Applied to files:

  • wren-launcher/commands/dbt/data_source.go
🧬 Code Graph Analysis (1)
wren-launcher/commands/dbt/data_source.go (1)
wren-launcher/commands/dbt/profiles.go (1)
  • DbtConnection (16-42)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)
🔇 Additional comments (11)
wren-launcher/commands/dbt/data_source.go (11)

6-6: LGTM: Added strconv import for string conversion utilities.

The import is needed for the strconv.Itoa() and strconv.Atoi() calls used in port handling throughout the file.


20-20: LGTM: Added constant for PostgreSQL type standardization.

Good practice to define a constant for the PostgreSQL type string to ensure consistency across the codebase.


78-84: LGTM: Enhanced connection routing with MySQL support.

The switch statement correctly handles both "postgres"/"postgresql" variants and adds MySQL support. The use of the postgresType constant improves consistency.


94-114: LGTM: Fixed PostgreSQL connection handling with proper database field prioritization.

The implementation correctly prioritizes DbName over Database field for PostgreSQL connections, which aligns with PostgreSQL's standard connection parameters. The port handling fix addresses the previous issue where conn.Port == 0 would result in "0" instead of applying the default port.


157-179: LGTM: Well-structured MySQL data source conversion.

The MySQL conversion function follows the same pattern as PostgreSQL with proper SSL mode handling and port defaulting. The SSL mode logic correctly maps SslDisable boolean to the appropriate string value.


227-227: LGTM: PostgreSQL port field type changed to string.

This change aligns with the string-based port handling implemented in the conversion functions and provides consistency with the MySQL implementation.


235-235: LGTM: Using constant for PostgreSQL type.

Consistent with the newly defined postgresType constant for standardized type naming.


249-258: LGTM: Enhanced port validation for string-based ports.

The validation correctly handles string ports by parsing them to integers and validating the range. This approach is consistent with the new string-based port handling.


267-304: LGTM: Comprehensive MySQL data source implementation.

The WrenMysqlDataSource struct and its methods are well-implemented with:

  • Complete field set including optional SSL configuration
  • Proper validation with port range checking
  • Consistent error messages

The validation logic mirrors the PostgreSQL implementation, ensuring consistency across database types.


306-342: LGTM: Comprehensive MySQL type mapping implementation.

The type mapping follows the referenced wren-engine logic and provides comprehensive coverage of MySQL data types. The mapping correctly handles:

  • Character types (CHAR, VARCHAR, TEXT variants)
  • Numeric types (TINYINT through BIGINT, FLOAT, DOUBLE, DECIMAL)
  • Date/time types with proper timezone handling (TIMESTAMP → TIMESTAMPTZ)
  • Boolean and JSON types

The fallback to lowercase original type for unmapped types is appropriate.


448-448: LGTM: Consistent use of varchar type constant.

Good refactoring to use the varcharType constant instead of hardcoded string for consistency.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/dbt-mysql

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🔭 Outside diff range comments (1)
wren-launcher/commands/dbt/data_source.go (1)

64-85: PostgreSQL conversion updates look good with one potential issue.

The changes properly handle the DbName preference and port string conversion. However, there's a logical issue with port defaulting:

Issue: If conn.Port is 0, strconv.Itoa(0) returns "0", not an empty string, so the default port logic won't trigger.

Apply this fix:

-	ds := &WrenPostgresDataSource{
-		Host:     conn.Host,
-		Port:     strconv.Itoa(conn.Port),
-		Database: dbName,
-		User:     conn.User,
-		Password: conn.Password,
-	}
-
-	// If no port is specified, use PostgreSQL default port
-	if ds.Port == "" {
-		ds.Port = "5432"
-	}
+	port := strconv.Itoa(conn.Port)
+	if conn.Port == 0 {
+		port = "5432"
+	}
+
+	ds := &WrenPostgresDataSource{
+		Host:     conn.Host,
+		Port:     port,
+		Database: dbName,
+		User:     conn.User,
+		Password: conn.Password,
+	}
🧹 Nitpick comments (1)
wren-launcher/commands/dbt/README.md (1)

1-13: Fix markdown formatting issues.

The new documentation section is helpful and necessary, but there are formatting issues that should be addressed:

-	```
-	dbt build
-	dbt docs generate
-	```
+  ```bash
+  dbt build
+  dbt docs generate
+  ```

This fixes:

  • Hard tabs replaced with spaces (lines 7-10)
  • Added language specification to the code fence
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bf30acf and f9523b4.

📒 Files selected for processing (6)
  • wren-launcher/commands/dbt/README.md (1 hunks)
  • wren-launcher/commands/dbt/converter.go (1 hunks)
  • wren-launcher/commands/dbt/data_source.go (7 hunks)
  • wren-launcher/commands/dbt/data_source_test.go (6 hunks)
  • wren-launcher/commands/dbt/profiles.go (2 hunks)
  • wren-launcher/commands/dbt/profiles_analyzer.go (2 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: goldmedal
PR: Canner/WrenAI#1827
File: wren-launcher/commands/dbt/data_source.go:50-53
Timestamp: 2025-07-09T02:43:20.433Z
Learning: In wren-launcher/commands/dbt/data_source.go, when encountering unsupported database types in convertConnectionToDataSource function, the user prefers to log a warning and continue processing instead of failing. The function should return nil, nil to allow processing to continue.
Learnt from: narsik123
PR: Canner/WrenAI#1606
File: wren-ui/src/apollo/server/dataSource.ts:135-150
Timestamp: 2025-04-28T20:09:06.106Z
Learning: The Oracle data source in WrenAI includes an SSL toggle in the UI (OracleProperties component) and should pass this setting to the connection info using the pattern `...(ssl && { kwargs: { ssl: true } })` for consistency with other host-based connections like MS SQL.
📚 Learning: 2025-07-09T02:43:20.433Z
Learnt from: goldmedal
PR: Canner/WrenAI#1827
File: wren-launcher/commands/dbt/data_source.go:50-53
Timestamp: 2025-07-09T02:43:20.433Z
Learning: In wren-launcher/commands/dbt/data_source.go, when encountering unsupported database types in convertConnectionToDataSource function, the user prefers to log a warning and continue processing instead of failing. The function should return nil, nil to allow processing to continue.

Applied to files:

  • wren-launcher/commands/dbt/profiles_analyzer.go
  • wren-launcher/commands/dbt/profiles.go
  • wren-launcher/commands/dbt/data_source_test.go
  • wren-launcher/commands/dbt/data_source.go
  • wren-launcher/commands/dbt/converter.go
📚 Learning: 2025-04-28T20:09:06.106Z
Learnt from: narsik123
PR: Canner/WrenAI#1606
File: wren-ui/src/apollo/server/dataSource.ts:135-150
Timestamp: 2025-04-28T20:09:06.106Z
Learning: The Oracle data source in WrenAI includes an SSL toggle in the UI (OracleProperties component) and should pass this setting to the connection info using the pattern `...(ssl && { kwargs: { ssl: true } })` for consistency with other host-based connections like MS SQL.

Applied to files:

  • wren-launcher/commands/dbt/profiles_analyzer.go
  • wren-launcher/commands/dbt/profiles.go
📚 Learning: 2025-07-09T02:43:07.560Z
Learnt from: goldmedal
PR: Canner/WrenAI#1827
File: wren-launcher/commands/dbt/data_source.go:154-156
Timestamp: 2025-07-09T02:43:07.560Z
Learning: In the WrenAI codebase, the MapType methods for data sources should return the original type name for unknown types, rather than a default fallback like "string". This maintains consistency across all data source implementations.

Applied to files:

  • wren-launcher/commands/dbt/converter.go
🧬 Code Graph Analysis (3)
wren-launcher/commands/dbt/data_source_test.go (2)
wren-launcher/commands/dbt/profiles.go (3)
  • DbtProfiles (4-7)
  • DbtProfile (10-13)
  • DbtConnection (16-42)
wren-launcher/commands/dbt/data_source.go (3)
  • FromDbtProfiles (21-43)
  • WrenPostgresDataSource (194-200)
  • WrenMysqlDataSource (236-244)
wren-launcher/commands/dbt/data_source.go (1)
wren-launcher/commands/dbt/profiles.go (1)
  • DbtConnection (16-42)
wren-launcher/commands/dbt/converter.go (1)
wren-launcher/commands/dbt/data_source.go (1)
  • WrenMysqlDataSource (236-244)
🪛 markdownlint-cli2 (0.17.2)
wren-launcher/commands/dbt/README.md

7-7: Hard tabs
Column: 1

(MD010, no-hard-tabs)


7-7: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


8-8: Hard tabs
Column: 1

(MD010, no-hard-tabs)


9-9: Hard tabs
Column: 1

(MD010, no-hard-tabs)


10-10: Hard tabs
Column: 1

(MD010, no-hard-tabs)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (17)
wren-launcher/commands/dbt/profiles.go (2)

22-22: LGTM! Clean addition of PostgreSQL-specific database name field.

The DbName field addition is well-positioned and properly tagged, providing PostgreSQL-specific database naming support alongside the generic Database field.


37-37: LGTM! Proper MySQL SSL configuration field.

The SslDisable boolean field is correctly implemented with appropriate YAML/JSON tags and clear commenting indicating its MySQL-specific purpose.

wren-launcher/commands/dbt/converter.go (1)

157-168: LGTM! MySQL data source conversion properly implemented.

The MySQL case follows the established pattern and correctly maps essential connection properties. The implementation aligns with the WrenMysqlDataSource struct and includes SSL mode handling.

wren-launcher/commands/dbt/profiles_analyzer.go (3)

130-130: LGTM! Proper PostgreSQL DbName field extraction.

The extraction of the dbname field follows the established pattern and uses the appropriate helper function.


144-144: LGTM! Correct MySQL SSL disable field extraction.

The ssl_disable field extraction properly uses the getBool helper function and includes clear database-specific commenting.


149-149: LGTM! Proper addition to known fields.

Adding dbname to the knownFields map prevents it from being treated as an unknown field, which is the correct behavior.

wren-launcher/commands/dbt/data_source_test.go (4)

44-45: LGTM! Port field correctly updated to string type.

The test expectation properly reflects the change from integer to string port representation in the WrenPostgresDataSource struct.


68-127: LGTM! Excellent test coverage for PostgreSQL DbName field.

The new test properly validates that PostgreSQL connections correctly handle the DbName field and that the conversion logic prefers DbName over Database as intended.


223-256: LGTM! PostgreSQL validation tests properly updated.

All test cases correctly reflect the string port type and the invalid port test case appropriately uses an empty string to trigger validation failure.


269-324: LGTM! Comprehensive MySQL validation test coverage.

The MySQL validation test follows the established testing pattern and covers all essential scenarios: valid configuration, missing host, missing database, and invalid port. This ensures the MySQL data source validation behaves correctly.

wren-launcher/commands/dbt/data_source.go (7)

6-6: Import addition looks good.

The strconv package import is necessary for the port conversion logic in both PostgreSQL and MySQL data source handling.


52-53: MySQL case addition is properly integrated.

The new MySQL case follows the established pattern and correctly calls the dedicated conversion function.


196-196: PostgreSQL port field type change is correct.

Changing from int to string aligns with the conversion logic and provides more flexibility for port handling.


218-227: PostgreSQL validation logic is comprehensive and correct.

The port validation properly handles the new string type with appropriate format and range checks.


236-244: MySQL data source struct is well-designed.

The struct includes all necessary fields with appropriate JSON tags and optional SSL configuration support.


246-273: MySQL interface methods are correctly implemented.

Both GetType() and Validate() methods follow established patterns and provide comprehensive validation.


275-311: Confirm TIMESTAMP → TIMESTAMPTZ mapping consistency

Although the MySQL type mappings in WrenMysqlDataSource.MapType are comprehensive, our search only found this single instance of TIMESTAMPTZ in:

  • wren-launcher/commands/dbt/data_source.go (MapType, case "TIMESTAMP": return "TIMESTAMPTZ")

No other references to TIMESTAMPTZ or related timestamp‐with‐timezone handling were detected in the codebase. Please verify that the wren‐engine integration expects MySQL TIMESTAMP columns to be mapped to TIMESTAMPTZ—otherwise this mapping may lead to unexpected behavior.

@goldmedal goldmedal requested a review from wwwy3y3 August 8, 2025 04:41
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
wren-launcher/commands/dbt/data_source.go (1)

75-89: LGTM: Unsupported types warn and continue.

Matches the preference to proceed with nil, nil on unknown DB types.

🧹 Nitpick comments (6)
wren-launcher/commands/dbt/README.md (3)

7-10: Fix markdown lint: remove tabs and specify code fence language.

Replace hard tabs and add a language for the code block to satisfy MD010/MD040.

-	```
-	dbt build
-	dbt docs generate
-	```
+```bash
+dbt build
+dbt docs generate
+```

1-2: Polish heading and casing consistency.

Use plural "Requirements" and consistent "dbt" casing per upstream docs.

-# Requirement for DBT project
-This part outlines some requirements for the target dbt project:
+# Requirements for dbt projects
+This section outlines requirements for the target dbt project:

11-13: Consider adding minimal Postgres/MySQL profile examples to guide new users.

A short profiles.yml snippet for Postgres (dbname) and MySQL (ssl_disable) will reduce setup friction. I can add it if you want.

wren-launcher/commands/dbt/data_source_test.go (2)

256-295: LGTM with a small addition: add a non-numeric port case.

Validation already handles numeric parse. Consider adding an invalid non-numeric port case for completeness.

Example addition to invalidCases:

{
  "non-numeric port",
  &WrenPostgresDataSource{
    Host:     testHost,
    Port:     "abc",
    Database: "test",
    User:     "user",
  },
},

297-352: LGTM: MySQL validation tests cover key cases. Add one more invalid port case.

Add a "non-numeric port" case to ensure parse errors surface, and consider a conversion-path test to assert default port 3306 when conn.Port=0.

Apply within this test block:

@@
 		{
 			name: "invalid port",
 			ds: &WrenMysqlDataSource{
 				Host:     "localhost",
 				Port:     "",
 				Database: "test",
 				User:     "user",
 			},
 			wantErr: true,
 		},
+		{
+			name: "non-numeric port",
+			ds: &WrenMysqlDataSource{
+				Host:     "localhost",
+				Port:     "abc",
+				Database: "test",
+				User:     "user",
+			},
+			wantErr: true,
+		},

Additionally, I can add:

  • TestFromDbtProfiles_MySQL_DefaultPort: conn.Port=0 yields ds.Port "3306".
  • TestFromDbtProfiles_Postgres_DefaultPort: conn.Port=0 yields ds.Port "5432".
    Want me to push these tests?
wren-launcher/commands/dbt/data_source.go (1)

306-342: MySQL type mapping may be inconsistent with canonical types; verify alignment with wren-engine.

Return values mix lowercase ("char", "text") and uppercase ("INTEGER", "BIGINT", "TIMESTAMPTZ"). Ensure these match what Wren expects; otherwise normalize to a canonical set (e.g., integer, varchar, timestamp, double, boolean) like other mappers.

If normalization is desired, consider a table-driven map + lowercase outputs:

var mysqlToCanonical = map[string]string{
  "CHAR": "char", "VARCHAR": "varchar", "TEXT": "text", "TINYTEXT": "text",
  "MEDIUMTEXT": "text", "LONGTEXT": "text", "ENUM": "text", "SET": "text",
  "BIT": "integer", "TINYINT": "integer", "SMALLINT": "integer",
  "MEDIUMINT": "integer", "INT": "integer", "INTEGER": "integer",
  "BIGINT": "integer",
  "FLOAT": "double", "DOUBLE": "double", "DECIMAL": "double", "NUMERIC": "double",
  "DATE": "date", "DATETIME": "timestamp", "TIMESTAMP": "timestamp",
  "BOOLEAN": "boolean", "BOOL": "boolean",
  "JSON": "json",
}

Happy to adjust to the exact wren-engine schema if you confirm the expected enum.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5631cee and dd7eff9.

📒 Files selected for processing (6)
  • wren-launcher/commands/dbt/README.md (1 hunks)
  • wren-launcher/commands/dbt/converter.go (1 hunks)
  • wren-launcher/commands/dbt/data_source.go (9 hunks)
  • wren-launcher/commands/dbt/data_source_test.go (7 hunks)
  • wren-launcher/commands/dbt/profiles.go (2 hunks)
  • wren-launcher/commands/dbt/profiles_analyzer.go (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • wren-launcher/commands/dbt/converter.go
  • wren-launcher/commands/dbt/profiles.go
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-09T02:43:20.433Z
Learnt from: goldmedal
PR: Canner/WrenAI#1827
File: wren-launcher/commands/dbt/data_source.go:50-53
Timestamp: 2025-07-09T02:43:20.433Z
Learning: In wren-launcher/commands/dbt/data_source.go, when encountering unsupported database types in convertConnectionToDataSource function, the user prefers to log a warning and continue processing instead of failing. The function should return nil, nil to allow processing to continue.

Applied to files:

  • wren-launcher/commands/dbt/data_source_test.go
  • wren-launcher/commands/dbt/profiles_analyzer.go
  • wren-launcher/commands/dbt/data_source.go
🧬 Code Graph Analysis (2)
wren-launcher/commands/dbt/data_source_test.go (1)
wren-launcher/commands/dbt/data_source.go (2)
  • WrenPostgresDataSource (225-231)
  • WrenMysqlDataSource (267-275)
wren-launcher/commands/dbt/data_source.go (1)
wren-launcher/commands/dbt/profiles.go (1)
  • DbtConnection (16-42)
🪛 markdownlint-cli2 (0.17.2)
wren-launcher/commands/dbt/README.md

7-7: Hard tabs
Column: 1

(MD010, no-hard-tabs)


7-7: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


8-8: Hard tabs
Column: 1

(MD010, no-hard-tabs)


9-9: Hard tabs
Column: 1

(MD010, no-hard-tabs)


10-10: Hard tabs
Column: 1

(MD010, no-hard-tabs)

🔇 Additional comments (6)
wren-launcher/commands/dbt/profiles_analyzer.go (2)

130-130: LGTM: dbname parsed for Postgres.

connection.DbName = getString("dbname") correctly supports Postgres’ dbname override.


144-144: LGTM: ssl_disable parsed for MySQL.

connection.SslDisable = getBool("ssl_disable") is appropriate for toggling SSL.

wren-launcher/commands/dbt/data_source_test.go (2)

23-24: LGTM: Port assertions updated to string.

Matches the data source refactor to string ports.


92-142: LGTM: Postgres DbName path covered.

Good coverage asserting host/port/database/user/password and type.

wren-launcher/commands/dbt/data_source.go (2)

157-179: LGTM: MySQL conversion handles ssl_disable and default port correctly.

Good logging, SSL mode derivation, and 3306 defaulting when conn.Port=0.


225-236: LGTM: Postgres port as string and type constant.

Struct/tag updates and GetType using postgresType are consistent across codebase and tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants