Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-1046

support load of external erlang modules in couchdb.


    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Database Core
    • Labels:
    • Skill Level:
      Regular Contributors Level (Easy to Medium)


      If you want to add external modules in CouchDB and load them , you need to set the ERL_FLAGS environnement variable to the path of a module.

      The attached patch allows couchdb to load plugins from plugin key in couchdb section. It add needed path to the code path, so the vm can find modules.

      plugins = plugin1, plugin2

      Each plugin can have its own section where it set the binaries patch, eventually if a service need to be added to the supervision you can set the module and function to load like in daemon section and tel if it's a supervisor or simple service.

      It also allows couchdb to load a plugin service (gen_server or such) to the supervision. You can choose if the service is a simple daemon or a supervisor.

      code_path = /path/to/plugin1/ebin
      daemon =

      {module, function, [Args]}

      supervisor = false

      Let me know what you think about it. This patch is really useful here and allows me to dynamically load modules I want. Also it eases the integration of external module. For ex I can load my couchapp_ng modules with this lines in local.ini :

      plugins = couchapp-ng

      daemon =

      {couchapp_ng_routes, start_link, []}

      _app =

      {couchapp_ng_httpd, handle_app_req}

      rewrite =

      {couchapp_ng_handlers, rewrite_handler}

      proxy =

      {couchapp_ng_handlers, proxy_handler}

      and can do the same with geocouch etc. Tested here with these modules.


        1. couchdb-plugins-02.patch
          4 kB
          Benoit Chesneau
        2. couchdb-plugins-01.patch
          3 kB
          Benoit Chesneau
        3. couchdb-plugins-005.patch
          8 kB
          Benoit Chesneau
        4. couchdb-plugins-004.patch
          7 kB
          Benoit Chesneau
        5. couchdb-plugins-003.patch
          7 kB
          Benoit Chesneau



            • Assignee:
              benoitc Benoit Chesneau
            • Votes:
              1 Vote for this issue
              3 Start watching this issue


              • Created: