sqlalchemy.rst 1.7 KB

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