Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
97a6f5c4
Commit
97a6f5c4
authored
10 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
Extend \OCP\IDBConnection to cover more use cases
parent
72f99f50
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/public/idbconnection.php
+61
-3
61 additions, 3 deletions
lib/public/idbconnection.php
with
61 additions
and
3 deletions
lib/public/idbconnection.php
+
61
−
3
View file @
97a6f5c4
...
@@ -43,6 +43,32 @@ interface IDBConnection {
...
@@ -43,6 +43,32 @@ interface IDBConnection {
*/
*/
public
function
prepare
(
$sql
,
$limit
=
null
,
$offset
=
null
);
public
function
prepare
(
$sql
,
$limit
=
null
,
$offset
=
null
);
/**
* Executes an, optionally parameterized, SQL query.
*
* If the query is parameterized, a prepared statement is used.
* If an SQLLogger is configured, the execution is logged.
*
* @param string $query The SQL query to execute.
* @param string[] $params The parameters to bind to the query, if any.
* @param array $types The types the previous parameters are in.
* @return \Doctrine\DBAL\Driver\Statement The executed statement.
*/
public
function
executeQuery
(
$query
,
array
$params
=
array
(),
$types
=
array
());
/**
* Executes an SQL INSERT/UPDATE/DELETE query with the given parameters
* and returns the number of affected rows.
*
* This method supports PDO binding types as well as DBAL mapping types.
*
* @param string $query The SQL query.
* @param array $params The query parameters.
* @param array $types The parameter types.
* @return integer The number of affected rows.
*/
public
function
executeUpdate
(
$query
,
array
$params
=
array
(),
array
$types
=
array
());
/**
/**
* Used to get the id of the just inserted element
* Used to get the id of the just inserted element
* @param string $table the name of the table where we inserted the item
* @param string $table the name of the table where we inserted the item
...
@@ -71,19 +97,16 @@ interface IDBConnection {
...
@@ -71,19 +97,16 @@ interface IDBConnection {
/**
/**
* Start a transaction
* Start a transaction
* @return bool TRUE on success or FALSE on failure
*/
*/
public
function
beginTransaction
();
public
function
beginTransaction
();
/**
/**
* Commit the database changes done during a transaction that is in progress
* Commit the database changes done during a transaction that is in progress
* @return bool TRUE on success or FALSE on failure
*/
*/
public
function
commit
();
public
function
commit
();
/**
/**
* Rollback the database changes done during a transaction that is in progress
* Rollback the database changes done during a transaction that is in progress
* @return bool TRUE on success or FALSE on failure
*/
*/
public
function
rollBack
();
public
function
rollBack
();
...
@@ -92,4 +115,39 @@ interface IDBConnection {
...
@@ -92,4 +115,39 @@ interface IDBConnection {
* @return string
* @return string
*/
*/
public
function
getError
();
public
function
getError
();
/**
* Fetch the SQLSTATE associated with the last database operation.
*
* @return integer The last error code.
*/
public
function
errorCode
();
/**
* Fetch extended error information associated with the last database operation.
*
* @return array The last error information.
*/
public
function
errorInfo
();
/**
* Establishes the connection with the database.
*
* @return bool
*/
public
function
connect
();
/**
* Close the database connection
*/
public
function
close
();
/**
* Quotes a given input parameter.
*
* @param mixed $input Parameter to be quoted.
* @param int $type Type of the parameter.
* @return string The quoted parameter.
*/
public
function
quote
(
$input
,
$type
=
\PDO
::
PARAM_STR
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment