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

Fix malformed array literal cause by Overalps func #43

Merged
merged 2 commits into from
Jan 6, 2024
Merged

Fix malformed array literal cause by Overalps func #43

merged 2 commits into from
Jan 6, 2024

Conversation

whoiscarlo
Copy link
Contributor

https://www.postgresql.org/docs/current/arrays.html

What kind of change does this PR introduce?

Correctly formatting the array used by the Overlap function

Bug fix, feature, docs update, ...
Arrays in Postgres use this string format '{10000, 10000, 10000, 10000}' or '{"meeting", "lunch"}'

What is the current behavior?

value []string{"foo", "bar"} turns into foo bar

Please link any relevant issues here.
Seeding database error while running locally

What is the new behavior?

Will turn values []string{"foo", "bar"} into '{"foo", "bar"}'

Additional context

https://www.postgresql.org/docs/current/arrays.html

Arrays in Postgres use this string format  '{10000, 10000, 10000, 10000}' or '{"meeting", "lunch"}'

https://www.postgresql.org/docs/current/arrays.html
filterbuilder.go Outdated
@@ -196,7 +196,13 @@ func (f *FilterBuilder) RangeAdjacent(column, value string) *FilterBuilder {
}

func (f *FilterBuilder) Overlaps(column string, value []string) *FilterBuilder {
f.params[column] = "ov." + strings.Join(value, ",")
_new := []string{}
Copy link
Member

Choose a reason for hiding this comment

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

just change here like "new" we not use '_' from variables and other sides looks good thanks for help

Copy link
Contributor Author

@whoiscarlo whoiscarlo Jan 6, 2024

Choose a reason for hiding this comment

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

K cool changed it to newValue and no prob

Copy link
Member

@muratmirgun muratmirgun left a comment

Choose a reason for hiding this comment

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

Thanks for fast return 🚀

@muratmirgun muratmirgun merged commit c5401e9 into supabase-community:main Jan 6, 2024
1 check passed
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.

2 participants