sqlalchemy.rst 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. .. _broker-sqlalchemy:
  2. ==================
  3. Using SQLAlchemy
  4. ==================
  5. .. _broker-sqlalchemy-installation:
  6. Installation
  7. ============
  8. For the SQLAlchemy transport you have to install the
  9. `kombu-sqlalchemy` library::
  10. $ pip install -U kombu-sqlalchemy
  11. .. _broker-sqlalchemy-configuration:
  12. Configuration
  13. =============
  14. This transport uses only the :setting:`BROKER_HOST` setting, which have to be
  15. an SQLAlchemy database URI.
  16. #. Set your broker transport::
  17. BROKER_TRANSPORT = "sqlalchemy"
  18. #. Configure the database URI::
  19. BROKER_HOST = "sqlite:///celerydb.sqlite"
  20. Please see `SQLAlchemy: Supported Databases`_ for a table of supported databases.
  21. Some other `SQLAlchemy Connection String`_, examples:
  22. .. code-block:: python
  23. # sqlite (filename)
  24. BROKER_HOST = "sqlite:///celerydb.sqlite"
  25. # mysql
  26. BROKER_HOST = "mysql://scott:tiger@localhost/foo"
  27. # postgresql
  28. BROKER_HOST = "postgresql://scott:tiger@localhost/mydatabase"
  29. # oracle
  30. BROKER_HOST = "oracle://scott:tiger@127.0.0.1:1521/sidname"
  31. .. _`SQLAlchemy: Supported Databases`:
  32. http://www.sqlalchemy.org/docs/core/engines.html#supported-databases
  33. .. _`SQLAlchemy Connection String`:
  34. http://www.sqlalchemy.org/docs/core/engines.html#database-urls
  35. .. _sqlalchemy-results-configuration:
  36. Results
  37. -------
  38. To store results in the database as well, you should configure the result
  39. backend. See :ref:`conf-database-result-backend`.
  40. If you don't intend to consume results you should disable them::
  41. CELERY_IGNORE_RESULT = True