mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-07 06:08:38 -04:00
Make DBD_SQLITE_STRING_MODE_ constants exportable
This commit is contained in:
parent
5c7779f889
commit
dddc12423a
2 changed files with 42 additions and 3 deletions
|
@ -319,6 +319,11 @@ our %EXPORT_TAGS = (
|
|||
SQLITE_DBCONFIG_TRIGGER_EQP
|
||||
SQLITE_DBCONFIG_TRUSTED_SCHEMA
|
||||
SQLITE_DBCONFIG_WRITABLE_SCHEMA
|
||||
DBD_SQLITE_STRING_MODE_BYTES
|
||||
DBD_SQLITE_STRING_MODE_PV
|
||||
DBD_SQLITE_STRING_MODE_UNICODE_FALLBACK
|
||||
DBD_SQLITE_STRING_MODE_UNICODE_NAIVE
|
||||
DBD_SQLITE_STRING_MODE_UNICODE_STRICT
|
||||
SQLITE_DELETE
|
||||
SQLITE_DENY
|
||||
SQLITE_DETACH
|
||||
|
@ -525,6 +530,14 @@ our %EXPORT_TAGS = (
|
|||
SQLITE_DBCONFIG_WRITABLE_SCHEMA
|
||||
/],
|
||||
|
||||
dbd_sqlite_string_mode => [qw/
|
||||
DBD_SQLITE_STRING_MODE_BYTES
|
||||
DBD_SQLITE_STRING_MODE_PV
|
||||
DBD_SQLITE_STRING_MODE_UNICODE_FALLBACK
|
||||
DBD_SQLITE_STRING_MODE_UNICODE_NAIVE
|
||||
DBD_SQLITE_STRING_MODE_UNICODE_STRICT
|
||||
/],
|
||||
|
||||
extended_result_codes => [qw/
|
||||
SQLITE_ABORT_ROLLBACK
|
||||
SQLITE_AUTH_USER
|
||||
|
@ -699,7 +712,7 @@ DBD::SQLite::Constants - common SQLite constants
|
|||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
You can import necessary SQLite constants from this module. Available tags are C<all>, C<allowed_return_values_from_sqlite3_txn_state>, C<authorizer_action_codes>, C<authorizer_return_codes>, C<version> (C<compile_time_library_version_numbers>), C<database_connection_configuration_options>, C<extended_result_codes>, C<file_open> (C<flags_for_file_open_operations>), C<function_flags>, C<datatypes> (C<fundamental_datatypes>), C<result_codes>, C<run_time_limit_categories>. See L<http://sqlite.org/c3ref/constlist.html> for the complete list of constants.
|
||||
You can import necessary SQLite constants from this module. Available tags are C<all>, C<allowed_return_values_from_sqlite3_txn_state>, C<authorizer_action_codes>, C<authorizer_return_codes>, C<version> (C<compile_time_library_version_numbers>), C<database_connection_configuration_options>, C<dbd_sqlite_string_mode>, C<extended_result_codes>, C<file_open> (C<flags_for_file_open_operations>), C<function_flags>, C<datatypes> (C<fundamental_datatypes>), C<result_codes>, C<run_time_limit_categories>. See L<http://sqlite.org/c3ref/constlist.html> for the complete list of constants.
|
||||
|
||||
This module does not export anything by default.
|
||||
|
||||
|
@ -853,6 +866,22 @@ This module does not export anything by default.
|
|||
|
||||
=back
|
||||
|
||||
=head2 dbd_sqlite_string_mode
|
||||
|
||||
=over 4
|
||||
|
||||
=item DBD_SQLITE_STRING_MODE_PV
|
||||
|
||||
=item DBD_SQLITE_STRING_MODE_BYTES
|
||||
|
||||
=item DBD_SQLITE_STRING_MODE_UNICODE_NAIVE
|
||||
|
||||
=item DBD_SQLITE_STRING_MODE_UNICODE_FALLBACK
|
||||
|
||||
=item DBD_SQLITE_STRING_MODE_UNICODE_STRICT
|
||||
|
||||
=back
|
||||
|
||||
=head2 extended_result_codes
|
||||
|
||||
=over 4
|
||||
|
|
|
@ -189,11 +189,14 @@ END
|
|||
|
||||
my %seen;
|
||||
$constants{all} = [sort grep {!$seen{$_}++} map {@$_} values %constants];
|
||||
push @{$constants{all}}, @dbd_sqlite_constants;
|
||||
$constants{dbd_sqlite_string_mode} = [grep /^DBD_SQLITE_STRING_MODE_/, @dbd_sqlite_constants];
|
||||
|
||||
my $sp = ' ' x 6;
|
||||
for my $tag (sort keys %constants) {
|
||||
print $fh <<"END";
|
||||
$tag => [qw/
|
||||
@{[join "\n", map {" SQLITE_$_"} sort @{$constants{$tag}}]}
|
||||
@{[join "\n", map { /^DBD_SQLITE_/ ? "$sp$_" : "${sp}SQLITE_$_"} sort @{$constants{$tag}}]}
|
||||
/],
|
||||
|
||||
END
|
||||
|
@ -244,10 +247,17 @@ END
|
|||
|
||||
END
|
||||
for my $const (@{$constants{$tag}}) {
|
||||
print $fh <<"END";
|
||||
if ($const =~ /^DBD_SQLITE_/) {
|
||||
print $fh <<"END";
|
||||
\=item $const
|
||||
|
||||
END
|
||||
} else {
|
||||
print $fh <<"END";
|
||||
\=item SQLITE_$const
|
||||
|
||||
END
|
||||
}
|
||||
}
|
||||
print $fh <<"END";
|
||||
\=back
|
||||
|
|
Loading…
Add table
Reference in a new issue