Database
Provides a standardized interface to connect to database servers like MySQL and MariaDB.
See the Database guide to learn how to work with the Database module.
Configuration
providersA hash array of the available database providers, where the key is the name of the database provider, and the value is a hash array with the following possible keys:providerClassNameThe name of the cache provider class, from the available ones:DatabaseProviderMysqlTo connect to MySQL or MariaDB database servers.
configA hash array of configuration options for the database provider, where each different cache provider has different available config keys:For
DatabaseProviderMysql:hostThe host name or IP of the server.userThe user namepasswordThe passworddatabaseThe name of the databasecharsetThe character set to use. One of the available here: https://dev.mysql.com/doc/refman/8.0/en/charset-charsets.html.cacheKeyPrefixThe cache prefix to use when caching data from the database. Default:DatabasecacheDefaultTtlThe default TTL to use when caching data from the database. Default:CACHE_TTL_NORMALcacheProviderNameThe default cache provider name to use when caching data from the database. Default:engine
Constants
DATABASE_FIELD_TYPE_INTEGERDATABASE_FIELD_TYPE_TINYINTDATABASE_FIELD_TYPE_FLOATDATABASE_FIELD_TYPE_DATEDATABASE_FIELD_TYPE_DATETIMEDATABASE_FIELD_TYPE_TIMESTAMPDATABASE_FIELD_TYPE_TIMEDATABASE_FIELD_TYPE_YEARDATABASE_FIELD_TYPE_STRINGDATABASE_FIELD_TYPE_TEXTDATABASE_FIELD_TYPE_BLOBDATABASE_FIELD_TYPE_BOOLEANDATABASE_FIELD_TYPE_IPDATABASE_FIELD_TYPE_SERIALIZEDDATABASE_FIELD_TYPE_COLOR
DATABASE_FIELD_DEFAULT_VALUEDATABASE_FIELD_DEFAULT_VALUE_DATEDATABASE_FIELD_DEFAULT_VALUE_DATETIMEDATABASE_FIELD_DEFAULT_VALUE_TIMESTAMPDATABASE_FIELD_DEFAULT_VALUE_TIMEDATABASE_FIELD_DEFAULT_VALUE_YEARDATABASE_FIELD_DEFAULT_VALUE_IPDATABASE_FIELD_DEFAULT_VALUE_AVAILABLE_URL_SHORT_CODE
Last updated
Was this helpful?