sqlalchemy.rst 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. .. _broker-sqlalchemy:
  2. ==================
  3. Using SQLAlchemy
  4. ==================
  5. .. admonition:: Experimental Status
  6. The SQLAlchemy transport is unstable in many areas and there are
  7. several issues open. Unfortunately we don't have the resources or funds
  8. required to improve the situation, so we're looking for contributors
  9. and partners willing to help.
  10. .. _broker-sqlalchemy-installation:
  11. Installation
  12. ============
  13. .. _broker-sqlalchemy-configuration:
  14. Configuration
  15. =============
  16. Celery needs to know the location of your database, which should be the usual
  17. SQLAlchemy connection string, but with 'sqla+' prepended to it::
  18. BROKER_URL = 'sqla+sqlite:///celerydb.sqlite'
  19. This transport uses only the :setting:`BROKER_URL` setting, which have to be
  20. an SQLAlchemy database URI.
  21. Please see `SQLAlchemy: Supported Databases`_ for a table of supported databases.
  22. Here's a list of examples using a selection of other `SQLAlchemy Connection String`_'s:
  23. .. code-block:: python
  24. # sqlite (filename)
  25. BROKER_URL = 'sqla+sqlite:///celerydb.sqlite'
  26. # mysql
  27. BROKER_URL = 'sqla+mysql://scott:tiger@localhost/foo'
  28. # postgresql
  29. BROKER_URL = 'sqla+postgresql://scott:tiger@localhost/mydatabase'
  30. # oracle
  31. BROKER_URL = 'sqla+oracle://scott:tiger@127.0.0.1:1521/sidname'
  32. .. _`SQLAlchemy: Supported Databases`:
  33. http://www.sqlalchemy.org/docs/core/engines.html#supported-databases
  34. .. _`SQLAlchemy Connection String`:
  35. http://www.sqlalchemy.org/docs/core/engines.html#database-urls
  36. .. _sqlalchemy-results-configuration:
  37. Results
  38. -------
  39. To store results in the database as well, you should configure the result
  40. backend. See :ref:`conf-database-result-backend`.
  41. .. _broker-sqlalchemy-limitations:
  42. Limitations
  43. ===========
  44. The SQLAlchemy database transport does not currently support:
  45. * Remote control commands (:program:`celery events` command, broadcast)
  46. * Events, including the Django Admin monitor.
  47. * Using more than a few workers (can lead to messages being executed
  48. multiple times).