1 | # pyDAL |
---|
2 | |
---|
3 | pyDAL is a pure Python Database Abstraction Layer. |
---|
4 | |
---|
5 | It dynamically generates the SQL/noSQL in realtime using the specified dialect for the database backend, so that you do not have to write SQL code or learn different SQL dialects (the term SQL is used generically), and your code will be portable among different types of databases. |
---|
6 | |
---|
7 | pyDAL comes from the original web2py's DAL, with the aim of being compatible with any Python program. pyDAL doesn't require web2py and can be used in any Python context. |
---|
8 | |
---|
9 | [](https://pypi.python.org/pypi/pydal) |
---|
10 | [](https://travis-ci.org/web2py/pydal) |
---|
11 | [](https://ci.appveyor.com/project/web2py/pydal) |
---|
12 | [](https://codecov.io/github/web2py/pydal) |
---|
13 | [](http://pydal.rtfd.org/) |
---|
14 | |
---|
15 | ## Installation |
---|
16 | |
---|
17 | You can install pyDAL using `pip`: |
---|
18 | |
---|
19 | pip install pyDAL |
---|
20 | |
---|
21 | ## Usage and Documentation |
---|
22 | |
---|
23 | Here is a quick example: |
---|
24 | |
---|
25 | >>> from pydal import DAL, Field |
---|
26 | >>> db = DAL('sqlite://storage.db') |
---|
27 | >>> db.define_table('thing', Field('name')) |
---|
28 | >>> db.thing.insert(name='Chair') |
---|
29 | >>> query = db.thing.name.startswith('C') |
---|
30 | >>> rows = db(query).select() |
---|
31 | >>> print rows[0].name |
---|
32 | Chair |
---|
33 | >>> db.commit() |
---|
34 | |
---|
35 | The complete documentation is available on http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer |
---|
36 | |
---|
37 | ## What's in the box? |
---|
38 | |
---|
39 | A little *taste* of pyDAL features: |
---|
40 | |
---|
41 | * Transactions |
---|
42 | * Aggregates |
---|
43 | * Inner Joins |
---|
44 | * Outer Joins |
---|
45 | * Nested Selects |
---|
46 | |
---|
47 | ## Which databases are supported? |
---|
48 | |
---|
49 | pyDAL supports the following databases: |
---|
50 | |
---|
51 | * SQLite |
---|
52 | * MySQL |
---|
53 | * PostgreSQL |
---|
54 | * MSSQL |
---|
55 | * FireBird |
---|
56 | * Oracle |
---|
57 | * DB2 |
---|
58 | * Ingres |
---|
59 | * Sybase |
---|
60 | * Informix |
---|
61 | * Teradata |
---|
62 | * Cubrid |
---|
63 | * SAPDB |
---|
64 | * IMAP |
---|
65 | * MongoDB |
---|
66 | |
---|
67 | ## License |
---|
68 | |
---|
69 | pyDAL is released under the BSD-3c License. For further details, please check the `LICENSE` file. |
---|