Skip to content

Commit

Permalink
Merge pull request #8825 from obozdag/patch-2
Browse files Browse the repository at this point in the history
docs: Some typos in database/configuration.rst
  • Loading branch information
kenjis authored Apr 30, 2024
2 parents d47eccf + c12915e commit 7dfd334
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
28 changes: 14 additions & 14 deletions user_guide_src/source/database/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ prototype:
The name of the class property is the connection name, and can be used
while connecting to specify a group name.

.. note:: The default location of the SQLite3 database is in the **writable** folder.
If you want to change the location, you must set the full path to the new folder.
.. note:: The default location of the SQLite3 database is the **writable** folder.
If you want to change the location, you must set the full path to the new folder (e.g., 'database' => WRITEPATH . 'db/database_name.db').

DSN
---

Some database drivers (such as Postgre, OCI8) requires a full DSN string to connect.
Some database drivers (such as Postgre, OCI8) requires a full DSN (Data Source Name) string to connect.
But if you do not specify a DSN string for a driver that requires it, CodeIgniter
will try to build it with the rest of the provided settings.

Expand All @@ -48,7 +48,7 @@ you're using the driver's underlying native PHP extension, like this:
DSN in Universal Manner
^^^^^^^^^^^^^^^^^^^^^^^

You can also set a Data Source Name in universal manner (URL like). In that case DSNs must have this prototype:
You can also set a DSN in universal manner (URL like). In that case DSNs must have this prototype:

.. literalinclude:: configuration/003.php
:lines: 11-14
Expand Down Expand Up @@ -113,7 +113,7 @@ Configuring with .env File

You can also save your configuration values within a **.env** file with the current server's
database settings. You only need to enter the values that change from what is in the
default group's configuration settings. The values should be name following this format, where
default group's configuration settings. The values should follow this format, where
``default`` is the group name::

database.default.username = 'root';
Expand All @@ -137,11 +137,11 @@ and decode it in the constructor in the Config class:
.. _database-config-explanation-of-values:

*********************
Explanation of Values
Description of Values
*********************

