Skip Menu |

This queue is for tickets about the DBD-SQLite CPAN distribution.

Report information
The Basics
Id: 5455
Status: resolved
Priority: 0/
Queue: DBD-SQLite

People
Owner: Nobody in particular
Requestors: david_dick [...] iprimus.com.au
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Patch for basic get_info support
This patch will permit the correct values to be retrieved for $dbh->get_info(17) and $dbh->get_info(18) i.e. database name and version.
diff -ru DBD-SQLite-0.29/lib/DBD/SQLite.pm new/lib/DBD/SQLite.pm --- DBD-SQLite-0.29/lib/DBD/SQLite.pm 2003-12-06 02:12:48.000000000 +1100 +++ new/lib/DBD/SQLite.pm 2004-02-26 15:01:13.000000000 +1100 @@ -76,6 +76,22 @@ return $sth; } +sub _get_version { + my ($dbh) = @_; + return (DBD::SQLite::db::FETCH($dbh, 'sqlite_version')); +} + +our (%info) = ( + 17 => 'SQLite', + 18 => \&_get_version, +); + +sub get_info { + my($dbh, $info_type) = @_; + my $v = $info{int($info_type)}; + $v = $v->($dbh) if ref $v eq 'CODE'; + return $v; +} sub table_info { my ($dbh, $CatVal, $SchVal, $TblVal, $TypVal) = @_; Only in new: temp.db
patch now also includes support for SQL_IDENTIFIER_QUOTE_CHAR
diff -ru DBD-SQLite-0.31/lib/DBD/SQLite.pm new/lib/DBD/SQLite.pm --- DBD-SQLite-0.31/lib/DBD/SQLite.pm 2004-02-15 06:13:51.000000000 +1100 +++ new/lib/DBD/SQLite.pm 2004-03-03 13:18:35.000000000 +1100 @@ -75,6 +75,23 @@ return $sth; } +sub _get_version { + my ($dbh) = @_; + return (DBD::SQLite::db::FETCH($dbh, 'sqlite_version')); +} + +our (%info) = ( + 17 => 'SQLite', # SQL_DBMS_NAME + 18 => \&_get_version, # SQL_DBMS_VER + 29 => '"', # SQL_IDENTIFIER_QUOTE_CHAR +); + +sub get_info { + my($dbh, $info_type) = @_; + my $v = $info{int($info_type)}; + $v = $v->($dbh) if ref $v eq 'CODE'; + return $v; +} sub table_info { my ($dbh, $CatVal, $SchVal, $TblVal, $TypVal) = @_;