Skip to content

Commit

Permalink
SQLite: Adding a UDF concat_ws().
Browse files Browse the repository at this point in the history
It is supported by MySQL, PostgreSQL and Oracle (also MS SQL 2017) while SQLite does not.
  • Loading branch information
ikedas committed Feb 3, 2019
1 parent c2c7b05 commit 266230e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib/Sympa/DatabaseDriver/SQLite.pm
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ sub connect {
$self->__dbh->func(5000, 'busy_timeout');
}

# Compatibility with other drivers.
# concat_ws(): Since 6.2.XX.
$self->__dbh->func('concat_ws', -1, sub {
my $sep = shift;
return undef unless defined $sep;
return join $sep, grep {defined} @_;
}, 'create_function');

return 1;
}

Expand Down

0 comments on commit 266230e

Please sign in to comment.