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

Mysql and Mssql processors #3023

Merged
merged 20 commits into from
Dec 11, 2024
Merged

Mysql and Mssql processors #3023

merged 20 commits into from
Dec 11, 2024

Conversation

alishakawaguchi
Copy link
Contributor

creates mysql and mssql processors. untangled messy sql output and insert query builder code
added default value postgres integration test

@alishakawaguchi alishakawaguchi added the Improvement Created by Linear-GitHub Sync label Dec 6, 2024
@alishakawaguchi alishakawaguchi self-assigned this Dec 6, 2024
Copy link

vercel bot commented Dec 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
neosync-docs ⬜️ Ignored (Inspect) Visit Preview Dec 11, 2024 10:19pm

Copy link

codecov bot commented Dec 6, 2024

Codecov Report

Attention: Patch coverage is 51.72414% with 252 lines in your changes missing coverage. Please review.

Project coverage is 35.18%. Comparing base (f3d58a8) to head (93c6d69).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
worker/pkg/benthos/sql/processor_neosync_pgx.go 67.58% 40 Missing and 19 partials ⚠️
worker/pkg/benthos/sql/processor_neosync_mysql.go 55.85% 37 Missing and 12 partials ⚠️
worker/pkg/benthos/sql/processor_neosync_mssql.go 56.97% 28 Missing and 9 partials ⚠️
worker/pkg/benthos/sql/output_sql_insert.go 48.78% 21 Missing ⚠️
worker/pkg/query-builder/insert-query-builder.go 17.39% 19 Missing ⚠️
...ernal/benthos/benthos-builder/builders/sql-util.go 0.00% 16 Missing ⚠️
...ernal/benthos/benthos-builder/builders/generate.go 0.00% 12 Missing ⚠️
internal/benthos/benthos-builder/builders/sql.go 0.00% 12 Missing ⚠️
...nternal/benthos/benthos-builder/builders/aws-s3.go 0.00% 7 Missing ⚠️
worker/pkg/benthos/environment/environment.go 40.00% 5 Missing and 1 partial ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3023      +/-   ##
==========================================
+ Coverage   34.70%   35.18%   +0.47%     
==========================================
  Files         345      346       +1     
  Lines       40113    39995     -118     
==========================================
+ Hits        13923    14071     +148     
+ Misses      24566    24264     -302     
- Partials     1624     1660      +36     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


func getSqlBatchProcessors(driver string, columns []string, columnDataTypes map[string]string, columnDefaultProperties map[string]*neosync_benthos.ColumnDefaultProperties) (*neosync_benthos.BatchProcessor, error) {
switch driver {
case sqlmanager_shared.PostgresDriver, "postgres":
Copy link
Member

Choose a reason for hiding this comment

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

There is a new constant in the sqlmanager_shared for the postgres driver called DefaultPostgresDriver

func getSqlBatchProcessors(driver string, columns []string, columnDataTypes map[string]string, columnDefaultProperties map[string]*neosync_benthos.ColumnDefaultProperties) (*neosync_benthos.BatchProcessor, error) {
switch driver {
case sqlmanager_shared.PostgresDriver, "postgres":
return &neosync_benthos.BatchProcessor{NeosyncToPgx: &neosync_benthos.NeosyncToPgxConfig{Columns: columns, ColumnDataTypes: columnDataTypes, ColumnDefaultProperties: columnDefaultProperties}}, nil
Copy link
Member

Choose a reason for hiding this comment

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

This is so clean.

if err != nil {
return err
}
return err
Copy link
Member

Choose a reason for hiding this comment

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

Hm, is this intending to return the outer error? if so, the err that is used for RetryInsertRowByRow should be renamed.

"github.com/warpstreamlabs/bento/public/service"
)

func neosyncToMssqlProcessorConfig() *service.ConfigSpec {
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice to see tests for these things via the benthos-way of testing them where they are init'd and run through that, more like an integration test.

See the out output_sql_insert_test.go for a basic example of what I'm referring to..

@alishakawaguchi alishakawaguchi merged commit 9115bb7 into main Dec 11, 2024
10 checks passed
@alishakawaguchi alishakawaguchi deleted the alisha/sql-processors branch December 11, 2024 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants