Query\Drivers\Mysql\Driver
MySQL specific class
Synopsis
- // members
- protected string $escape_char = '`';
- // Inherited members from AbstractDriver
- protected PDOStatement $statement;
- protected string $escape_char;
- protected SQL_Interface $sql;
- protected Abstract_Util $util;
- protected $last_query;
- protected string $table_prefix;
- protected bool $has_truncate;
- // methods
- public void __construct()
- // Inherited methods from AbstractDriver
- public void __construct()
- protected void _load_sub_classes()
- public mixed __call()
- public string get_last_query()
- public void set_last_query()
- public SQL_Interface get_sql()
- public Abstract_Util get_util()
- public void set_table_prefix()
- public PDOStatement prepare_query()
- public PDOStatement prepare_execute()
- public int affected_rows()
- public string prefix_table()
- public string quote_table()
- public string quote_ident()
- public array get_schemas()
- public array get_tables()
- public array get_dbs()
- public array get_views()
- public array get_sequences()
- public array get_functions()
- public array get_procedures()
- public array get_triggers()
- public array get_system_tables()
- public array get_columns()
- public array get_fks()
- public array get_indexes()
- public array get_types()
- public array driver_query()
- public int num_rows()
- public null|array<string|array|null> insert_batch()
- public mixed _quote()
- protected string _prefix()
- public PDOStatement truncate()
- // Inherited methods from PDO
- public void __construct()
- public bool beginTransaction()
- public bool commit()
- public mixed errorCode()
- public array errorInfo()
- public int exec()
- public mixed getAttribute()
- public array getAvailableDrivers()
- public bool inTransaction()
- public string lastInsertId()
- public PDOStatement prepare()
- public PDOStatement query()
- public string quote()
- public bool rollBack()
- public bool setAttribute()
Hierarchy
Extends
Coverage
Methods | 100% | 1 / 1 |
Lines | 0% | 0 / 0 |
Members
protected
- $escape_char
—
string
Set the backtick as the MySQL escape character - $escape_char
—
string
Character to escape identifiers - $has_truncate
—
Query\bool
Whether the driver supports 'TRUNCATE' - $last_query
—
string
Last query executed - $sql
—
Query\SQL_Interface
Reference to sql class - $statement
—
\PDOStatement
Reference to the last executed query - $table_prefix
—
string
Prefix to apply to table names - $util
—
Query\Abstract_Util
Reference to util class
Methods
Inherited from Query\AbstractDriver
protected
- _load_sub_classes() — Loads the subclasses for the driver
- _prefix() — Sets the table prefix on the passed string
public
- __call() — Allow invoke to work on table object
- _quote() — Helper method for quote_ident
- affected_rows() — Returns number of rows affected by an INSERT, UPDATE, DELETE type query
- driver_query() — Method to simplify retrieving db results for meta-data queries
- get_columns() — Retrieve column information for the current database table
- get_dbs() — Return list of dbs for the current connection, if possible
- get_fks() — Retrieve foreign keys for the table
- get_functions() — Return list of functions for the current database
- get_indexes() — Retrieve indexes for the table
- get_last_query() — Get the last sql query exexcuted
- get_procedures() — Return list of stored procedures for the current database
- get_schemas() — Return schemas for databases that list them
- get_sequences() — Return list of sequences for the current database, if they exist
- get_sql() — Get the SQL class for the current driver
- get_system_tables() — Retrieves an array of non-user-created tables for the connection/database
- get_tables() — Return list of tables for the current database
- get_triggers() — Return list of triggers for the current database
- get_types() — Retrieve list of data types for the database
- get_util() — Get the Util class for the current driver
- get_views() — Return list of views for the current database
- insert_batch() — Create sql for batch insert
- num_rows() — Return the number of rows returned for a SELECT query
- prefix_table() — Prefixes a table if it is not already prefixed
- prepare_execute() — Create and execute a prepared statement with the provided parameters
- prepare_query() — Simplifies prepared statements for database queries
- quote_ident() — Surrounds the string with the databases identifier escape characters
- quote_table() — Quote database table name, and set prefix
- set_last_query() — Set the last query sql
- set_table_prefix() — Set the common table name prefix
- truncate() — Empty the passed table
Inherited from PDO
public
- beginTransaction() — Initiates a transaction
- commit() — Commits a transaction
- errorCode() — Fetch the SQLSTATE associated with the last operation on the database handle
- errorInfo() — Fetch extended error information associated with the last operation on the database handle
- exec() — Execute an SQL statement and return the number of affected rows
- getAttribute() — Retrieve a database connection attribute
- getAvailableDrivers() — Return an array of available PDO drivers
- inTransaction() — Checks if inside a transaction
- lastInsertId() — Returns the ID of the last inserted row or sequence value
- prepare() — Prepares a statement for execution and returns a statement object
- query() — Executes an SQL statement, returning a result set as a PDOStatement object
- quote() — Quotes a string for use in a query.
- rollBack() — Rolls back a transaction
- setAttribute() — Set an attribute
History
-
2015-11-10T10:12:23-05:00 (commit #b5a141f)
Author: Timothy J Warren (tim@timshomepage.net) / Commiter: Timothy J Warren (tim@timshomepage.net)
Make class names Pascal Case
-
2015-07-30T16:40:30-04:00 (commit #225017a)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Lots of refactoring -- accessors/mutators instead of direct access, reduce query builder test database connections, and simplify some logic
-
2015-07-29T16:51:17-04:00 (commit #8511c6a)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Move library into src folder, fix simpletest test runner
-
2015-07-16T16:56:13-04:00 (commit #bfc3ea3)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Reorganize drivers into a more modern layout
-
2014-04-24T16:25:04-04:00 (commit #5b531cf)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
De-duplicate truncate method of drivers
-
2014-04-09T10:30:01-04:00 (commit #3ce35d7)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Fix tests, by fixing some issues with auto-prefixing table names
-
2014-04-02T17:08:50-04:00 (commit #e3fdad5)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Namespaces!
-
2014-03-26T20:49:33-04:00 (commit #846e68a)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Add interface for pdo drivers to enforce the same interface on the Firebird driver
-
2014-02-11T14:38:08-05:00 (commit #8e16cc0)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Fix dsn issue in tests
-
2014-02-11T14:29:41-05:00 (commit #bed0d1b)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Improve code coverage
-
2014-02-04T20:59:30-05:00 (commit #8dc2079)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Add `explain` method to query builder
-
2014-01-02T12:36:50-05:00 (commit #6dc9ed0)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Update copyright for the new year
-
2013-01-02T14:26:42-05:00 (commit #0e44bba)
Author: Timothy Warren (tim@timshomepage.net) / Commiter: Timothy Warren (tim@timshomepage.net)
Update year
-
2012-12-18T16:19:52-05:00 (commit #785e5f2)
Author: Timothy Warren (tim@timshomepage.net) / Commiter: Timothy Warren (tim@timshomepage.net)
Add interfaces
-
2012-07-05T14:19:49-04:00 (commit #1e71b22)
Author: Timothy Warren (tim@timshomepage.net) / Commiter: Timothy Warren (tim@timshomepage.net)
Make mysql/postgres drivers compatible with Quercus
-
2012-05-07T16:05:51-04:00 (commit #e4acfda)
Author: Timothy Warren (tim@timshomepage.net) / Commiter: Timothy Warren (tim@timshomepage.net)
Add list_types abstract method to db_sql class