Skip to content

Commit

Permalink
fix: text - postgres-compatible btrim function
Browse files Browse the repository at this point in the history
  • Loading branch information
nalgeon committed Jun 5, 2023
1 parent 085192e commit 35b4714
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/sqlite3-text.c
Expand Up @@ -750,6 +750,7 @@ static void sqlite3_reverse(sqlite3_context* context, int argc, sqlite3_value**

// Returns the number of characters in the string.
// text_length(str)
// [pg-compatible] length(text)
// [pg-compatible] char_length(text)
// [pg-compatible] character_length(text)
static void sqlite3_length(sqlite3_context* context, int argc, sqlite3_value** argv) {
Expand Down Expand Up @@ -842,6 +843,7 @@ __declspec(dllexport)
sqlite3_create_function(db, "text_rtrim", -1, flags, rstring.trim_right, sqlite3_trim, 0, 0);
sqlite3_create_function(db, "rtrim", -1, flags, rstring.trim_right, sqlite3_trim, 0, 0);
sqlite3_create_function(db, "text_trim", -1, flags, rstring.trim, sqlite3_trim, 0, 0);
sqlite3_create_function(db, "btrim", -1, flags, rstring.trim, sqlite3_trim, 0, 0);
sqlite3_create_function(db, "text_lpad", -1, flags, rstring.pad_left, sqlite3_pad, 0, 0);
sqlite3_create_function(db, "lpad", -1, flags, rstring.pad_left, sqlite3_pad, 0, 0);
sqlite3_create_function(db, "text_rpad", -1, flags, rstring.pad_right, sqlite3_pad, 0, 0);
Expand Down

0 comments on commit 35b4714

Please sign in to comment.