added documentation
This commit is contained in:
parent
7c5779da80
commit
b76f11c94c
@ -1,10 +1,20 @@
|
|||||||
# shut up useless SA warning:
|
# shut up useless SA warning:
|
||||||
import warnings
|
import warnings
|
||||||
warnings.filterwarnings('ignore', 'Unicode type received non-unicode bind param value.')
|
warnings.filterwarnings(
|
||||||
|
'ignore', 'Unicode type received non-unicode bind param value.')
|
||||||
|
|
||||||
from dataset.persistence.database import Database
|
from dataset.persistence.database import Database
|
||||||
from dataset.persistence.table import Table
|
from dataset.persistence.table import Table
|
||||||
|
|
||||||
def connect(url):
|
|
||||||
return Database(url)
|
|
||||||
|
|
||||||
|
def connect(url):
|
||||||
|
""" Opens a new connection to a database. *url* can be any valid `SQLAlchemy engine URL`_. Returns
|
||||||
|
an instance of :py:class:`dataset.Database.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
db = dataset.connect('sqlite:///factbook.db')
|
||||||
|
|
||||||
|
.. _SQLAlchemy Engine URL: http://docs.sqlalchemy.org/en/latest/core/engines.html#sqlalchemy.create_engine
|
||||||
|
"""
|
||||||
|
return Database(url)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user