1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 """Wrappers to get actually replaceable DBAPI2 compliant modules and
19 database connection whatever the database and client lib used.
20
21 Currently support:
22
23 - postgresql (pgdb, psycopg, psycopg2, pyPgSQL)
24 - mysql (MySQLdb)
25 - sqlite (pysqlite2, sqlite, sqlite3)
26
27 just use the `get_connection` function from this module to get a
28 wrapped connection. If multiple drivers for a database are available,
29 you can control which one you want to use using the
30 `set_prefered_driver` function.
31
32 Additional helpers are also provided for advanced functionalities such
33 as listing existing users or databases, creating database... Get the
34 helper for your database using the `get_adv_func_helper` function.
35 """
36 __docformat__ = "restructuredtext en"
37
38 from warnings import warn
39 warn('this module is deprecated, use logilab.database instead',
40 DeprecationWarning, stacklevel=1)
41
42 from logilab.database import (get_connection, set_prefered_driver,
43 get_dbapi_compliant_module as _gdcm,
44 get_db_helper as _gdh)
45
47 module = _gdcm(driver, *args, **kwargs)
48 module.adv_func_helper = _gdh(driver)
49 return module
50