classification
Title: Enable linking the module pysqlite with Berkeley DB SQL instead of SQLite
Type: enhancement Stage: resolved
Components: Build Versions: Python 3.3
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: Lauren.Foutz, eric.snow, ghaering, jcea, ned.deily, petri.lehtinen
Priority: normal Keywords:

Created on 2011-11-21 16:55 by Lauren.Foutz, last changed 2012-05-23 18:05 by petri.lehtinen. This issue is now closed.

Messages (8)
msg148058 - (view) Author: Lauren Foutz (Lauren.Foutz) Date: 2011-11-21 16:55
Before the pysqlite module was made standard it could be edited to link with Berkeley DB SQL instead of SQLite.  I am requesting that the Python build add the ability to link with BDBSQL instead of SQLite.
msg148059 - (view) Author: Lauren Foutz (Lauren.Foutz) Date: 2011-11-21 16:58
Before the pysqlite module was made standard it could be edited to link with Berkeley DB SQL instead of SQLite.  I am requesting that the Python build add the ability to link with BDBSQL instead of SQLite.

Below is a description of how to link pysqlite with BDBSQL


Download and unpack the latest version of pysqlite.
Download and unpack the latest release of Berkeley Db (at least db-5.0 or higher).
Build bdb using the following:
cd db/build_unix
../dist/configure --enable-sql-compat --prefix=<bdb install directory>
make
make install

Next change to the top pysqlite directory. There edit the file setup.cfg to the following:
[build_ext]
#define=
include_dirs=<bdb install directory>/include
library_dirs=<bdb install directory>/lib
libraries=sqlite3
define=SQLITE_OMIT_LOAD_EXTENSION

Note, make sure you uncomment the lines with "include_dirs" and "library_dirs"

Next, build and install the python sqlite3 library using:
python setup.py build
python setup.py install
msg148089 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-11-21 21:16
Support for Berkeley DB (the bsddb) was removed from the standard library in Python 3 and replaced by a third-party module (bsddb3) listed in PyPI which is better able to keep up with changes in the various BDB releases.  

http://docs.python.org/py3k/whatsnew/3.0.html#library-changes
http://pypi.python.org/pypi/bsddb3/

What would be the reason for bringing back a dependency on BDB into the standard library?  Wouldn't this better be handled in the standalone pysqlite package?
msg148091 - (view) Author: Lauren Foutz (Lauren.Foutz) Date: 2011-11-21 21:31
Berkeley DB SQL is a separate library from Berkeley DB.  It is an SQL engine that uses the same API as SQLite and uses Berkeley DB as its backend.  The modules that support Berkeley DB lack all of the SQL features and cannot be used to operate on a Berkeley DB SQL databases.
msg152500 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2012-02-03 09:17
Is it possible to compile pysqlite so that it links with both, or so that the linking type can be changed at run time?

I'm -1 on adding a compile-time option to switch the storage backend to Python itself, but a runtime flag or a separate connection class for the sqlite3 module would do.
msg161370 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2012-05-22 18:49
Still waiting for the info about whether this can be done at run-time.
msg161374 - (view) Author: Lauren Foutz (Lauren.Foutz) Date: 2012-05-22 19:13
It is not possible to compile pysqlite to link with both, and even if it
was it would not be a good idea, since databases created by bdbsql cannot
be accessed by sqlite, and visa versa.

Because of the incompatibility I think a runtime flag would lead to a lot
of user error, but a separate connection class in the sqlite3 module might
work, but because the libraries share the same external functions, linking
them both with the python library will be difficult if not impossible.

Lauren

On Fri, Feb 3, 2012 at 4:17 AM, Petri Lehtinen <report@bugs.python.org>wrote:

>
> Petri Lehtinen <petri@digip.org> added the comment:
>
> Is it possible to compile pysqlite so that it links with both, or so that
> the linking type can be changed at run time?
>
> I'm -1 on adding a compile-time option to switch the storage backend to
> Python itself, but a runtime flag or a separate connection class for the
> sqlite3 module would do.
>
> ----------
> nosy: +petri.lehtinen
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue13445>
> _______________________________________
>
msg161444 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2012-05-23 18:05
Ok. Closing as wontfix then.
History
Date User Action Args
2012-05-23 18:05:06petri.lehtinensetstatus: open -> closed
resolution: wont fix
messages: + msg161444

stage: resolved
2012-05-22 19:13:10Lauren.Foutzsetstatus: pending -> open

messages: + msg161374
2012-05-22 18:49:17petri.lehtinensetstatus: open -> pending

messages: + msg161370
2012-02-03 09:17:34petri.lehtinensetnosy: + petri.lehtinen
messages: + msg152500
2011-11-21 21:31:19Lauren.Foutzsetmessages: + msg148091
2011-11-21 21:16:14ned.deilysetnosy: + jcea, ned.deily
messages: + msg148089
2011-11-21 20:12:08eric.snowsetnosy: + eric.snow
2011-11-21 16:58:56pitrousetnosy: + ghaering

versions: + Python 3.3
2011-11-21 16:58:37Lauren.Foutzsetmessages: + msg148059
2011-11-21 16:55:14Lauren.Foutzcreate