FAQ
NAME:
pysqlite - Extension module for SQLite databases.

DESCRIPTION:
A Python-DB API 2.0 compliant extension module that connects to
SQLite databases.

SQLite is a powerful, embedded relational database in a compact C library.
It supports a large subset of SQL92, multiple tables and indices,
transactions, and triggers. It has a simple C/C++ interface requiring only
three functions to perform queries. It has TCL bindings and an ODBC
driver. Sources are uncopyrighted and can be used for any purpose. More
information can be found at <http://www.hwaci.com/sw/sqlite/index.html>.

USAGE:
import sqlite

conn = sqlite.connect("db")
cursor = conn.cursor()
SQL = """ select category, family, genus, species
from calflora order by genus, species limit 10"""

cursor.execute(SQL)

for col in cursor.description:
print "\t %12s - %3s bytes" % (col[0], repr(col[3]))

row = cursor.fetchone()

while row != None:
print "%14s, %15s, %19s, %8s, %25s" % tuple(row)
row = cursor.fetchone()

SQL = "insert into calflora (family,genus,species) values(%s,%s,%s)"
cursor.execute(SQL, ('greenus', 'weedus', 'maximus'))

conn.close()

HOMEPAGE:
<http://pysqlite.sourceforge.net>

DOWNLOAD:
Source and Windows binary downloads are available at
<http://www.sourceforge.net/projects/pysqlite>

AUTHORS:
Gerhard H?ring <gerhard.haering at gmx.de>
Michael Owens <mike at mikesclutter.com>
William Trenker <wtrenker at shaw.ca>

LICENSE:
Python

NOTES:
PySQLite has been tested on FreeBSD, Linux, and Windows with both Python 2.1
and 2.2. The latest versions of SQLite (v. 2.6 and greater) are recommended.

Version 0.3.0 fixed a lot of bugs, while also adding new features. Users of
PySQLite are recommended to upgrade.

The following are some of the changes and enhancements since the last
release:

- Squashed a few memory leaks.

- Exposed the sqlite_exec, sqlite_last_insert_rowid and
sqlite_changes functions of SQLite to Python as methods of the
connection object.

- Add support for Date types, if mxDateTime is
available.

- Support for optional DB-API extensions from PEP 0249

- Added files for creating a PySQLite Debian package.

- setup.py: - Added Cygwin as platform that's supported by default

- Added third example: program to dump a table in XML format.

- Use bool type and custom bool converter for boolean fields.

- Set cursor.rowcount appropriately after DML (insert/update/delete)
statements.

- Fixed a bug with the SQL-quoting of longs.

- Inline documentation improvement.

- Change invocation of ReferenceError to work with Python 2.1

- (really) implemented weak references from cursors to connections

- Added new test suite.

- Adapted test for threadsafety attribute.

- Added checks with user-defined float and string functions.

- Removed Connection.begin(). Transactions are now started
implicitely. - Use DB-API quoting instead of manual Python
quoting. - Use string methods instead of the string module.

- Added checks for functions/aggreagates that raise exceptions or
return None (NULL).

- Added tests for proper commit/rollback behaviour. Added tests
for autocommit feature.

- Implemented autocommit feature. Renamed the parameter of
Connection.__init__ from "filename" to "db". Commit and rollback
now check if the connection is open at all. Started adapting the
weak reference code from pyPgSQL to loosely couple cursors and
connections. This is needed when you want to check if there are
any open cursors for a given connection, for example.

- Simplified version numbers, removed the check for equal version
numbers in _sqlite and sqlite. This looked like overhead to
me. The version number scheme is now only: major.minor.micro Set
threadsafety to level 1. I believe we can guarantee than sharing
the module among threads will do no harm. Sharing the connection
would.

