sqlitex v1.2.0 Sqlitex.Server.StatementCache
Implements a least-recently used (LRU) cache for prepared SQLite statements.
Caches a fixed number of prepared statements and purges the statements which were least-recently used when that limit is exceeded.
Summary
Functions
Creates a new prepared statement cache
Given a statement cache and an SQL statement (string), returns a tuple containing the updated statement cache and a prepared SQL statement
Functions
Given a statement cache and an SQL statement (string), returns a tuple containing the updated statement cache and a prepared SQL statement.
If possible, reuses an existing prepared statement; if not, prepares the statement and adds it to the cache, possibly removing the least-recently used prepared statement if the designated cache size limit would be exceeded.
Will return {:error, reason}
if SQLite is unable to prepare the statement.