projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Shop: Vorgangsbezeichnung nicht bei Shopware6 implementiert
[kivitendo-erp.git]
/
SL
/
DBUtils.pm
diff --git
a/SL/DBUtils.pm
b/SL/DBUtils.pm
index
d638f89
..
f095244
100644
(file)
--- a/
SL/DBUtils.pm
+++ b/
SL/DBUtils.pm
@@
-13,7
+13,7
@@
our @EXPORT = qw(conv_i conv_date conv_dateq do_query selectrow_query do_stateme
selectall_ids
prepare_execute_query prepare_query
create_sort_spec does_table_exist
selectall_ids
prepare_execute_query prepare_query
create_sort_spec does_table_exist
- add_token);
+ add_token
check_trgm
);
use strict;
use strict;
@@
-92,7
+92,7
@@
sub dump_query {
my $self_filename = 'SL/DBUtils.pm';
my $filename = $self_filename;
my ($caller_level, $line, $subroutine);
my $self_filename = 'SL/DBUtils.pm';
my $filename = $self_filename;
my ($caller_level, $line, $subroutine);
- while ($filename
eq $self_filename
) {
+ while ($filename
=~ m{$self_filename$}
) {
(undef, $filename, $line, $subroutine) = caller $caller_level++;
}
(undef, $filename, $line, $subroutine) = caller $caller_level++;
}
@@
-398,6
+398,14
@@
sub role_is_superuser {
return $is_superuser;
}
return $is_superuser;
}
+sub check_trgm {
+ my ($dbh) = @_;
+
+ my $version = $dbh->selectrow_array(qq|SELECT installed_version FROM pg_available_extensions WHERE name = 'pg_trgm'|);
+
+ return !!$version;
+}
+
1;
1;
@@
-684,6
+692,11
@@
application (e.g. if the user clicked on a column header in a
report). If it is undefined then the 'default_dir' parameter will be
used instead.
report). If it is undefined then the 'default_dir' parameter will be
used instead.
+=item check_trgm
+
+Checks if the postgresextension pg_trgm is installed and return trueish
+or falsish.
+
=back
=head1 DEBUG FUNCTIONS
=back
=head1 DEBUG FUNCTIONS