Search Discussions

  • Terry Reedy at Sep 12, 2002 at 1:36 pm
    "Gerhard H?ring" <gerhard.haering at opus-gmbh.net> wrote in message
    news:slrnao0e6p.23c.gerhard.haering at haering.opus-gmbh.net...
    A Python-DB API 2.0 compliant extension module that connects to
    SQLite databases. ...
    row = cursor.fetchone()

    while row != None:
    print "%14s, %15s, %19s, %8s, %25s" % tuple(row)
    row = cursor.fetchone()
    Does anyone know whether there are any plans to update the Python-DB
    API to the new iterator protocols, so that the above could be written
    more simply something like

    for row in cursor:
    print "%14s, %15s, %19s, %8s, %25s" % tuple(row)
    ?

    Terry J. Reedy
  • Daniel Dittmar at Sep 12, 2002 at 1:57 pm

    Terry Reedy wrote:
    Does anyone know whether there are any plans to update the Python-DB
    API to the new iterator protocols, so that the above could be written
    more simply something like

    for row in cursor:
    print "%14s, %15s, %19s, %8s, %25s" % tuple(row)
    It's already in the 'Optional DB API Extensions' in
    http://www.python.org/peps/pep-0249.html

    Daniel
  • Gerhard Häring at Sep 12, 2002 at 2:23 pm

    Daniel Dittmar wrote:
    Terry Reedy wrote:
    Does anyone know whether there are any plans to update the Python-DB
    API to the new iterator protocols, so that the above could be written
    more simply something like

    for row in cursor:
    print "%14s, %15s, %19s, %8s, %25s" % tuple(row)
    It's already in the 'Optional DB API Extensions' in
    http://www.python.org/peps/pep-0249.html
    Yep and these extensions are fully supported by PySQLite and pyPgSQL :-)

    -- Gerhard
  • Sismex01 at Sep 12, 2002 at 5:07 pm

    "Gerhard H?ring" <gerhard.haering at opus-gmbh.net> wrote in message
    news:slrnao0e6p.23c.gerhard.haering at haering.opus-gmbh.net...
    A Python-DB API 2.0 compliant extension module that connects to
    SQLite databases. ...
    row = cursor.fetchone()

    while row != None:
    print "%14s, %15s, %19s, %8s, %25s" % tuple(row)
    row = cursor.fetchone()
    Does anyone know whether there are any plans to update the Python-DB
    API to the new iterator protocols, so that the above could be written
    more simply something like

    for row in cursor:
    print "%14s, %15s, %19s, %8s, %25s" % tuple(row)
    ?

    Terry J. Reedy
    You can already do it, using iter():

    for row in iter(cursor, None):
    print ....


    -gus

    Advertencia:
    La informacion contenida en este mensaje es confidencial y restringida y
    esta destinada unicamente para el uso de la persona arriba indicada, Esta
    comunicacion representa la opinion personal del remitente y no refleja
    necesariamente la opinion de la Compa?ia. Se le notifica que esta
    estrictamente prohibida cualquier difusion, distribucion o copia de este
    mensaje. Si ha recibido esta comunicacion o copia de este mensaje por error,
    o si hay problemas en la transmision, favor de comunicarse con el remitente.


    Todo el correo electr?nico enviado para o desde esta direcci?n ser?
    procesado por el sistema de correo corporativo de HEB. Tal correo
    electr?nico esta sujeto a ser almacenado y puede ser revisado por alguien
    ajeno al recipiente autorizado con el prop?sito de monitorear que se cumplan
    las normas de seguridad de la empresa.
  • ґРЬшРЭ і. at Sep 12, 2002 at 10:21 pm

    for row in cursor:
    print "%14s, %15s, %19s, %8s, %25s" % tuple(row)
    ?

    Terry J. Reedy
    You can already do it, using iter():
    for row in iter(cursor, None):
    print ....
    you mean:

    for row in iter(cursor.fetchone, None):
    print ...



    --
    ??????

    In a world without walls and fences,
    do we care about Windows and Gates ?
  • Sismex01 at Sep 12, 2002 at 10:31 pm
    Oops, you are SO right. :-)

    -gus
    --
    for row in cursor:
    print "%14s, %15s, %19s, %8s, %25s" % tuple(row)
    ?

    Terry J. Reedy
    You can already do it, using iter():
    for row in iter(cursor, None):
    print ....
    you mean:

    for row in iter(cursor.fetchone, None):
    print ...



    --
    ??????

    In a world without walls and fences,
    do we care about Windows and Gates ?

    --
    http://mail.python.org/mailman/listinfo/python-list
    Advertencia:
    La informacion contenida en este mensaje es confidencial y restringida y
    esta destinada unicamente para el uso de la persona arriba indicada, Esta
    comunicacion representa la opinion personal del remitente y no refleja
    necesariamente la opinion de la Compania. Se le notifica que esta
    estrictamente prohibida cualquier difusion, distribucion o copia de este
    mensaje. Si ha recibido esta comunicacion o copia de este mensaje por error,
    o si hay problemas en la transmision, favor de comunicarse con el remitente.


    Todo el correo electronico enviado para o desde esta direccion sera
    procesado por el sistema de correo corporativo de HEB. Tal correo
    electronico esta sujeto a ser almacenado y puede ser revisado por alguien
    ajeno al recipiente autorizado con el proposito de monitorear que se cumplan
    las normas de seguridad de la empresa.
  • Bob X at Sep 13, 2002 at 1:19 am

    Gerhard H?ring wrote:
    NAME:
    pysqlite - Extension module for SQLite databases.

    DESCRIPTION:
    A Python-DB API 2.0 compliant extension module that connects to
    SQLite databases.

    SQLite is a powerful, embedded relational database in a compact C library.
    It supports a large subset of SQL92, multiple tables and indices,
    transactions, and triggers. It has a simple C/C++ interface requiring only
    three functions to perform queries. It has TCL bindings and an ODBC
    driver. Sources are uncopyrighted and can be used for any purpose. More
    information can be found at <http://www.hwaci.com/sw/sqlite/index.html>.

    USAGE:
    import sqlite

    conn = sqlite.connect("db")
    cursor = conn.cursor()
    SQL = """ select category, family, genus, species
    from calflora order by genus, species limit 10"""

    cursor.execute(SQL)

    for col in cursor.description:
    print "\t %12s - %3s bytes" % (col[0], repr(col[3]))

    row = cursor.fetchone()

    while row != None:
    print "%14s, %15s, %19s, %8s, %25s" % tuple(row)
    row = cursor.fetchone()

    SQL = "insert into calflora (family,genus,species) values(%s,%s,%s)"
    cursor.execute(SQL, ('greenus', 'weedus', 'maximus'))

    conn.close()

    HOMEPAGE:
    <http://pysqlite.sourceforge.net>

    DOWNLOAD:
    Source and Windows binary downloads are available at
    <http://www.sourceforge.net/projects/pysqlite>

    AUTHORS:
    Gerhard H?ring <gerhard.haering at gmx.de>
    Michael Owens <mike at mikesclutter.com>
    William Trenker <wtrenker at shaw.ca>

    LICENSE:
    Python

    NOTES:
    PySQLite has been tested on FreeBSD, Linux, and Windows with both Python 2.1
    and 2.2. The latest versions of SQLite (v. 2.6 and greater) are recommended.

    Version 0.3.0 fixed a lot of bugs, while also adding new features. Users of
    PySQLite are recommended to upgrade.

    The following are some of the changes and enhancements since the last
    release:

    - Squashed a few memory leaks.

    - Exposed the sqlite_exec, sqlite_last_insert_rowid and
    sqlite_changes functions of SQLite to Python as methods of the
    connection object.

    - Add support for Date types, if mxDateTime is
    available.

    - Support for optional DB-API extensions from PEP 0249

    - Added files for creating a PySQLite Debian package.

    - setup.py: - Added Cygwin as platform that's supported by default

    - Added third example: program to dump a table in XML format.

    - Use bool type and custom bool converter for boolean fields.

    - Set cursor.rowcount appropriately after DML (insert/update/delete)
    statements.

    - Fixed a bug with the SQL-quoting of longs.

    - Inline documentation improvement.

    - Change invocation of ReferenceError to work with Python 2.1

    - (really) implemented weak references from cursors to connections

    - Added new test suite.

    - Adapted test for threadsafety attribute.

    - Added checks with user-defined float and string functions.

    - Removed Connection.begin(). Transactions are now started
    implicitely. - Use DB-API quoting instead of manual Python
    quoting. - Use string methods instead of the string module.

    - Added checks for functions/aggreagates that raise exceptions or
    return None (NULL).

    - Added tests for proper commit/rollback behaviour. Added tests
    for autocommit feature.

    - Implemented autocommit feature. Renamed the parameter of
    Connection.__init__ from "filename" to "db". Commit and rollback
    now check if the connection is open at all. Started adapting the
    weak reference code from pyPgSQL to loosely couple cursors and
    connections. This is needed when you want to check if there are
    any open cursors for a given connection, for example.

    - Simplified version numbers, removed the check for equal version
    numbers in _sqlite and sqlite. This looked like overhead to
    me. The version number scheme is now only: major.minor.micro Set
    threadsafety to level 1. I believe we can guarantee than sharing
    the module among threads will do no harm. Sharing the connection
    would.
    Windows binary?
  • Sismex01 at Sep 13, 2002 at 1:34 pm

    -----Original Message-----
    From: Bob X [mailto:bobx at linuxmail.org]
    Sent: Thursday, September 12, 2002 8:19 PM
    To: python-list at python.org
    Subject: Re: [ANN] PySQLite 0.3.0 released


    Gerhard H?ring wrote:
    NAME:
    pysqlite - Extension module for SQLite databases.

    ...[snip]
    Windows binary?
    Yeesh! You had to quote the whole message just to
    add two words?

    :-(

    -gus
    --
    -- Please disregard offensive and arrogant corporate
    -- legalese at end of this message.
    --

    Advertencia:
    La informacion contenida en este mensaje es confidencial y restringida y
    esta destinada unicamente para el uso de la persona arriba indicada, Esta
    comunicacion representa la opinion personal del remitente y no refleja
    necesariamente la opinion de la Compa?ia. Se le notifica que esta
    estrictamente prohibida cualquier difusion, distribucion o copia de este
    mensaje. Si ha recibido esta comunicacion o copia de este mensaje por error,
    o si hay problemas en la transmision, favor de comunicarse con el remitente.


    Todo el correo electr?nico enviado para o desde esta direcci?n ser?
    procesado por el sistema de correo corporativo de HEB. Tal correo
    electr?nico esta sujeto a ser almacenado y puede ser revisado por alguien
    ajeno al recipiente autorizado con el prop?sito de monitorear que se cumplan
    las normas de seguridad de la empresa.
  • Thorsten Kampe at Sep 13, 2002 at 5:17 pm
    * sismex01 at hebmex.com
    From: Bob X [mailto:bobx at linuxmail.org]
    [Merciless Fullquote]
    Yeesh! You had to quote the whole message just to
    add two words?
    That's nothing. Lately I've seen someone on the tutor list /quoting
    the whole message digest/ while replying to /a single message/. Now
    isn't that sweet?

    Thorsten
  • Bob X at Sep 15, 2002 at 7:16 pm
    sismex01 at hebmex.com wrote:
    <snip>

    Yeesh! You had to quote the whole message just to
    add two words?

    :-(

    -gus
    My bust on that one. I usually do a <snip> like I did above. Sorry bout dat.

    On that note...your two paragraph sig is okay right? ; )

    Bob
  • Steve Holden at Sep 16, 2002 at 11:47 am
    "Bob X" <bobx at linuxmail.org> wrote ...
    sismex01 at hebmex.com wrote:
    <snip>

    Yeesh! You had to quote the whole message just to
    add two words?

    :-(

    -gus
    My bust on that one. I usually do a <snip> like I did above. Sorry bout dat.
    On that note...your two paragraph sig is okay right? ; )
    No, his two-paragraph "sig" is a PITA, but probably it's not aa sig but
    something that his company's mailer sticks on the end of all message quite
    gratuitously, just so some corporate lawyer can sleep better (fancying his
    ass is covered).

    regards
    -----------------------------------------------------------------------
    Steve Holden http://www.holdenweb.com/
    Python Web Programming http://pydish.holdenweb.com/pwp/
    Previous .sig file retired to www.homeforoldsigs.com
    -----------------------------------------------------------------------
  • Bob X at Sep 16, 2002 at 8:42 pm
    Steve Holden wrote:
    <snip>
    No, his two-paragraph "sig" is a PITA, but probably it's not aa sig but
    something that his company's mailer sticks on the end of all message quite
    gratuitously, just so some corporate lawyer can sleep better (fancying his
    ass is covered).

    regards
    -----------------------------------------------------------------------
    Steve Holden http://www.holdenweb.com/
    Python Web Programming http://pydish.holdenweb.com/pwp/
    Previous .sig file retired to www.homeforoldsigs.com
    -----------------------------------------------------------------------
    And here I thought a PITA was a sandwich! :-)

    Bob

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedSep 12, '02 at 6:52a
activeSep 16, '02 at 8:42p
posts13
users8
websitepython.org

People

Translate

site design / logo © 2022 Grokbase