# \Query\Drivers\SqliteDriver

SQLite specific class

Extends PDO to simplify cross-database issues

## Summary

Methods
Properties
Constants
__construct()
__call()
get_last_query()
set_last_query()
get_sql()
get_util()
set_table_prefix()
prepare_query()
prepare_execute()
affected_rows()
prefix_table()
quote_table()
quote_ident()
get_schemas()
get_tables()
get_dbs()
get_views()
get_sequences()
get_functions()
get_procedures()
get_triggers()
get_system_tables()
get_columns()
get_fks()
get_indexes()
get_types()
driver_query()
num_rows()
insert_batch()
_quote()
truncate()
No public properties found
No constants found
_load_sub_classes()
_prefix()
$statement
$escape_char
$sql
$util
$last_query
$table_prefix
$has_truncate
N/A
No private methods found
No private properties found
N/A

File
  src/Query/Drivers/Sqlite/Driver.php
Package
  Query\Drivers
Class hierarchy
  \PDO
  \Query\Abstract_Driver
  \Query\Drivers\Sqlite\Driver

## Tags

None found

## Properties

### $statement

    $statement : \Query\Drivers\Sqlite\PDOStatement

Reference to the last executed sql query

#### Type

\Query\Drivers\Sqlite\PDOStatement

#

## Tags

None found

### $escape_char

    $escape_char : string

Character to escape identifiers

#### Type

string

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### $sql

    $sql : \Query\SQL_Interface

Reference to sql class

#### Type

\Query\SQL_Interface

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### $util

    $util : \Query\Abstract_Util

Reference to util class

#### Type

\Query\Abstract_Util

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### $last_query

    $last_query : string

Last query executed

#### Type

string

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### $table_prefix

    $table_prefix : string

Prefix to apply to table names

#### Type

string

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### $has_truncate

    $has_truncate : boolean

SQLite has a truncate optimization, but no support for the actual keyword

#### Type

boolean

#

## Tags

None found

## Methods

### __construct()

    __construct(string  $dsn, string  $user = NULL, string  $pass = NULL, array  $driver_options = array())

Open SQLite Database

#### Parameters

string | $dsn |
string | $user |
string | $pass |
array | $driver_options |

#

## Tags

None found

### __call()

    __call(string  $name, array  $args = array()) : mixed

Allow invoke to work on table object

#### Parameters

string | $name |
array | $args |

#### Returns

mixed

#

Inherited from
  \Query\Abstract_Driver

## Tags

codeCoverageIgnore |

### get_last_query()

    get_last_query() : string

Get the last sql query exexcuted

#### Returns

string

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### set_last_query()

    set_last_query(string  $query_string) : void

Set the last query sql

#### Parameters

string | $query_string |

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### get_sql()

    get_sql() : \Query\SQL_Interface

Get the SQL class for the current driver

#### Returns

\Query\SQL_Interface

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### get_util()

    get_util() : \Query\Abstract_Util

Get the Util class for the current driver

#### Returns

\Query\Abstract_Util

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### set_table_prefix()

    set_table_prefix(string  $prefix) : void

Set the common table name prefix

#### Parameters

string | $prefix |

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### prepare_query()

    prepare_query(string  $sql, array  $data) : \PDOStatement

Simplifies prepared statements for database queries

#### Parameters

string | $sql |
array | $data |

#### Throws

\InvalidArgumentException

#### Returns

\PDOStatement —

| FALSE

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### prepare_execute()

    prepare_execute(string  $sql, array  $params) : \PDOStatement

Create and execute a prepared statement with the provided parameters

#### Parameters

string | $sql |
array | $params |

#### Returns

\PDOStatement

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### affected_rows()

    affected_rows() : integer

Returns number of rows affected by an INSERT, UPDATE, DELETE type query

#### Returns

integer

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### prefix_table()

    prefix_table(string  $table) : string

Prefixes a table if it is not already prefixed

#### Parameters

string | $table |

#### Returns

string

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### quote_table()

    quote_table(string  $table) : string

Quote database table name, and set prefix

#### Parameters

string | $table |

#### Returns

string

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### quote_ident()

    quote_ident(mixed  $ident) : string

Surrounds the string with the databases identifier escape characters

#### Parameters

mixed | $ident |

#### Returns

string

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### get_schemas()

    get_schemas() : array

Return schemas for databases that list them

#### Returns

array

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### get_tables()

    get_tables() : mixed

List tables for the current database

#### Returns

mixed

#

## Tags

None found

### get_dbs()

    get_dbs() : array

Return list of dbs for the current connection, if possible

#### Returns

array

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### get_views()

    get_views() : array

Return list of views for the current database

#### Returns

array

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### get_sequences()

    get_sequences() : array

Return list of sequences for the current database, if they exist

#### Returns

array

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### get_functions()

    get_functions() : array

Return list of functions for the current database

#### Returns

array

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### get_procedures()

    get_procedures() : array

Return list of stored procedures for the current database

#### Returns

array

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### get_triggers()

    get_triggers() : array

Return list of triggers for the current database

#### Returns

array

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### get_system_tables()

    get_system_tables() : array

Retrieves an array of non-user-created tables for the connection/database

#### Returns

array

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### get_columns()

    get_columns(string  $table) : array

Retrieve column information for the current database table

#### Parameters

string | $table |

#### Returns

array

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### get_fks()

    get_fks(string  $table) : array

Retrieve foreign keys for the table

#### Parameters

string | $table |

#### Returns

array

#

## Tags

None found

### get_indexes()

    get_indexes(string  $table) : array

Retrieve indexes for the table

#### Parameters

string | $table |

#### Returns

array

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### get_types()

    get_types() : array

Retrieve list of data types for the database

#### Returns

array

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### driver_query()

    driver_query(string|array|null  $query, boolean  $filtered_index = TRUE) : array

Method to simplify retrieving db results for meta-data queries

#### Parameters

string|array|null | $query |
boolean | $filtered_index |

#### Returns

array

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### num_rows()

    num_rows() : integer

Return the number of rows returned for a SELECT query

#### Returns

integer

#

Inherited from
  \Query\Abstract_Driver
See also

## Tags

None found

### insert_batch()

    insert_batch(string  $table, array  $data = array()) : string

Create sql for batch insert

#### Parameters

string | $table |
array | $data |

#### Returns

string

#

## Tags

codeCoverageIgnore |

### _quote()

    _quote(mixed  $str) : mixed

Helper method for quote_ident

#### Parameters

mixed | $str |

#### Returns

mixed

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### truncate()

    truncate(string  $table) : \PDOStatement

Empty the passed table

#### Parameters

string | $table |

#### Returns

\PDOStatement

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### _load_sub_classes()

    _load_sub_classes() : void

Loads the subclasses for the driver

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### _prefix()

    _prefix(string  $str) : string

Sets the table prefix on the passed string

#### Parameters

string | $str |

#### Returns

string

#

Inherited from
  \Query\Abstract_Driver

## Tags

None found

### Driver.php