Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve Database Configuration #8634

Merged
merged 3 commits into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 29 additions & 21 deletions user_guide_src/source/database/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ and decode it in the constructor in the Config class:

.. _database-config-explanation-of-values:

**********************
Explanation of Values:
**********************
*********************
Explanation of Values
*********************

================ ===========================================================================================================
Name Config Description
Expand All @@ -159,31 +159,25 @@ Explanation of Values:
**pConnect** true/false (boolean) - Whether to use a persistent connection.
**DBDebug** true/false (boolean) - Whether to throw exceptions or not when database errors occur.
**charset** The character set used in communicating with the database.
**DBCollat** The character collation used in communicating with the database (``MySQLi`` only).
**DBCollat** (``MySQLi`` only) The character collation used in communicating with the database.
**swapPre** A default table prefix that should be swapped with ``DBPrefix``. This is useful for distributed
applications where you might run manually written queries, and need the prefix to still be
customizable by the end user.
**schema** The database schema, default value varies by driver. (Used by ``Postgre`` and ``SQLSRV``.)
**encrypt** Whether or not to use an encrypted connection.
``SQLSRV`` driver accepts true/false
``MySQLi`` driver accepts an array with the following options:
* ``ssl_key`` - Path to the private key file
* ``ssl_cert`` - Path to the public key certificate file
* ``ssl_ca`` - Path to the certificate authority file
* ``ssl_capath`` - Path to a directory containing trusted CA certificates in PEM format
* ``ssl_cipher`` - List of *allowed* ciphers to be used for the encryption, separated by colons (``:``)
* ``ssl_verify`` - true/false; Whether to verify the server certificate or not (``MySQLi`` only)
**compress** Whether or not to use client compression (``MySQLi`` only).
**strictOn** true/false (boolean) - Whether to force "Strict Mode" connections, good for ensuring strict SQL
while developing an application (``MySQLi`` only).
**schema** (``Postgre`` and ``SQLSRV`` only) The database schema, default value varies by driver.
**encrypt** (``MySQLi`` and ``SQLSRV`` only) Whether or not to use an encrypted connection.
See :ref:`MySQLi encrypt <mysqli-encrypt>` for ``MySQLi`` settings.
``SQLSRV`` driver accepts true/false.
**compress** (``MySQLi`` only) Whether or not to use client compression.
**strictOn** (``MySQLi`` only) true/false (boolean) - Whether to force "Strict Mode" connections, good for ensuring
strict SQL while developing an application.
**port** The database port number - Empty string ``''`` for default port (or dynamic port with ``SQLSRV``).
**foreignKeys** true/false (boolean) - Whether or not to enable Foreign Key constraint (``SQLite3`` only).
**foreignKeys** (``SQLite3`` only) true/false (boolean) - Whether or not to enable Foreign Key constraint.

.. important:: SQLite3 Foreign Key constraint is disabled by default.
See `SQLite documentation <https://www.sqlite.org/pragma.html#pragma_foreign_keys>`_.
To enforce Foreign Key constraint, set this config item to true.
**busyTimeout** milliseconds (int) - Sleeps for a specified amount of time when a table is locked (``SQLite3`` only).
**numberNative** true/false (boolean) - Whether or not to enable MYSQLI_OPT_INT_AND_FLOAT_NATIVE (``MySQLi`` only).
**busyTimeout** (``SQLite3`` only) milliseconds (int) - Sleeps for a specified amount of time when a table is locked.
**numberNative** (``MySQLi`` only) true/false (boolean) - Whether or not to enable MYSQLI_OPT_INT_AND_FLOAT_NATIVE.
================ ===========================================================================================================

.. note:: Depending on what database driver you are using (``MySQLi``, ``Postgre``,
Expand All @@ -205,4 +199,18 @@ the ``'hostname'`` setting. CodeIgniter's MySQLi driver will notice this and con
connection properly.

.. literalinclude:: configuration/011.php
:lines: 11-18
:lines: 11-18

.. _mysqli-encrypt:

encrypt
-------

MySQLi driver accepts an array with the following options:

* ``ssl_key`` - Path to the private key file
* ``ssl_cert`` - Path to the public key certificate file
* ``ssl_ca`` - Path to the certificate authority file
* ``ssl_capath`` - Path to a directory containing trusted CA certificates in PEM format
* ``ssl_cipher`` - List of *allowed* ciphers to be used for the encryption, separated by colons (``:``)
* ``ssl_verify`` - true/false; Whether to verify the server certificate or not