nextcloud/lib/private/db
Andreas Fischer 63a2bea7ec Remove OC_DB_StatementWrapper::numRows().
Using this method will result in an unneccesary extra SQL query (which also may
return an incorrect result because the underlying table changed in the
meantime).

In general:

If you are performing an UPDATE, DELETE or equivalent query,
OC_DB_StatementWrapper::execute() will already give you the number of
"affected rows" via \Doctrine\DBAL\Driver\Statement::rowCount(). This will
not work for SELECT queries, however.

If you want to know whether a table contains any rows matching your condition,
use "SELECT id FROM ... WHERE ... LIMIT 1".

If you want to know whether a table contains any rows matching your condition
and you also need the data, use "SELECT ... FROM ... WHERE ...", then use
one of the fetch() methods.

If you want to count the number of rows matching your condition, use use
"SELECT COUNT(...) AS number_of_rows FROM ... WHERE ...", then use one of the
fetch() methods.
2013-12-21 19:36:14 +01:00
..
adapter.php move the private namespace OC into lib/private - OCP will stay in lib/public 2013-09-30 16:36:59 +02:00
adapteroci8.php move the private namespace OC into lib/private - OCP will stay in lib/public 2013-09-30 16:36:59 +02:00
adapterpgsql.php move the private namespace OC into lib/private - OCP will stay in lib/public 2013-09-30 16:36:59 +02:00
adaptersqlite.php move the private namespace OC into lib/private - OCP will stay in lib/public 2013-09-30 16:36:59 +02:00
adaptersqlsrv.php Inherit lastInsertId() from Adapter. 2013-11-04 22:28:41 +01:00
connection.php php 5.3 compatibility regarding OC\DB\Connection fixed 2013-10-21 22:51:56 +02:00
connectionwrapper.php add missing file header 2013-10-23 12:27:54 +02:00
mdb2schemamanager.php on mssql the schema migration sometimes fails due to an already existing transaction - error: 'New transaction is not allowed because there are other threads running in the session.' 2013-11-26 22:39:01 +01:00
mdb2schemareader.php DB: Support DECIMAL(precision,scale) syntax in XML 2013-12-17 22:46:45 +01:00
mdb2schemawriter.php move the private namespace OC into lib/private - OCP will stay in lib/public 2013-09-30 16:36:59 +02:00
oracleconnection.php move the private namespace OC into lib/private - OCP will stay in lib/public 2013-09-30 16:36:59 +02:00
statementwrapper.php Remove OC_DB_StatementWrapper::numRows(). 2013-12-21 19:36:14 +01:00