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

Neosync Interval and Interval Array type #2993

Merged
merged 17 commits into from
Nov 26, 2024
Merged

Conversation

alishakawaguchi
Copy link
Contributor

@alishakawaguchi alishakawaguchi commented Nov 26, 2024

This changes interval type in javascript transformer to an object instead of a string

@alishakawaguchi alishakawaguchi added enhancement New feature or request Improvement Created by Linear-GitHub Sync labels Nov 26, 2024
@alishakawaguchi alishakawaguchi self-assigned this Nov 26, 2024
Copy link

vercel bot commented Nov 26, 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 Nov 26, 2024 8:06pm

Copy link

codecov bot commented Nov 26, 2024

Codecov Report

Attention: Patch coverage is 55.36723% with 158 lines in your changes missing coverage. Please review.

Project coverage is 35.77%. Comparing base (73b9174) to head (67b783e).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
worker/pkg/benthos/sql/processor_neosync_pgx.go 0.00% 55 Missing ⚠️
internal/postgres/utils.go 0.00% 34 Missing ⚠️
internal/neosync-types/registry.go 75.00% 16 Missing and 7 partials ⚠️
...c_connection_data/neosync_connection_data_input.go 0.00% 13 Missing ⚠️
internal/neosync-types/array.go 79.66% 8 Missing and 4 partials ⚠️
internal/neosync-types/interval.go 85.48% 6 Missing and 3 partials ⚠️
worker/pkg/benthos/environment/environment.go 16.66% 4 Missing and 1 partial ⚠️
internal/neosync-types/types.go 86.20% 3 Missing and 1 partial ⚠️
internal/benthos/benthos-builder/builders/sql.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2993      +/-   ##
==========================================
+ Coverage   35.57%   35.77%   +0.20%     
==========================================
  Files         337      342       +5     
  Lines       39120    39529     +409     
==========================================
+ Hits        13915    14141     +226     
- Misses      23574    23729     +155     
- Partials     1631     1659      +28     

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

Copy link
Member

@nickzelei nickzelei left a comment

Choose a reason for hiding this comment

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

Overall this looks great.
Left a few small comments.

Beginning of a new system!

return v
default:
// Check if the type implements Value() method
if valuer, ok := v.(neosynctypes.NeosyncAdapter); ok {
Copy link
Member

Choose a reason for hiding this comment

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

Could further slim this down by having a NeosyncPgxValuer() interface that only calls out the ValuePgx function. I think that's all this thing needs anyways.

@@ -189,12 +201,18 @@ func (g *neosyncInput) Read(ctx context.Context) (*service.Message, service.AckF
}, nil
}
}

registry := neosynctypes.NewTypeRegistry(g.logger)
Copy link
Member

Choose a reason for hiding this comment

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

Should this be registered every time or just during init?

valuesMap := map[string]any{}
for col, val := range row {
if len(val) == 0 {
valuesMap[col] = nil
} else {
valuesMap[col] = val
newVal, err := registry.Unmarshal(val)
Copy link
Member

Choose a reason for hiding this comment

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

so clean

@alishakawaguchi alishakawaguchi merged commit 58a4813 into main Nov 26, 2024
8 checks passed
@alishakawaguchi alishakawaguchi deleted the alisha/neo-types branch November 26, 2024 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Improvement Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants