Skip to content

Commit

Permalink
docs: fix description
Browse files Browse the repository at this point in the history
All the current DB drivers throw an exception when a query error occurs.
See codeigniter4#6912

MySQLi driver sets `mysqli_report(MYSQLI_REPORT_ALL & ~MYSQLI_REPORT_INDEX)`
that throws mysqli_sql_exception.

SQLite3, Postgres and OCI8 drivers throw ErrorException because of Error Handler.

SQLSRV driver has different implementaion. It throws DatabaseException when the
query return value is false.
  • Loading branch information
kenjis committed Nov 27, 2022
1 parent bd76d9a commit e5e7c08
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions user_guide_src/source/database/transactions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ or failure of any given query.
.. note:: Since v4.3.0, ``DBDebug`` is true by default in all environments.
When ``DBDebug`` is true, if a query error occurs, all the queries
will be rolled backed, and an exception will be thrown.
In previous versions, ``DBDebug`` was false in production environment,
and different database drivers might throw different exception classes
or did not throw exceptions.
In previous versions, ``DBDebug`` was false only in production environment,
and different database drivers might throw different exception classes.

Strict Mode
===========
Expand All @@ -68,9 +67,8 @@ Strict Mode can be disabled as follows:
.. note:: Since v4.3.0, ``DBDebug`` is true by default in all environments.
When ``DBDebug`` is true, if a query error occurs, all the queries
will be rolled backed, and an exception will be thrown.
In previous versions, ``DBDebug`` was false in production environment,
and different database drivers might throw different exception classes
or did not throw exceptions.
In previous versions, ``DBDebug`` was false only in production environment,
and different database drivers might throw different exception classes.

.. _transactions-managing-errors:

Expand All @@ -86,9 +84,8 @@ you'll see an exception thrown if the commit was unsuccessful. If
.. note:: Since v4.3.0, ``DBDebug`` is true by default in all environments.
When ``DBDebug`` is true, if a query error occurs, all the queries
will be rolled backed, and an exception will be thrown.
In previous versions, ``DBDebug`` was false in production environment,
and different database drivers might throw different exception classes
or did not throw exceptions.
In previous versions, ``DBDebug`` was false only in production environment,
and different database drivers might throw different exception classes.

Disabling Transactions
======================
Expand Down

0 comments on commit e5e7c08

Please sign in to comment.