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

PostgreSQL function PR feedback #93

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions server/functions/left.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ package functions
// left represents the PostgreSQL function of the same name.
var left = Function{
Name: "left",
Overloads: []interface{}{left_string},
Overloads: []interface{}{left_string_int},
}

// left_string is one of the overloads of left.
func left_string(string StringType, n IntegerType) (StringType, error) {
func left_string_int(string StringType, n IntegerType) (StringType, error) {
if string.IsNull || n.IsNull {
return StringType{IsNull: true}, nil
}
Expand Down
4 changes: 2 additions & 2 deletions server/functions/right.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ package functions
// right represents the PostgreSQL function of the same name.
var right = Function{
Name: "right",
Overloads: []interface{}{right_string},
Overloads: []interface{}{right_string_int},
}

// right_string is one of the overloads of right.
func right_string(string StringType, n IntegerType) (StringType, error) {
func right_string_int(string StringType, n IntegerType) (StringType, error) {
if string.IsNull || n.IsNull {
return StringType{IsNull: true}, nil
}
Expand Down
4 changes: 2 additions & 2 deletions server/functions/split_part.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (
// split_part represents the PostgreSQL function of the same name.
var split_part = Function{
Name: "split_part",
Overloads: []interface{}{split_part_string},
Overloads: []interface{}{split_part_string_string_int},
}

// split_part_string is one of the overloads of split_part.
func split_part_string(str StringType, delimiter StringType, n IntegerType) (StringType, error) {
func split_part_string_string_int(str StringType, delimiter StringType, n IntegerType) (StringType, error) {
if str.IsNull || delimiter.IsNull || n.IsNull {
return StringType{IsNull: true}, nil
}
Expand Down