sqlalchemy.rst 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. .. _broker-sqlalchemy-limitations:
  41. Limitations
  42. ===========
  43. The SQLAlchemy database transport does not currently support:
  44. * Remote control commands (celeryev, broadcast)
  45. * Events, including the Django Admin monitor.
  46. * Using more than a few workers (can lead to messages being executed
  47. multiple times).