Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]
Database driver test class for testing moodle_read_slave_trait
Copyright: | 2018 Srdjan Janković, Catalyst IT |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 236 lines (7 kb) |
Included or required: | 2 times |
Referenced: | 0 times |
Includes or requires: | 2 files lib/dml/tests/fixtures/test_moodle_database.php lib/dml/moodle_read_slave_trait.php |
read_slave_moodle_database:: (16 methods):
raw_connect()
begin_transaction()
commit_transaction()
rollback_transaction()
with_query_start_end()
get_dbhwrite()
execute()
get_records_sql()
get_recordset_sql()
insert_record_raw()
update_record_raw()
get_db_handle()
set_db_handle()
add_temptable()
delete_temptable()
session_lock_supported()
Class: read_slave_moodle_database - X-Ref
Database driver test class with moodle_read_slave_traitraw_connect(string $dbhost, string $dbuser, string $dbpass, string $dbname, $prefix, array $dboptions = null) X-Ref |
Does not connect to the database. Sets handle property to $dbhost param: string $dbhost param: string $dbuser param: string $dbpass param: string $dbname param: mixed $prefix param: array $dboptions return: bool true |
begin_transaction() X-Ref |
Begin database transaction return: void |
commit_transaction() X-Ref |
Commit database transaction return: void |
rollback_transaction() X-Ref |
Abort database transaction return: void |
with_query_start_end($sql, ?array $params, $querytype, $callback = null) X-Ref |
Query wrapper that calls query_start() and query_end() param: string $sql param: array|null $params param: int $querytype param: ?callable $callback return: string $handle handle property |
get_dbhwrite() X-Ref |
get_dbhwrite() return: string $dbhwrite handle property |
execute($sql, array $params = null) X-Ref |
Calls with_query_start_end() param: string $sql param: array $params return: bool true |
get_records_sql($sql, array $params = null, $limitfrom = 0, $limitnum = 0) X-Ref |
get_records_sql() override, calls with_query_start_end() param: string $sql the SQL select query to execute. param: array $params array of sql parameters param: int $limitfrom return a subset of records, starting at this point (optional). param: int $limitnum return a subset comprising this many records (optional, required if $limitfrom is set). return: string $handle handle property |
get_recordset_sql($sql, array $params = null, $limitfrom = 0, $limitnum = 0) X-Ref |
Calls with_query_start_end() param: string $sql param: array $params param: int $limitfrom param: int $limitnum return: bool true |
insert_record_raw($table, $params, $returnid = true, $bulk = false, $customsequence = false) X-Ref |
Calls with_query_start_end() param: string $table param: array $params param: bool $returnid param: bool $bulk param: bool $customsequence return: string $handle handle property |
update_record_raw($table, $params, $bulk = false) X-Ref |
Calls with_query_start_end() param: string $table param: array $params param: bool $bulk return: string $handle handle property |
get_db_handle() X-Ref |
Gets handle property return: string $handle handle property |
set_db_handle($dbh) X-Ref |
Sets handle property param: string $dbh return: void |
add_temptable($temptable) X-Ref |
Add temptable param: string $temptable return: void |
delete_temptable($temptable) X-Ref |
Remove temptable param: string $temptable return: void |
session_lock_supported() X-Ref |
Is session lock supported in this driver? return: bool |