This method is intended to be used by backends only.

    It lets them register their services, identified by the URI scheme,
    at import time. The associated method create_method must take one
    parameter: the complete requested RFC 3986 compliant URI.

    The associated module must be compliant with DBAPI v2.0 but will not
    be directly used for other purposes than compatibility testing.

    c14n_uri_method must be a function that takes one string argument (the
    same form that the one that would be passed to connect_by_uri) and
    returns its canonicalized form in an implementation dependant way. This
    includes transforming any local pathname into an absolute form.
    c14n_uri_method can also be None, in which case the behavior will be
    the same as the one of the identity function.

    escape must be a function that takes one string argument (an unescaped
    column name) and returns an escaped version for use as an escaped
    column name in an SQL query for this backend.

    If something obviously not compatible is tried to be registred,
    NotImplementedError is raised.

def register_uri_backend(uri_scheme, create_method, module, c14n_uri_method, escape, cast, is_connected):
    """
    This method is intended to be used by backends only.

    It lets them register their services, identified by the URI scheme,
    at import time. The associated method create_method must take one
    parameter: the complete requested RFC 3986 compliant URI.

    The associated module must be compliant with DBAPI v2.0 but will not
    be directly used for other purposes than compatibility testing.

    c14n_uri_method must be a function that takes one string argument (the
    same form that the one that would be passed to connect_by_uri) and
    returns its canonicalized form in an implementation dependant way. This
    includes transforming any local pathname into an absolute form.
    c14n_uri_method can also be None, in which case the behavior will be
    the same as the one of the identity function.

    escape must be a function that takes one string argument (an unescaped
    column name) and returns an escaped version for use as an escaped
    column name in an SQL query for this backend.

    If something obviously not compatible is tried to be registred,
    NotImplementedError is raised.
    """
    try:
        delta_api =  __compare_api_level(module.apilevel, any_apilevel)
        mod_paramstyle = module.paramstyle
        mod_threadsafety = module.threadsafety
    except NameError:
        raise NotImplementedError("This module does not support registration "
                                  "of non DBAPI services of at least apilevel 2.0")
    if delta_api < 0 or delta_api > 1:
        raise NotImplementedError("This module does not support registration "
                                  "of DBAPI services with a specified apilevel of %s" % module.apilevel)
    if mod_paramstyle not in ['pyformat', 'format', 'qmark']:
        raise NotImplementedError("This module only supports registration "
                                  "of DBAPI services with a 'format' or 'pyformat' 'qmark' paramstyle, not %r" % mod_paramstyle)
    if mod_threadsafety < any_threadsafety:
        raise NotImplementedError("This module does not support registration "
                                  "of DBAPI services of threadsafety %d (more generally under %d)"
                                  % (mod_threadsafety, any_threadsafety))
    if not urisup.valid_scheme(uri_scheme):
        raise urisup.InvalidSchemeError("Can't register an invalid URI scheme %r" % uri_scheme)
    __uri_create_methods[uri_scheme] = (create_method, module, c14n_uri_method, escape, cast, is_connected)