-
Notifications
You must be signed in to change notification settings - Fork 185
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviorfunc trans 🌍Translation of individual functions to SQLTranslation of individual functions to SQLhelp wanted ❤️we'd love your help!we'd love your help!
Description
The current implementation of str_replace_all which was introduced in PR #131 for postgres backends has no global parameter, thus replacing only the first occurence of any match in a string:
File R/backend-postgres.R, line 58ff:
str_replace_all = function(string, pattern, replacement){
sql_expr(regexp_replace(!!string, !!pattern, !!replacement))
}To my mind, the correct implementation would be
str_replace_all = function(string, pattern, replacement){
sql_expr(regexp_replace(!!string, !!pattern, !!replacement, 'g'))
}Also, the fix of str_detect has disappeared from master and it is not possible to grep for regular expressions on Postgres databases at the moment: Line 55 in beforementioned file quotes
str_detect = function(string, pattern) {
sql_expr(strpos(!!string, !!pattern) > 0L)
}instead of the line that was implemented Pull request #131:
str_detect = sql_infix("~"),Thanks for the great effort and package!
sandro
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviorfunc trans 🌍Translation of individual functions to SQLTranslation of individual functions to SQLhelp wanted ❤️we'd love your help!we'd love your help!