mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-07 14:19:10 -04:00
compile options
This commit is contained in:
parent
3a95d959ef
commit
937f856f37
5 changed files with 41 additions and 1 deletions
1
Changes
1
Changes
|
@ -4,6 +4,7 @@ Changes for Perl extension DBD-SQLite
|
|||
- Updated to SQLite 3.6.23.1 (ISHIGAKI)
|
||||
- Resolved #56693: [PATCH] Fix spelling errors (patch by
|
||||
Ansgar Burchardt) (ISHIGAKI)
|
||||
- Added compile_options() to get compile options (ISHIGAKI)
|
||||
|
||||
1.30_02 Tue 30 Mar 2010
|
||||
- Implemented sqlite_use_immediate_transaction database handle
|
||||
|
|
|
@ -205,6 +205,12 @@ MODULE = DBD::SQLite PACKAGE = DBD::SQLite
|
|||
|
||||
PROTOTYPES: ENABLE
|
||||
|
||||
SV *
|
||||
compile_options()
|
||||
CODE:
|
||||
ST(0) = (SV*)sqlite_compile_options();
|
||||
XSRETURN(1);
|
||||
|
||||
static int
|
||||
OK()
|
||||
CODE:
|
||||
|
|
22
dbdimp.c
22
dbdimp.c
|
@ -990,6 +990,28 @@ sqlite_bind_col(SV *sth, imp_sth_t *imp_sth, SV *col, SV *ref, IV sql_type, SV *
|
|||
* Driver Private Methods
|
||||
*-----------------------------------------------------*/
|
||||
|
||||
SV *
|
||||
sqlite_compile_options()
|
||||
{
|
||||
dTHX;
|
||||
int i = 0;
|
||||
const char *option;
|
||||
|
||||
#if SQLITE_VERSION_NUMBER < 3006023
|
||||
return &PL_sv_undef;
|
||||
#endif
|
||||
#ifdef SQLITE_OMIT_COMPILEOPTION_DIAGS
|
||||
return &PL_sv_undef;
|
||||
#endif
|
||||
|
||||
AV *av = newAV();
|
||||
while(option = sqlite3_compileoption_get(i++)) {
|
||||
av_push(av, newSVpv(option, 0));
|
||||
}
|
||||
|
||||
return sv_2mortal(newRV_noinc((SV*)av));
|
||||
}
|
||||
|
||||
int
|
||||
sqlite_db_busy_timeout(pTHX_ SV *dbh, int timeout )
|
||||
{
|
||||
|
|
|
@ -781,7 +781,7 @@ named) placeholders to avoid confusion.
|
|||
B<BE PREPARED! WOLVES APPROACH!!>
|
||||
|
||||
SQLite has started supporting foreign key constraints since 3.6.19
|
||||
(released on Oct 14, 2009; bundled with DBD::SQLite 1.26_05).
|
||||
(released on Oct 14, 2009; bundled in DBD::SQLite 1.26_05).
|
||||
To be exact, SQLite has long been able to parse a schema with foreign
|
||||
keys, but the constraints has not been enforced. Now you can issue
|
||||
a pragma actually to enable this feature and enforce the constraints.
|
||||
|
@ -1440,6 +1440,12 @@ sqlite3 extensions. After the call, you can load extensions like this:
|
|||
$sth = $dbh->prepare("select load_extension('libsqlitefunctions.so')")
|
||||
or die "Cannot prepare: " . $dbh->errstr();
|
||||
|
||||
=head2 DBD::SQLite::compile_options()
|
||||
|
||||
Returns an array reference of compile options (available since sqlite 3.6.23,
|
||||
bundled in DBD::SQLite 1.30_01), or undef if the bundled library is old or
|
||||
compiled with SQLITE_OMIT_COMPILEOPTION_DIAGS.
|
||||
|
||||
=head1 DRIVER CONSTANTS
|
||||
|
||||
A subset of SQLite C constants are made available to Perl,
|
||||
|
|
|
@ -16,3 +16,8 @@ use_ok('DBD::SQLite');
|
|||
use_ok('t::lib::Test');
|
||||
|
||||
diag("\$DBI::VERSION=$DBI::VERSION");
|
||||
|
||||
if (my $compile_options = DBD::SQLite::compile_options()) {
|
||||
diag("Compile Options:");
|
||||
diag(join "", map { " $_\n" } @$compile_options);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue