Transaction
type Transaction = Transaction
An in-progress database transaction or savepoint.
A transaction should end with a call to commit
or rollback
.
You must call commit
or rollback
, unless that the transaction will leak (The transaction will be rolled back on GC).
A savepoint is a special mark inside a transaction that allows all commands that are executed after it was established to be rolled back, restoring the transaction state to what it was at the time of the savepoint.
[src]
pub fn commit(self) throws SqlError {
try (self as _Transaction).commit();
}
Commits this transaction or savepoint.
[src]
pub fn commit(self) throws SqlError {
try (self as _Transaction).commit();
}
Commits this transaction or savepoint.
Commits this transaction or savepoint.
execute
pub fn execute(self, query: string, values: ..BindValue?): QueryResult throws SqlError
[src]
pub fn execute(self, query: string, values: ..BindValue?): QueryResult throws SqlError {
return try (self as _Transaction).execute(query, build_bind_values(..values)) as QueryResult;
}
Execute the query and return the total number of rows affected.
See: sql.Connection.execute
execute
pub fn execute(self, query: string, values: ..BindValue?): QueryResult throws SqlError
[src]
pub fn execute(self, query: string, values: ..BindValue?): QueryResult throws SqlError {
return try (self as _Transaction).execute(query, build_bind_values(..values)) as QueryResult;
}
Execute the query and return the total number of rows affected.
See: sql.Connection.execute
Execute the query and return the total number of rows affected.
See: sql.Connection.execute
[src]
pub fn query(self, query: string, values: ..BindValue?): Rows throws SqlError {
return try (self as _Transaction).query(query, build_bind_values(..values)) as Rows;
}
Query and return a steam of rows.
Returns a sql.Rows
for iterating the rows, and you must call rows.close
after you finish the iteration.
[src]
pub fn query(self, query: string, values: ..BindValue?): Rows throws SqlError {
return try (self as _Transaction).query(query, build_bind_values(..values)) as Rows;
}
Query and return a steam of rows.
Returns a sql.Rows
for iterating the rows, and you must call rows.close
after you finish the iteration.
Query and return a steam of rows.
Returns a sql.Rows
for iterating the rows, and you must call rows.close
after you finish the iteration.
See: sql.Connection.query
[src]
pub fn query_one(self, query: string, values: ..BindValue?): Row? throws SqlError {
return try self.query(query, ..values).next();
}
Query and return the first row.
[src]
pub fn query_one(self, query: string, values: ..BindValue?): Row? throws SqlError {
return try self.query(query, ..values).next();
}
Query and return the first row.
Query and return the first row.
See: sql.Connection.query_one