From 578fd7657f8cb465550a7d5aa607e39079fb7894 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Wed, 23 Dec 2015 14:41:36 +0100 Subject: [PATCH] DOC: add examples of database drivers (GH11686) --- doc/source/install.rst | 7 +++++++ doc/source/io.rst | 13 +++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/doc/source/install.rst b/doc/source/install.rst index b099186f208ae..0f2f7e6f83d78 100644 --- a/doc/source/install.rst +++ b/doc/source/install.rst @@ -247,6 +247,13 @@ Optional Dependencies * `SciPy `__: miscellaneous statistical functions * `PyTables `__: necessary for HDF5-based storage. Version 3.0.0 or higher required, Version 3.2.1 or higher highly recommended. * `SQLAlchemy `__: for SQL database support. Version 0.8.1 or higher recommended. + * Besides SQLAlchemy, you also need a database specific driver. + Examples of such drivers are `psycopg2 `__ for PostgreSQL + or `pymysql `__ for MySQL. For + `SQLite `__ this is + included in Python's standard library by default. + You can find an overview of supported drivers for each SQL dialect in the + `SQLAlchemy docs `__. * `matplotlib `__: for plotting * `statsmodels `__ * Needed for parts of :mod:`pandas.stats` diff --git a/doc/source/io.rst b/doc/source/io.rst index 807838edb6bc4..041daaeb3b12f 100644 --- a/doc/source/io.rst +++ b/doc/source/io.rst @@ -3741,8 +3741,13 @@ SQL Queries The :mod:`pandas.io.sql` module provides a collection of query wrappers to both facilitate data retrieval and to reduce dependency on DB-specific API. Database abstraction -is provided by SQLAlchemy if installed, in addition you will need a driver library for -your database. +is provided by SQLAlchemy if installed. In addition you will need a driver library for +your database. Examples of such drivers are `psycopg2 `__ +for PostgreSQL or `pymysql `__ for MySQL. +For `SQLite `__ this is +included in Python's standard library by default. +You can find an overview of supported drivers for each SQL dialect in the +`SQLAlchemy docs `__. .. versionadded:: 0.14.0 @@ -3780,7 +3785,7 @@ To connect with SQLAlchemy you use the :func:`create_engine` function to create object from database URI. You only need to create the engine once per database you are connecting to. For more information on :func:`create_engine` and the URI formatting, see the examples -below and the SQLAlchemy `documentation `__ +below and the SQLAlchemy `documentation `__ .. ipython:: python @@ -3994,7 +3999,7 @@ connecting to. # or absolute, starting with a slash: engine = create_engine('sqlite:////absolute/path/to/foo.db') -For more information see the examples the SQLAlchemy `documentation `__ +For more information see the examples the SQLAlchemy `documentation `__ Advanced SQLAlchemy queries