Trees | Indices | Help |
|
---|
|
I am the reference implementation for advene backends modules.
A backend module can be registered by invoking `advene.model.backends.register` with the module as its sole argument. It must implement 4 functions: `claims_for_create` , `claims_for_bind` , create_ and bind_ . The two latters return a *backend instance* with a standard API, for which `_SqliteBackend` provides a reference implementation.
|
|||
_SqliteBackend I am the reference implementation of advene backend instances. |
|||
_FlushableIterator Cursor based iterator that may flush the cursor whenever needed. |
|||
_Query I provide useful functionalities for building SQL queries to the backend schema. |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
BACKEND_VERSION =
|
|||
IN_MEMORY_URL =
|
|||
_DF = False
|
|||
_cache = <WeakValueDictionary at 148727692>
|
|||
_DEFAULT_PKGID =
|
|
Return the state of the module's debug flag. The debug flag enables a bunch of ``assert`` statements. See also `_set_module_debug`. NB: The benefit of disabling debug is not highly significant with sqlite, but this would be different with a distant DBMS (because asserts often invoke backend methods, resulting on extra queries to the database). Since it is expected that a backend implementation over such a DBMS will be done by copying and adapting this module, it seems like a good idea to have it. |
Set the module's debug flaf. See _get_module_debug`. |
Is this backend able to create a package to the given URL ? Checks whether the URL is recognized, and whether the requested package does not already exist at that URL. When the result of that method is False, it must be a `ClaimFailure` rather than a `bool`. If it has no exception, then the URL is not recognized at all. If it has an exception, then the URL is recognized, but attempting to create the package will raise that exception. |
Creates a new package and return backend instance and package id. Parameters ---------- package an object with attribute ``url``, which will be used as the backend URL unless parameter `url` is also provided. force should the package be created (i.e. re-initialized) even if it exists? url URL to be used if ``package.url`` is not adapted to this backend (useful for parsed-into-backend packages) |
Is this backend able to bind to the given URL ? Checks whether the URL is recognized, and whether the requested package does already exist in the database. When the result of that method is False, it must be a `ClaimFailure` rather than a `bool`. If it has no exception, then the URL is not recognized at all. If it has an exception, then the URL is recognized, but attempting to create the package will raise that exception. |
Bind to an existing package at the given URL. Return the backend an the package id. Parameters ---------- package an object with attributes ``readonly`` and ``url``, which will be used as the backend URL unless parameter `url` is also provided. force should the package be opened even if it is being used? url URL to be used if ``package.url`` is not adapted to this backend (useful for parsed-into-backend packages) |
Strip URL from its scheme ("sqlite:") and separate path and fragment. Also convert path from url to OS-specific pathname expression. |
Split an id_ref into a prefix and a suffix. Return None prefix if id_ref is a plain id. Raise an AssertionError if id_ref has length > 2. |
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Jul 8 16:00:00 2009 | http://epydoc.sourceforge.net |