Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 62 lines (46 sloc) 2.0 kb
5426397 @kgaughan Made the README read like a proper README.
authored
1 **dbkit** is a library that abstracts away at least part of the pain
2 involved in dealing with `DB-API 2`_ compatible database drivers.
d1b5cd8 @kgaughan Swap the readme files.
authored
3
8ee9f8b @kgaughan Travis CI status image.
authored
4 .. image:: https://secure.travis-ci.org/kgaughan/dbkit.png?branch=master
4be226b @kgaughan Travis CI project link.
authored
5 :width: 89px
6 :height: 13px
7 :target: http://travis-ci.org/kgaughan/dbkit
8ee9f8b @kgaughan Travis CI status image.
authored
8
0f87d34 @kgaughan An hello world example.
authored
9 ::
10
11 from dbkit import connect, query
12 from contextlib import closing
13 import sqlite3
14
15 with connect(sqlite3, 'counters.db') as ctx, closing(ctx):
16 for counter, value in query('SELECT counter, value FROM counters'):
17 print "%s: %d" % (counter, value)
18
8ab76c1 @kgaughan Move the metadata down a touch.
authored
19 :Author:
20 Keith Gaughan (http://stereochro.me)
21
22 :Repo:
23 https://github.com/kgaughan/dbkit
24
25 :Documentation:
26 http://dbkit.readthedocs.org/
27
d1b5cd8 @kgaughan Swap the readme files.
authored
28
29 Overview
30 ========
31
32 *dbkit* is intended to be used in circumstances where it is impractical
33 or overkill to use an ORM such as `SQLObject`_ or `SQLAlchemy`_, but it
34 would be useful to at least abstract away some of the pain involved in
35 dealing with the database.
36
5426397 @kgaughan Made the README read like a proper README.
authored
37 Features:
38
39 - Rather than passing around database connections, statements are executed
40 within a database `context`_, thus helping to decouple modules that
41 interface with the database from the database itself and its connection
42 details.
43 - Database contexts contain references to the exceptions exposed by the
44 database driver, thus decoupling exception handling from the database
45 driver.
46 - Easier to use transaction handling.
47 - Easier iteration over resultsets.
48 - Connection pooling. In addition, any code using pooled connections has
49 no need to know connection pooling is in place.
50 - Query logging.
d1b5cd8 @kgaughan Swap the readme files.
authored
51
52 Non-aims:
53
54 - Abstraction of SQL statements. The idea is to get rid of the more
55 annoying but necessary boilerplate code involved in dealing with
5426397 @kgaughan Made the README read like a proper README.
authored
56 `DB-API 2`_ drivers, not to totally abstract away SQL itself.
d1b5cd8 @kgaughan Swap the readme files.
authored
57
58 .. _DB-API 2: http://www.python.org/dev/peps/pep-0249/
59 .. _SQLObject: http://sqlobject.org/
60 .. _SQLAlchemy: http://sqlalchemy.org/
5426397 @kgaughan Made the README read like a proper README.
authored
61 .. _context: http://docs.python.org/library/contextlib.html
Something went wrong with that request. Please try again.