.oO SearXNG Developer Documentation Oo.
|
Public Member Functions | |
__init__ (self, str db_url) | |
init (self) | |
__call__ (self, name, default=None) | |
set (self, name, value) | |
row (self, name, default=None) | |
int | m_time (self, name, int default=0) |
create_schema (self, conn) | |
Public Member Functions inherited from searx.sqlitedb.SQLiteAppl | |
sqlite3.Connection | connect (self) |
register_functions (self, conn) | |
sqlite3.Connection | DB (self) |
Public Attributes | |
db_url = db_url | |
thread_local = threading.local() | |
Public Attributes inherited from searx.sqlitedb.SQLiteAppl | |
db_url = db_url | |
properties = SQLiteProperties(db_url) | |
thread_local = threading.local() | |
Static Public Attributes | |
str | SQLITE_JOURNAL_MODE = "WAL" |
str | DDL_PROPERTIES |
str | SQL_GET = "SELECT value FROM properties WHERE name = ?" |
str | SQL_M_TIME = "SELECT m_time FROM properties WHERE name = ?" |
tuple | SQL_SET |
tuple | SQL_TABLE_EXISTS |
SQLITE_CONNECT_ARGS = dict(SQLiteAppl.SQLITE_CONNECT_ARGS) | |
Static Public Attributes inherited from searx.sqlitedb.SQLiteAppl | |
dict | DDL_CREATE_TABLES = {} |
int | DB_SCHEMA = 1 |
dict | SQLITE_THREADING_MODE |
str | SQLITE_JOURNAL_MODE = "WAL" |
dict | SQLITE_CONNECT_ARGS |
Protected Attributes | |
bool | _init_done = False |
Protected Attributes inherited from searx.sqlitedb.SQLiteAppl | |
bool | _init_done = False |
_DB = None | |
Additional Inherited Members | |
Protected Member Functions inherited from searx.sqlitedb.SQLiteAppl | |
_compatibility (self) | |
Simple class to manage properties of a DB application in the DB. The object has its own DB connection and transaction area. .. code:: sql CREATE TABLE IF NOT EXISTS properties ( name TEXT, value TEXT, m_time INTEGER DEFAULT (strftime('%s', 'now')), PRIMARY KEY (name))
Definition at line 224 of file sqlitedb.py.
searx.sqlitedb.SQLiteProperties.__init__ | ( | self, | |
str | db_url ) |
Reimplemented from searx.sqlitedb.SQLiteAppl.
Definition at line 263 of file sqlitedb.py.
searx.sqlitedb.SQLiteProperties.__call__ | ( | self, | |
name, | |||
default = None ) |
Returns the value of the property ``name`` or ``default`` if property not exists in DB.
Definition at line 282 of file sqlitedb.py.
References searx.sqlitedb.SQLiteAppl.DB(), and searx.sqlitedb.SQLiteProperties.SQL_GET.
searx.sqlitedb.SQLiteProperties.create_schema | ( | self, | |
conn ) |
Reimplemented from searx.sqlitedb.SQLiteAppl.
Definition at line 321 of file sqlitedb.py.
References searx.sqlitedb.SQLiteProperties.DDL_PROPERTIES.
Referenced by searx.sqlitedb.SQLiteAppl.init(), and searx.sqlitedb.SQLiteProperties.init().
searx.sqlitedb.SQLiteProperties.init | ( | self | ) |
Initializes DB schema of the properties in the DB.
Reimplemented from searx.sqlitedb.SQLiteAppl.
Definition at line 270 of file sqlitedb.py.
References searx.sqlitedb.SQLiteAppl._init_done, searx.sqlitedb.SQLiteProperties._init_done, searx.sqlitedb.SQLiteAppl.create_schema(), searx.sqlitedb.SQLiteProperties.create_schema(), searx.sqlitedb.SQLiteAppl.DB(), searx.favicons.cache.FaviconCacheConfig.db_url, searx.sqlitedb.SQLiteAppl.db_url, searx.sqlitedb.SQLiteProperties.db_url, and searx.sqlitedb.SQLiteProperties.SQL_TABLE_EXISTS.
Referenced by searx.sqlitedb.SQLiteAppl.connect().
int searx.sqlitedb.SQLiteProperties.m_time | ( | self, | |
name, | |||
int | default = 0 ) |
Last modification time of this property.
Definition at line 314 of file sqlitedb.py.
References searx.sqlitedb.SQLiteAppl.DB(), and searx.sqlitedb.SQLiteProperties.SQL_M_TIME.
searx.sqlitedb.SQLiteProperties.row | ( | self, | |
name, | |||
default = None ) |
Returns the DB row of property ``name`` or ``default`` if property not exists in DB.
Definition at line 302 of file sqlitedb.py.
References searx.sqlitedb.SQLiteAppl.DB().
searx.sqlitedb.SQLiteProperties.set | ( | self, | |
name, | |||
value ) |
Set ``value`` of property ``name`` in DB. If property already exists, update the ``m_time`` (and the value).
Definition at line 291 of file sqlitedb.py.
References searx.sqlitedb.SQLiteAppl.DB(), and searx.sqlitedb.SQLiteProperties.SQL_SET.
|
protected |
Definition at line 267 of file sqlitedb.py.
Referenced by searx.sqlitedb.SQLiteAppl.init(), and searx.sqlitedb.SQLiteProperties.init().
searx.sqlitedb.SQLiteProperties.db_url = db_url |
Definition at line 265 of file sqlitedb.py.
Referenced by searx.sqlitedb.SQLiteAppl.connect(), searx.sqlitedb.SQLiteAppl.init(), and searx.sqlitedb.SQLiteProperties.init().
|
static |
Definition at line 240 of file sqlitedb.py.
Referenced by searx.sqlitedb.SQLiteProperties.create_schema().
|
static |
Definition at line 249 of file sqlitedb.py.
Referenced by searx.sqlitedb.SQLiteProperties.__call__().
|
static |
Definition at line 250 of file sqlitedb.py.
Referenced by searx.sqlitedb.SQLiteProperties.m_time().
|
static |
Definition at line 251 of file sqlitedb.py.
Referenced by searx.sqlitedb.SQLiteProperties.set().
|
static |
Definition at line 256 of file sqlitedb.py.
Referenced by searx.sqlitedb.SQLiteProperties.init().
|
static |
Definition at line 260 of file sqlitedb.py.
Referenced by searx.sqlitedb.SQLiteAppl.connect().
|
static |
Definition at line 238 of file sqlitedb.py.
searx.sqlitedb.SQLiteProperties.thread_local = threading.local() |
Definition at line 266 of file sqlitedb.py.
Referenced by searx.sqlitedb.SQLiteAppl.DB().