SilverStripe\SQLite\SQLite3Database
SQLite database controller class
Synopsis
class SQLite3Database
extends Database
{
- // constants
- const ENV_PATH = 'SS_SQLITE_DATABASE_PATH';
- const ENV_KEY = 'SS_SQLITE_DATABASE_KEY';
- // members
- private static string $database_extension = '.sqlite';
- protected SQLite3SchemaManager $schemaManager = NULL;
- protected $parameters;
- protected boolean $livesInMemory = false;
- protected bool $transactionNesting = 0;
- protected array $transactionSavepoints = ;
- public static array $default_pragma = ;
- // methods
- public static string database_extension()
- public static boolean is_valid_database_name()
- public void connect()
- public array getParameters()
- public bool getLivesInMemory()
- public string|null getPath()
- public void supportsCollations()
- public void supportsTimezoneOverride()
- public void setPragma()
- public string getPragma()
- public void getDatabaseServer()
- public void selectDatabase()
- public void now()
- public void random()
- public PaginatedList searchEngine()
- public void supportsTransactions()
- public bool supportsTransactionMode()
- public void supportsExtensions()
- public void transactionStart()
- public void transactionSavepoint()
- protected string getTransactionSavepointName()
- public void transactionRollback()
- public void transactionDepth()
- public void transactionEnd()
- protected bool transactionIsNested()
- protected void transactionDepthIncrease()
- protected void transactionDepthDecrease()
- protected void resetTransactionNesting()
- public void query()
- public void preparedQuery()
- protected void inspectQuery()
- public void clearTable()
- public void comparisonClause()
- public void formattedDatetimeClause()
- public void datetimeIntervalClause()
- public void datetimeDifferenceClause()
Hierarchy
Extends
- SilverStripe\ORM\Connect\Database
Uses
- SilverStripe\Core\Config\Configurable
Tasks
Line | Task |
---|---|
+ | Migrate to SS config |
302+ | There is a fulltext search for SQLite making use of virtual tables, the fts3 extension and the MATCH operator there are a few issues with fts: - shared cached lock doesn't allow to create virtual tables on versions prior to 3.6.17 - there must not be more than one MATCH operator per statement - the fts3 extension needs to be available for now we use the MySQL implementation with the MATCH()AGAINST() uglily replaced with LIKE |
Constants
Name | Value |
---|---|
ENV_PATH | 'SS_SQLITE_DATABASE_PATH' |
ENV_KEY | 'SS_SQLITE_DATABASE_KEY' |
Members
private
- $database_extension
—
string
Extension added to every database name
protected
- $livesInMemory
- $parameters
- $schemaManager
—
SilverStripe\SQLite\SQLite3SchemaManager
Database schema manager object - $transactionNesting — SilverStripe\SQLite\bool
- $transactionSavepoints — array
public
- $default_pragma
—
array
List of default pragma values
Methods
protected
- getTransactionSavepointName() — Fetch the name of the most recent savepoint
- inspectQuery() — Inspect a SQL query prior to execution
- resetTransactionNesting() — In error condition, set transactionNesting to zero
- transactionDepthDecrease() — Decrease the nested transaction level by one and reduce the savepoint tracking if we are nesting, as the last one is no longer valid
- transactionDepthIncrease() — Increase the nested transaction level by one savepoint tracking is optional because BEGIN opens a transaction, but is not a named reference
- transactionIsNested() — Indicate whether or not the current transaction is nested Returns false if there are no transactions, or the open transaction is the 'outer' transaction, i.e. not nested.
public
- clearTable()
- comparisonClause()
- connect() — Connect to a SQLite3 database.
- database_extension() — Extension used to distinguish between sqllite database files and other files.
- datetimeDifferenceClause()
- datetimeIntervalClause()
- formattedDatetimeClause()
- getDatabaseServer()
- getLivesInMemory() — Determine if this Db is in memory
- getParameters() — Retrieve parameters used to connect to this SQLLite database
- getPath() — Get file path. If in memory this is null
- getPragma() — Gets pragma value.
- is_valid_database_name() — Check if a database name has a valid extension
- now()
- preparedQuery()
- query()
- random()
- searchEngine() — The core search engine configuration.
- selectDatabase()
- setPragma() — Execute PRAGMA commands.
- supportsCollations()
- supportsExtensions()
- supportsTimezoneOverride()
- supportsTransactionMode() — Does this database support transaction modes?
- supportsTransactions()
- transactionDepth()
- transactionEnd()
- transactionRollback()
- transactionSavepoint()
- transactionStart()