================ ===========================================================================================================
Name Config Description
Config Name Description
================ ===========================================================================================================
**DSN** The DSN connect string (an all-in-one configuration sequence).
**hostname** The hostname of your database server. Often this is 'localhost'.
Expand All @@ -154,31 +154,31 @@ Explanation of Values
**DBDriver** The database driver name. The case must match the driver name.
You can set a fully qualified classname to use your custom driver.
Supported drivers: ``MySQLi``, ``Postgre``, ``SQLite3``, ``SQLSRV``, and ``OCI8``.
**DBPrefix** An optional table prefix which will added to the table name when running
**DBPrefix** An optional table prefix which will be added to the table name when running
:doc:`Query Builder <query_builder>` queries. This permits multiple CodeIgniter
installations to share one database.
**pConnect** true/false (boolean) - Whether to use a persistent connection.
**DBDebug** true/false (boolean) - Whether to throw exceptions or not when database errors occur.
**DBDebug** true/false (boolean) - Whether to throw exceptions when database errors occur.
**charset** The character set used in communicating with the database.
**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** (``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.
**encrypt** (``MySQLi`` and ``SQLSRV`` only) Whether 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.
**compress** (``MySQLi`` only) Whether 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** (``SQLite3`` only) true/false (boolean) - Whether or not to enable Foreign Key constraint.
**foreignKeys** (``SQLite3`` only) true/false (boolean) - Whether 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** (``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.
**numberNative** (``MySQLi`` only) true/false (boolean) - Whether to enable MYSQLI_OPT_INT_AND_FLOAT_NATIVE.
**dateFormat** The default date/time formats as PHP's `DateTime format`_.
* ``date`` - date format
* ``datetime`` - date and time format
Expand Down Expand Up @@ -225,4 +225,4 @@ MySQLi driver accepts an array with the following options:
* ``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
* ``ssl_verify`` - true/false (boolean) - Whether to verify the server certificate or not
2 changes: 0 additions & 2 deletions user_guide_src/source/database/helpers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ $db->countAll()

Permits you to determine the number of rows in a particular table.
Submit the table name in the first parameter. This is part of Query Builder.
Example:

.. literalinclude:: helpers/001.php

Expand All @@ -51,7 +50,6 @@ $db->countAllResults()

Permits you to determine the number of rows in a particular result set.
Submit the table name in the first parameter. This is part of Query Builder.
Example:

.. literalinclude:: helpers/002.php

Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/database/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ patterns. The database functions offer clear, simple syntax.
Connecting to a Database <connecting>
Running Queries <queries>
Generating Query Results <results>
Query Helper Functions <helpers>
Query Helper Methods <helpers>
Query Builder Class <query_builder>
Transactions <transactions>
Getting MetaData <metadata>
Expand Down
16 changes: 8 additions & 8 deletions user_guide_src/source/database/query_builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ $query, which can be used to show the results:

.. literalinclude:: query_builder/004.php

Please visit the :doc:`getResult*() method <results>` page for a full
Please visit the :ref:`getResult() <getresult>` method for a full
discussion regarding result generation.

$builder->getCompiledSelect()
Expand All @@ -101,14 +101,14 @@ Example:

.. literalinclude:: query_builder/005.php

The first parameter enables you to set whether or not the query builder query
will be reset (by default it will be reset, just like when using ``$builder->get()``):
The parameter (false) in the first query below enables you to set whether or not the query builder
will be reset (because the default value of the parameter is true, ``getCompiledSelect(bool $reset = true)``, by default it will be reset just like when using ``$builder->get()``):

.. literalinclude:: query_builder/006.php

The key thing to notice in the above example is that the second query did not
utilize ``limit(10, 20)`` but the generated SQL query has ``LIMIT 20, 10``.
The reason for this outcome is because the first parameter is set to ``false``.
The reason for this outcome is because the parameter in the first query is set to ``false``, ``limit(10, 20)`` remained in the second query.

$builder->getWhere()
--------------------
Expand Down Expand Up @@ -169,7 +169,7 @@ $builder->selectMin()
---------------------

Writes a **SELECT MIN(field)** portion for your query. As with
``selectMax()``, You can optionally include a second parameter to rename
``selectMax()``, you can optionally include a second parameter to rename
the resulting field.

.. literalinclude:: query_builder/011.php
Expand All @@ -178,7 +178,7 @@ $builder->selectAvg()
---------------------

Writes a **SELECT AVG(field)** portion for your query. As with
``selectMax()``, You can optionally include a second parameter to rename
``selectMax()``, you can optionally include a second parameter to rename
the resulting field.

.. literalinclude:: query_builder/012.php
Expand All @@ -187,7 +187,7 @@ $builder->selectSum()
---------------------

Writes a **SELECT SUM(field)** portion for your query. As with
``selectMax()``, You can optionally include a second parameter to rename
``selectMax()``, you can optionally include a second parameter to rename
the resulting field.

.. literalinclude:: query_builder/013.php
Expand All @@ -196,7 +196,7 @@ $builder->selectCount()
-----------------------

Writes a **SELECT COUNT(field)** portion for your query. As with
``selectMax()``, You can optionally include a second parameter to rename
``selectMax()``, you can optionally include a second parameter to rename
the resulting field.

.. note:: This method is particularly helpful when used with ``groupBy()``. For
Expand Down
4 changes: 3 additions & 1 deletion user_guide_src/source/database/results.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ There are several ways to generate query results:
Result Arrays
*************

.. _getresult:

getResult()
===========

Expand Down Expand Up @@ -93,7 +95,7 @@ digit in the first parameter:

.. literalinclude:: results/009.php

In addition, you can walk forward/backwards/first/last through your
In addition, you can walk forward/backward/first/last through your
results using these variations:

| ``$row = $query->getFirstRow()``
Expand Down

0 comments on commit 7dfd334

Please sign in to comment.