A

AmbiguousReferenceKeyException — Class in namespace Nette\Database\Conventions

Multiple matching columns found for a relationship reference.

Driver::applyLimit() — Method in class Driver

Applies LIMIT and OFFSET clauses to an SQL query.

MsSqlDriver::applyLimit() — Method in class MsSqlDriver

Applies LIMIT and OFFSET clauses to an SQL query.

MySqlDriver::applyLimit() — Method in class MySqlDriver

Applies LIMIT and OFFSET clauses to an SQL query.

OciDriver::applyLimit() — Method in class OciDriver

Applies LIMIT and OFFSET clauses to an SQL query.

OdbcDriver::applyLimit() — Method in class OdbcDriver

Applies LIMIT and OFFSET clauses to an SQL query.

PgSqlDriver::applyLimit() — Method in class PgSqlDriver

Applies LIMIT and OFFSET clauses to an SQL query.

SqliteDriver::applyLimit() — Method in class SqliteDriver

Applies LIMIT and OFFSET clauses to an SQL query.

SqlsrvDriver::applyLimit() — Method in class SqlsrvDriver

Applies LIMIT and OFFSET clauses to an SQL query.

Structure::analyzePrimaryKey() — Method in class Structure
Structure::analyzeForeignKeys() — Method in class Structure
ActiveRow — Class in namespace Nette\Database\Table

Represents database row with support for relations.

ActiveRow::accessColumn() — Method in class ActiveRow
$ GroupedSelection#active — Property in class GroupedSelection

primary key

GroupedSelection::aggregation() — Method in class GroupedSelection

Calculates aggregation for this group.

$ Selection#aggregation — Property in class Selection
$ Selection#accessedColumns — Property in class Selection
Selection::alias() — Method in class Selection

Aliases table. Example ':book:book_tag.tag', 'tg'

Selection::aggregation() — Method in class Selection

Executes aggregation function.

Selection::accessColumn() — Method in class Selection
$ SqlBuilder#aliases — Property in class SqlBuilder
SqlBuilder::addSelect() — Method in class SqlBuilder

Adds SELECT clause, more calls append to the end.

SqlBuilder::addWhere() — Method in class SqlBuilder

Adds WHERE condition, more calls append with AND.

SqlBuilder::addJoinCondition() — Method in class SqlBuilder

Adds JOIN condition.

SqlBuilder::addCondition() — Method in class SqlBuilder

Normalizes and appends a condition with its parameters. Deduplicates identical conditions.

SqlBuilder::addAlias() — Method in class SqlBuilder

Adds alias AS.

SqlBuilder::addOrder() — Method in class SqlBuilder

Adds ORDER BY clause, more calls append to the end.

SqlBuilder::addConditionComposition() — Method in class SqlBuilder

Adds a multi-column IN condition using OR expansion or tuple syntax depending on driver support.

B

DatabaseExtension::beforeCompile() — Method in class DatabaseExtension
Connection::beginTransaction() — Method in class Connection

Starts a transaction.

Explorer::beginTransaction() — Method in class Explorer
SqlBuilder::buildInsertQuery() — Method in class SqlBuilder
SqlBuilder::buildUpdateQuery() — Method in class SqlBuilder
SqlBuilder::buildDeleteQuery() — Method in class SqlBuilder
SqlBuilder::buildSelectQuery() — Method in class SqlBuilder

Returns SQL query.

SqlBuilder::buildSelect() — Method in class SqlBuilder
SqlBuilder::buildQueryJoins() — Method in class SqlBuilder
SqlBuilder::buildJoinConditions() — Method in class SqlBuilder
SqlBuilder::buildConditions() — Method in class SqlBuilder
SqlBuilder::buildQueryEnd() — Method in class SqlBuilder

C

ConnectionPanel — Class in namespace Nette\Bridges\DatabaseTracy

Tracy Bar panel showing executed SQL queries with timing and EXPLAIN support.

CheckConstraintViolationException — Class in namespace Nette\Database

A CHECK constraint check failed.

Connection — Class in namespace Nette\Database

Manages database connection and executes SQL queries.

Connection::connect() — Method in class Connection

Connects to the database server if not already connected.

Connection::commit() — Method in class Connection

Commits current transaction.

ConnectionException — Class in namespace Nette\Database

Failed to connect to the database server.

ConnectionLostException — Class in namespace Nette\Database

The connection to the server was lost during an operation (e.g. server restart, network failure, idle-timeout). A reconnect is needed before the connection can be used again.

ConstraintViolationException — Class in namespace Nette\Database

A database constraint was violated.

Context — Class in namespace Nette\Database
Conventions — Class in namespace Nette\Database

Provides naming conventions for database tables and columns.

Driver::convertException() — Method in class Driver

Converts PDOException to DriverException or its descendant.

MsSqlDriver::convertException() — Method in class MsSqlDriver

Converts PDOException to DriverException or its descendant.

MySqlDriver::convertException() — Method in class MySqlDriver

Converts PDOException to DriverException or its descendant.

OciDriver::convertException() — Method in class OciDriver

Converts PDOException to DriverException or its descendant.

OdbcDriver::convertException() — Method in class OdbcDriver

Converts PDOException to DriverException or its descendant.

PgSqlDriver::convertException() — Method in class PgSqlDriver

Converts PDOException to DriverException or its descendant.

SqliteDriver::convertException() — Method in class SqliteDriver

Converts PDOException to DriverException or its descendant.

SqlsrvDriver::convertException() — Method in class SqlsrvDriver

Converts PDOException to DriverException or its descendant.

Explorer::commit() — Method in class Explorer
Explorer::createActiveRow() — Method in class Explorer

Creates an ActiveRow instance, using the configured row mapping class if available.

Explorer::createGroupedSelection() — Method in class Explorer
Helpers::createDebugPanel() — Method in class Helpers
Column — Class in namespace Nette\Database\Reflection

Database table column metadata.

$ Table#columns — Property in class Table
ResultSet::current() — Method in class ResultSet
$ Structure#cache — Property in class Structure
GroupedSelection::count() — Method in class GroupedSelection

Returns count of fetched rows, or runs COUNT($column) query when column is specified.

$ Selection#context — Property in class Selection

back compatibility

$ Selection#conventions — Property in class Selection
$ Selection#cache — Property in class Selection
Selection::condition() — Method in class Selection

Adds a WHERE or JOIN condition. When $tableChain is given, the condition is added to the JOIN ON clause.

Selection::count() — Method in class Selection

Returns count of fetched rows, or runs COUNT($column) query when column is specified.

Selection::createRow() — Method in class Selection
Selection::createSelectionInstance() — Method in class Selection
Selection::createGroupedSelectionInstance() — Method in class Selection
Selection::current() — Method in class Selection
$ SqlBuilder#conventions — Property in class SqlBuilder
$ SqlBuilder#conditions — Property in class SqlBuilder
$ SqlBuilder#currentAlias — Property in class SqlBuilder
SqlBuilder::checkUniqueTableName() — Method in class SqlBuilder

Ensures a table alias is not used for two different chains, throwing on conflict.

D

DatabaseExtension — Class in namespace Nette\Bridges\DatabaseDI

Registers database Connection, Structure, and Explorer services in the DI container.

$ ConnectionPanel#disabled — Property in class ConnectionPanel
Connection::disconnect() — Method in class Connection

Disconnects from database.

DiscoveredConventions — Class in namespace Nette\Database\Conventions

Discovers database conventions based on table structure metadata.

DateTime — Class in namespace Nette\Database

Immutable date-time value with JSON and string serialization support.

DeadlockException — Class in namespace Nette\Database

Deadlock or serialization failure detected by the server; the transaction was rolled back and can be retried.

Driver — Class in namespace Nette\Database

Provides database-specific functionality.

Driver::delimite() — Method in class Driver

Adds delimiters around database identifier.

DriverException — Class in namespace Nette\Database

Base class for all errors in the driver or SQL server.

MsSqlDriver::delimite() — Method in class MsSqlDriver

Adds delimiters around database identifier.

MySqlDriver::delimite() — Method in class MySqlDriver

Adds delimiters around database identifier.

OciDriver::delimite() — Method in class OciDriver

Adds delimiters around database identifier.

OdbcDriver::delimite() — Method in class OdbcDriver

Adds delimiters around database identifier.

PgSqlDriver::delimite() — Method in class PgSqlDriver

Adds delimiters around database identifier.

SqliteDriver::delimite() — Method in class SqliteDriver

Adds delimiters around database identifier.

SqlsrvDriver::delimite() — Method in class SqlsrvDriver

Adds delimiters around database identifier.

Helpers::dumpResult() — Method in class Helpers

Displays result set as HTML table.

Helpers::dumpSql() — Method in class Helpers

Returns syntax-highlighted SQL query as an HTML string.

Helpers::detectTypes() — Method in class Helpers

Detects column types from a PDO statement using column metadata.

Helpers::detectType() — Method in class Helpers

Maps a native column type string to an IStructure::FIELD_* constant.

ResultSet::dump() — Method in class ResultSet

Displays result set as HTML table.

ActiveRow::delete() — Method in class ActiveRow

Deletes the row from database.

GroupedSelection::delete() — Method in class GroupedSelection

Deletes all rows matching current conditions.

$ Selection#data — Property in class Selection
$ Selection#dataRefreshed — Property in class Selection
Selection::delete() — Method in class Selection

Deletes all rows matching current conditions.

$ SqlBuilder#delimitedTable — Property in class SqlBuilder

E

$ ConnectionPanel#explain — Property in class ConnectionPanel
Explorer — Class in namespace Nette\Database

Provides high-level database layer with ActiveRow pattern.

GroupedSelection::execute() — Method in class GroupedSelection
GroupedSelection::emptyResultSet() — Method in class GroupedSelection
$ Selection#explorer — Property in class Selection
Selection::execute() — Method in class Selection
Selection::emptyResultSet() — Method in class Selection

F

Connection::fetch() — Method in class Connection

Executes SQL query and returns the first row, or null if no rows were returned.

Connection::fetchAssoc() — Method in class Connection

Executes SQL query and returns the first row as an associative array, or null.

Connection::fetchField() — Method in class Connection

Executes SQL query and returns the first field of the first row, or null.

Connection::fetchList() — Method in class Connection

Executes SQL query and returns the first row as an indexed array, or null.

Connection::fetchFields() — Method in class Connection

Executes SQL query and returns the first row as an indexed array, or null.

Connection::fetchPairs() — Method in class Connection
Connection::fetchAll() — Method in class Connection

Executes SQL query and returns all rows as an array of Row objects.

Driver::formatDateTime() — Method in class Driver

Formats a date-time value for use in an SQL statement.

Driver::formatDateInterval() — Method in class Driver

Formats a date-time interval for use in an SQL statement.

Driver::formatLike() — Method in class Driver

Encodes string for use in a LIKE statement.

DriverException::from() — Method in class DriverException

Creates a DriverException from a PDOException, preserving error info and stack trace location.

MsSqlDriver::formatDateTime() — Method in class MsSqlDriver

Formats a date-time value for use in an SQL statement.

MsSqlDriver::formatDateInterval() — Method in class MsSqlDriver

Formats a date-time interval for use in an SQL statement.

MsSqlDriver::formatLike() — Method in class MsSqlDriver

Encodes string for use in a LIKE statement.

MySqlDriver::formatDateTime() — Method in class MySqlDriver

Formats a date-time value for use in an SQL statement.

MySqlDriver::formatDateInterval() — Method in class MySqlDriver

Formats a date-time interval for use in an SQL statement.

MySqlDriver::formatLike() — Method in class MySqlDriver

Encodes string for use in a LIKE statement.

OciDriver::formatDateTime() — Method in class OciDriver

Formats a date-time value for use in an SQL statement.

OciDriver::formatDateInterval() — Method in class OciDriver

Formats a date-time interval for use in an SQL statement.

OciDriver::formatLike() — Method in class OciDriver

Encodes string for use in a LIKE statement.

OdbcDriver::formatDateTime() — Method in class OdbcDriver

Formats a date-time value for use in an SQL statement.

OdbcDriver::formatDateInterval() — Method in class OdbcDriver

Formats a date-time interval for use in an SQL statement.

OdbcDriver::formatLike() — Method in class OdbcDriver

Encodes string for use in a LIKE statement.

PgSqlDriver::formatDateTime() — Method in class PgSqlDriver

Formats a date-time value for use in an SQL statement.

PgSqlDriver::formatDateInterval() — Method in class PgSqlDriver

Formats a date-time interval for use in an SQL statement.

PgSqlDriver::formatLike() — Method in class PgSqlDriver

Encodes string for use in a LIKE statement.

SqliteDriver::formatDateTime() — Method in class SqliteDriver

Formats a date-time value for use in an SQL statement.

SqliteDriver::formatDateInterval() — Method in class SqliteDriver

Formats a date-time interval for use in an SQL statement.

SqliteDriver::formatLike() — Method in class SqliteDriver

Encodes string for use in a LIKE statement.

SqlsrvDriver::formatDateTime() — Method in class SqlsrvDriver

Formats a date-time value for use in an SQL statement.

SqlsrvDriver::formatDateInterval() — Method in class SqlsrvDriver

Formats a date-time interval for use in an SQL statement.

SqlsrvDriver::formatLike() — Method in class SqlsrvDriver

Encodes string for use in a LIKE statement.

Explorer::fetch() — Method in class Explorer

Executes SQL query and returns the first row, or null if no rows were returned.

Explorer::fetchAssoc() — Method in class Explorer

Executes SQL query and returns the first row as an associative array, or null.

Explorer::fetchField() — Method in class Explorer

Executes SQL query and returns the first field of the first row, or null.

Explorer::fetchList() — Method in class Explorer

Executes SQL query and returns the first row as an indexed array, or null.

Explorer::fetchFields() — Method in class Explorer

Executes SQL query and returns the first row as an indexed array, or null.

Explorer::fetchPairs() — Method in class Explorer
Explorer::fetchAll() — Method in class Explorer

Executes SQL query and returns all rows as an array of Row objects.

ForeignKeyConstraintViolationException — Class in namespace Nette\Database

The foreign key constraint check failed.

Helpers::findDuplicates() — Method in class Helpers

Returns a human-readable string listing duplicate column names in the result set.

ForeignKey — Class in namespace Nette\Database\Reflection

Database foreign key relationship.

$ Table#foreignKeys — Property in class Table
ResultSet::fetchAssoc() — Method in class ResultSet

Returns the next row as an associative array, or null if there are no more rows.

ResultSet::fetch() — Method in class ResultSet

Returns the next row as a Row object or null if there are no more rows.

ResultSet::fetchField() — Method in class ResultSet

Returns the first field of the next row or null if there are no more rows.

ResultSet::fetchList() — Method in class ResultSet

Returns the next row as indexed array or null if there are no more rows.

ResultSet::fetchFields() — Method in class ResultSet

Alias for fetchList().

ResultSet::fetchPairs() — Method in class ResultSet
ResultSet::fetchAll() — Method in class ResultSet

Returns all remaining rows as array of Row objects.

Selection::fetch() — Method in class Selection

Returns the next row or null if there are no more rows.

Selection::fetchField() — Method in class Selection

Fetches single field.

Selection::fetchPairs() — Method in class Selection

Returns all rows as associative array, where first argument specifies key column and second value column.

Selection::fetchAll() — Method in class Selection

Returns all rows as an array indexed by primary key.

Selection::fetchAssoc() — Method in class Selection

Returns all rows as associative tree.

G

DatabaseExtension::getConfigSchema() — Method in class DatabaseExtension
ConnectionPanel::getTab() — Method in class ConnectionPanel
ConnectionPanel::getPanel() — Method in class ConnectionPanel
Connection::getDsn() — Method in class Connection
Connection::getPdo() — Method in class Connection
Connection::getDriver() — Method in class Connection
Connection::getSupplementalDriver() — Method in class Connection
Connection::getReflection() — Method in class Connection
Connection::getInsertId() — Method in class Connection

Returns the ID of the last inserted row, or the last value from a sequence.

Connection::getLastQueryString() — Method in class Connection
Conventions::getPrimary() — Method in class Conventions

Returns primary key for table.

Conventions::getHasManyReference() — Method in class Conventions

Returns the referencing table name and referencing column for a has-many relationship.

Conventions::getBelongsToReference() — Method in class Conventions

Returns the referenced table name and local foreign key column for a belongs-to relationship.

DiscoveredConventions::getPrimary() — Method in class DiscoveredConventions

Returns primary key for table.

DiscoveredConventions::getHasManyReference() — Method in class DiscoveredConventions

Finds the referencing table and column for a has-many relationship by searching structure metadata.

DiscoveredConventions::getBelongsToReference() — Method in class DiscoveredConventions

Finds the referenced table and local foreign key column for a belongs-to relationship.

StaticConventions::getPrimary() — Method in class StaticConventions

Returns primary key for table.

StaticConventions::getHasManyReference() — Method in class StaticConventions

Returns the referencing table name and referencing column for a has-many relationship.

StaticConventions::getBelongsToReference() — Method in class StaticConventions

Returns the referenced table name and local foreign key column for a belongs-to relationship.

StaticConventions::getColumnFromTable() — Method in class StaticConventions
Driver::getTables() — Method in class Driver

Returns a list of all tables in the database.

Driver::getColumns() — Method in class Driver

Returns metadata for all columns in a table.

Driver::getIndexes() — Method in class Driver

Returns metadata for all indexes in a table.

Driver::getForeignKeys() — Method in class Driver

Returns metadata for all foreign keys in a table.

Driver::getColumnTypes() — Method in class Driver

Returns associative array of detected types (IStructure::FIELD_*) in result set.

DriverException::getDriverCode() — Method in class DriverException

Returns the driver-specific error code, or null if not available.

DriverException::getSqlState() — Method in class DriverException

Returns the SQLSTATE error code, or null if not available.

DriverException::getQueryString() — Method in class DriverException
DriverException::getParameters() — Method in class DriverException
MsSqlDriver::getTables() — Method in class MsSqlDriver

Returns a list of all tables in the database.

MsSqlDriver::getColumns() — Method in class MsSqlDriver

Returns metadata for all columns in a table.

MsSqlDriver::getIndexes() — Method in class MsSqlDriver

Returns metadata for all indexes in a table.

MsSqlDriver::getForeignKeys() — Method in class MsSqlDriver

Returns metadata for all foreign keys in a table.

MsSqlDriver::getColumnTypes() — Method in class MsSqlDriver

Returns associative array of detected types (IStructure::FIELD_*) in result set.

MySqlDriver::getTables() — Method in class MySqlDriver

Returns a list of all tables in the database.

MySqlDriver::getColumns() — Method in class MySqlDriver

Returns metadata for all columns in a table.

MySqlDriver::getIndexes() — Method in class MySqlDriver

Returns metadata for all indexes in a table.

MySqlDriver::getForeignKeys() — Method in class MySqlDriver

Returns metadata for all foreign keys in a table.

MySqlDriver::getColumnTypes() — Method in class MySqlDriver

Returns associative array of detected types (IStructure::FIELD_*) in result set.

OciDriver::getTables() — Method in class OciDriver

Returns a list of all tables in the database.

OciDriver::getColumns() — Method in class OciDriver

Returns metadata for all columns in a table.

OciDriver::getIndexes() — Method in class OciDriver

Returns metadata for all indexes in a table.

OciDriver::getForeignKeys() — Method in class OciDriver

Returns metadata for all foreign keys in a table.

OciDriver::getColumnTypes() — Method in class OciDriver

Returns associative array of detected types (IStructure::FIELD_*) in result set.

OdbcDriver::getTables() — Method in class OdbcDriver

Returns a list of all tables in the database.

OdbcDriver::getColumns() — Method in class OdbcDriver

Returns metadata for all columns in a table.

OdbcDriver::getIndexes() — Method in class OdbcDriver

Returns metadata for all indexes in a table.

OdbcDriver::getForeignKeys() — Method in class OdbcDriver

Returns metadata for all foreign keys in a table.

OdbcDriver::getColumnTypes() — Method in class OdbcDriver

Returns associative array of detected types (IStructure::FIELD_*) in result set.

PgSqlDriver::getTables() — Method in class PgSqlDriver

Returns a list of all tables in the database.

PgSqlDriver::getColumns() — Method in class PgSqlDriver

Returns metadata for all columns in a table.

PgSqlDriver::getIndexes() — Method in class PgSqlDriver

Returns metadata for all indexes in a table.

PgSqlDriver::getForeignKeys() — Method in class PgSqlDriver

Returns metadata for all foreign keys in a table.

PgSqlDriver::getColumnTypes() — Method in class PgSqlDriver

Returns associative array of detected types (IStructure::FIELD_*) in result set.

SqliteDriver::getTables() — Method in class SqliteDriver

Returns a list of all tables in the database.

SqliteDriver::getColumns() — Method in class SqliteDriver

Returns metadata for all columns in a table.

SqliteDriver::getIndexes() — Method in class SqliteDriver

Returns metadata for all indexes in a table.

SqliteDriver::getForeignKeys() — Method in class SqliteDriver

Returns metadata for all foreign keys in a table.

SqliteDriver::getColumnTypes() — Method in class SqliteDriver

Returns associative array of detected types (IStructure::FIELD_*) in result set.

SqlsrvDriver::getTables() — Method in class SqlsrvDriver

Returns a list of all tables in the database.

SqlsrvDriver::getColumns() — Method in class SqlsrvDriver

Returns metadata for all columns in a table.

SqlsrvDriver::getIndexes() — Method in class SqlsrvDriver

Returns metadata for all indexes in a table.

SqlsrvDriver::getForeignKeys() — Method in class SqlsrvDriver

Returns metadata for all foreign keys in a table.

SqlsrvDriver::getColumnTypes() — Method in class SqlsrvDriver

Returns associative array of detected types (IStructure::FIELD_*) in result set.

Explorer::getInsertId() — Method in class Explorer
Explorer::getConnection() — Method in class Explorer
Explorer::getStructure() — Method in class Explorer
Explorer::getConventions() — Method in class Explorer
IStructure::getTables() — Method in class IStructure

Returns all tables in the database.

IStructure::getColumns() — Method in class IStructure

Returns all columns in a table.

IStructure::getPrimaryKey() — Method in class IStructure

Returns table primary key.

IStructure::getPrimaryAutoincrementKey() — Method in class IStructure

Returns autoincrement primary key name.

IStructure::getPrimaryKeySequence() — Method in class IStructure

Returns table primary key sequence.

IStructure::getHasManyReference() — Method in class IStructure

Returns tables referencing the given table via foreign key, or null if unknown.

IStructure::getBelongsToReference() — Method in class IStructure

Returns foreign key columns in the given table mapped to their referenced tables, or null if unknown.

Reflection::getTables() — Method in class Reflection
Reflection::getTable() — Method in class Reflection

Returns table metadata.

Reflection::getDriver() — Method in class Reflection
Table::getColumn() — Method in class Table

Returns column object or throws exception if column doesn't exist.

ResultSet::getConnection() — Method in class ResultSet
ResultSet::getPdoStatement() — Method in class ResultSet
ResultSet::getQueryString() — Method in class ResultSet
ResultSet::getParameters() — Method in class ResultSet
ResultSet::getColumnCount() — Method in class ResultSet
ResultSet::getRowCount() — Method in class ResultSet
ResultSet::getColumnTypes() — Method in class ResultSet
ResultSet::getTime() — Method in class ResultSet
SqlLiteral::getSql() — Method in class SqlLiteral
SqlLiteral::getParameters() — Method in class SqlLiteral
Structure::getTables() — Method in class Structure
Structure::getColumns() — Method in class Structure

Returns all columns in a table.

Structure::getPrimaryKey() — Method in class Structure
Structure::getPrimaryAutoincrementKey() — Method in class Structure

Returns the name of the autoincrement primary key column, or null if none exists.

Structure::getPrimaryKeySequence() — Method in class Structure

Returns the sequence name for the primary key column, or null if not applicable.

Structure::getHasManyReference() — Method in class Structure
Structure::getBelongsToReference() — Method in class Structure
ActiveRow::getTable() — Method in class ActiveRow
ActiveRow::getExplorer() — Method in class ActiveRow
ActiveRow::getPrimary() — Method in class ActiveRow

Returns primary key value, or an array of values for composite primary keys.

ActiveRow::getSignature() — Method in class ActiveRow

Returns row signature (composition of primary keys).

ActiveRow::getIterator() — Method in class ActiveRow
GroupedSelection — Class in namespace Nette\Database\Table

Represents filtered table grouped by referencing table.

GroupedSelection::getRefTable() — Method in class GroupedSelection
$ Selection#globalRefCache — Property in class Selection

cache array of Selection and GroupedSelection prototypes

$ Selection#generalCacheKey — Property in class Selection
Selection::getName() — Method in class Selection
Selection::getPrimary() — Method in class Selection

Returns table primary key.

Selection::getPrimarySequence() — Method in class Selection
Selection::getSql() — Method in class Selection
Selection::getPreviousAccessedColumns() — Method in class Selection

Loads cache of previous accessed columns and returns it.

Selection::getSqlBuilder() — Method in class Selection
Selection::getExplorer() — Method in class Selection
Selection::get() — Method in class Selection

Returns row specified by primary key.

Selection::group() — Method in class Selection

Sets GROUP BY clause, more calls rewrite old value.

Selection::getRefTable() — Method in class Selection

Returns the root Selection used as the shared cache anchor for referenced rows.

Selection::getGeneralCacheKey() — Method in class Selection

Returns general cache key independent of query parameters or SQL limit.

Selection::getSpecificCacheKey() — Method in class Selection

Returns object-specific cache key dependent on query parameters.

Selection::getDataRefreshed() — Method in class Selection

Checks whether the selection re-queried for additional columns.

Selection::getReferencedTable() — Method in class Selection

Returns a referenced (parent) row for a belongs-to relationship.

Selection::getReferencingTable() — Method in class Selection

Returns a grouped selection of referencing (child) rows for a has-many relationship.

$ SqlBuilder#group — Property in class SqlBuilder
SqlBuilder::getTableName() — Method in class SqlBuilder
SqlBuilder::getSelectQueryHash() — Method in class SqlBuilder

Returns select query hash for caching.

SqlBuilder::getParameters() — Method in class SqlBuilder
SqlBuilder::getSelect() — Method in class SqlBuilder
SqlBuilder::getConditions() — Method in class SqlBuilder
SqlBuilder::getOrder() — Method in class SqlBuilder
SqlBuilder::getLimit() — Method in class SqlBuilder
SqlBuilder::getOffset() — Method in class SqlBuilder
SqlBuilder::getGroup() — Method in class SqlBuilder
SqlBuilder::getHaving() — Method in class SqlBuilder
SqlBuilder::getSortedJoins() — Method in class SqlBuilder

H

Helpers — Class in namespace Nette\Database

Database utility functions.

Reflection::hasTable() — Method in class Reflection
Selection::having() — Method in class Selection

Sets HAVING clause, more calls rewrite old value.

$ SqlBuilder#having — Property in class SqlBuilder

I

ConnectionPanel::initialize() — Method in class ConnectionPanel

Registers the panel with Tracy. Optionally adds it to the Tracy Bar.

Driver::isSupported() — Method in class Driver

Checks if the engine supports a specific feature.

Driver::initialize() — Method in class Driver

Initializes connection.

MsSqlDriver::initialize() — Method in class MsSqlDriver

Initializes connection.

MsSqlDriver::isSupported() — Method in class MsSqlDriver

Checks if the engine supports a specific feature.

MySqlDriver::initialize() — Method in class MySqlDriver

Driver options:

MySqlDriver::isSupported() — Method in class MySqlDriver

Checks if the engine supports a specific feature.

OciDriver::initialize() — Method in class OciDriver

Initializes connection.

OciDriver::isSupported() — Method in class OciDriver

Checks if the engine supports a specific feature.

OdbcDriver::initialize() — Method in class OdbcDriver

Initializes connection.

OdbcDriver::isSupported() — Method in class OdbcDriver

Checks if the engine supports a specific feature.

PgSqlDriver::initialize() — Method in class PgSqlDriver

Initializes connection.

PgSqlDriver::isSupported() — Method in class PgSqlDriver

Checks if the engine supports a specific feature.

SqliteDriver::initialize() — Method in class SqliteDriver

Initializes connection.

SqliteDriver::isSupported() — Method in class SqliteDriver

Checks if the engine supports a specific feature.

SqlsrvDriver::initialize() — Method in class SqlsrvDriver

Initializes connection.

SqlsrvDriver::isSupported() — Method in class SqlsrvDriver

Checks if the engine supports a specific feature.

Helpers::initializeTracy() — Method in class Helpers
IConventions — Class in namespace Nette\Database
IRow — Class in namespace Nette\Database
IRowContainer — Class in namespace Nette\Database
IStructure — Class in namespace Nette\Database

Provides cached reflection for database structure.

IStructure::isRebuilt() — Method in class IStructure

Checks whether the structure has been rebuilt from the database during this request.

ISupplementalDriver — Class in namespace Nette\Database
Index — Class in namespace Nette\Database\Reflection

Database table index.

$ Table#indexes — Property in class Table
$ Structure#isRebuilt — Property in class Structure
Structure::isRebuilt() — Method in class Structure

Checks whether the structure has been rebuilt from the database during this request.

GroupedSelection::insert() — Method in class GroupedSelection
IRow — Class in namespace Nette\Database\Table
IRowContainer — Class in namespace Nette\Database\Table
Selection::insert() — Method in class Selection

Inserts one or more rows into the table.

SqlBuilder::importConditions() — Method in class SqlBuilder

Copies WHERE conditions and aliases from another builder.

SqlBuilder::importGroupConditions() — Method in class SqlBuilder

Copies GROUP BY and HAVING clauses from another builder. Returns true if HAVING was present.

J

DateTime::jsonSerialize() — Method in class DateTime

Returns JSON representation in ISO 8601 (used by JavaScript).

Selection::joinWhere() — Method in class Selection

Adds ON condition when joining specified table, more calls appends with AND.

$ SqlBuilder#joinCondition — Property in class SqlBuilder

K

ResultSet::key() — Method in class ResultSet
$ Selection#keys — Property in class Selection
Selection::key() — Method in class Selection

L

DatabaseExtension::loadConfiguration() — Method in class DatabaseExtension
Connection::literal() — Method in class Connection

Creates SQL literal value.

Explorer::literal() — Method in class Explorer

Creates SQL literal value.

Helpers::loadFromFile() — Method in class Helpers

Imports SQL dump from file.

LockTimeoutException — Class in namespace Nette\Database

A lock wait exceeded the configured timeout. The statement was aborted, typically leaving the surrounding transaction alive.

Structure::loadStructure() — Method in class Structure

Loads complete structure from database.

GroupedSelection::loadRefCache() — Method in class GroupedSelection

Initializes the reference cache for the current selection. Overridden by GroupedSelection.

Selection::limit() — Method in class Selection

Sets LIMIT clause, more calls rewrite old values.

Selection::loadRefCache() — Method in class Selection

Initializes the reference cache for the current selection. Overridden by GroupedSelection.

$ SqlBuilder#limit — Property in class SqlBuilder

M

$ ConnectionPanel#maxQueries — Property in class ConnectionPanel
MsSqlDriver — Class in namespace Nette\Database\Drivers

Supplemental MS SQL database driver.

MySqlDriver — Class in namespace Nette\Database\Drivers

Supplemental MySQL database driver.

$ Helpers#maxLength — Property in class Helpers

maximum SQL length

Selection::min() — Method in class Selection

Returns minimum value from a column.

Selection::max() — Method in class Selection

Returns maximum value from a column.

N

$ ConnectionPanel#name — Property in class ConnectionPanel
Helpers::normalizeRow() — Method in class Helpers
NotNullConstraintViolationException — Class in namespace Nette\Database

The NOT NULL constraint check failed.

ResultSet::normalizeRow() — Method in class ResultSet
ResultSet::next() — Method in class ResultSet
Structure::needStructure() — Method in class Structure

Ensures the structure is loaded, from cache or from the database.

$ Selection#name — Property in class Selection

table name

Selection::next() — Method in class Selection

O

$ Connection#onConnect — Property in class Connection
$ Connection#onQuery — Property in class Connection
OciDriver — Class in namespace Nette\Database\Drivers

Supplemental Oracle database driver.

OdbcDriver — Class in namespace Nette\Database\Drivers

Supplemental ODBC database driver.

Row::offsetGet() — Method in class Row

Returns an item by key or numeric index.

Row::offsetExists() — Method in class Row

Checks if a key or numeric index exists.

ActiveRow::offsetSet() — Method in class ActiveRow
ActiveRow::offsetGet() — Method in class ActiveRow
ActiveRow::offsetExists() — Method in class ActiveRow
ActiveRow::offsetUnset() — Method in class ActiveRow
GroupedSelection::order() — Method in class GroupedSelection

Adds an ORDER BY clause. Automatically prepends the grouping column (matching direction) to improve index utilization.

$ Selection#observeCache — Property in class Selection
Selection::order() — Method in class Selection

Adds ORDER BY clause, more calls appends to the end.

Selection::offsetSet() — Method in class Selection

Sets a row by primary key.

Selection::offsetGet() — Method in class Selection

Returns specified row.

Selection::offsetExists() — Method in class Selection

Tests if row exists.

Selection::offsetUnset() — Method in class Selection

Removes row from result set.

$ SqlBuilder#order — Property in class SqlBuilder
$ SqlBuilder#offset — Property in class SqlBuilder

P

$ ConnectionPanel#performanceScale — Property in class ConnectionPanel
Connection::preprocess() — Method in class Connection

Preprocesses SQL query with parameter substitution and returns the resulting SQL and bound parameters.

$ DriverException#params — Property in class DriverException
PgSqlDriver — Class in namespace Nette\Database\Drivers

Supplemental PostgreSQL database driver.

Helpers::parseColumnType() — Method in class Helpers

Parses a SQL column type string into its components.

$ Table#primaryKey — Property in class Table
SqlPreprocessor::process() — Method in class SqlPreprocessor

Processes SQL query with parameter substitution.

$ Selection#primary — Property in class Selection
$ Selection#primarySequence — Property in class Selection

primary column sequence name, false for autodetection

$ Selection#previousAccessedColumns — Property in class Selection
Selection::page() — Method in class Selection

Sets LIMIT and OFFSET for the given page number. Optionally calculates total number of pages.

$ SqlBuilder#parameters — Property in class SqlBuilder
SqlBuilder::parseJoinConditions() — Method in class SqlBuilder
SqlBuilder::parseJoins() — Method in class SqlBuilder
SqlBuilder::parseJoinsCb() — Method in class SqlBuilder

Q

Connection::quote() — Method in class Connection

Quotes string for use in SQL.

Connection::query() — Method in class Connection

Generates and executes SQL query.

Connection::queryArgs() — Method in class Connection
$ DriverException#queryString — Property in class DriverException
Explorer::query() — Method in class Explorer

Generates and executes SQL query.

Explorer::queryArgs() — Method in class Explorer
Selection::query() — Method in class Selection

R

ConnectionPanel::renderException() — Method in class ConnectionPanel
Connection::reconnect() — Method in class Connection

Disconnects and connects to database again.

Connection::rollBack() — Method in class Connection

Rolls back current transaction.

Explorer::rollBack() — Method in class Explorer
IStructure::rebuild() — Method in class IStructure

Rebuilds database structure cache.

Reflection — Class in namespace Nette\Database

Provides database schema reflection.

ResultSet — Class in namespace Nette\Database

Represents a database result set.

ResultSet::rewind() — Method in class ResultSet
Row — Class in namespace Nette\Database

Represents a single database table row.

Structure::rebuild() — Method in class Structure

Rebuilds structure cache.

Structure::resolveFQTableName() — Method in class Structure

Returns normalized table name.

ActiveRow::ref() — Method in class ActiveRow

Returns referenced row, or null if the row does not exist.

ActiveRow::related() — Method in class ActiveRow

Returns referencing rows collection.

ActiveRow::removeAccessColumn() — Method in class ActiveRow
$ GroupedSelection#refCacheCurrent — Property in class GroupedSelection

current assigned referencing array

GroupedSelection::refreshData() — Method in class GroupedSelection

Invalidates cached data and forces reload on next access.

$ Selection#rows — Property in class Selection
$ Selection#refCache — Property in class Selection
Selection::removeAccessColumn() — Method in class Selection
Selection::rewind() — Method in class Selection
$ SqlBuilder#reservedTableNames — Property in class SqlBuilder
SqlBuilder::resetSelect() — Method in class SqlBuilder

S

Connection::setRowNormalizer() — Method in class Connection

Sets a callback for normalizing each result row (e.g., type conversion). Pass null to disable.

StaticConventions — Class in namespace Nette\Database\Conventions

Defines naming conventions for database structure using static patterns.

SqliteDriver — Class in namespace Nette\Database\Drivers

Supplemental SQLite3 database driver.

SqlsrvDriver — Class in namespace Nette\Database\Drivers

Supplemental SQL Server 2005 and later database driver.

SqlLiteral — Class in namespace Nette\Database

SQL literal that will not be escaped.

SqlPreprocessor — Class in namespace Nette\Database

Processes SQL queries with parameter substitution.

Structure — Class in namespace Nette\Database

Provides database structure metadata with caching.

$ Structure#structure — Property in class Structure
ActiveRow::setTable() — Method in class ActiveRow
GroupedSelection::setActive() — Method in class GroupedSelection

Sets active group.

GroupedSelection::select() — Method in class GroupedSelection

Adds a SELECT clause. Automatically prepends the grouping column if no select exists yet.

Selection — Class in namespace Nette\Database\Table

Represents filtered table result.

$ Selection#sqlBuilder — Property in class Selection
$ Selection#specificCacheKey — Property in class Selection
Selection::setPrimarySequence() — Method in class Selection
Selection::select() — Method in class Selection

Adds select clause, more calls append to the end.

Selection::sum() — Method in class Selection

Returns sum of values in a column.

Selection::saveCacheState() — Method in class Selection
SqlBuilder — Class in namespace Nette\Database\Table

Builds SQL queries for the Explorer layer.

$ SqlBuilder#select — Property in class SqlBuilder
SqlBuilder::setOrder() — Method in class SqlBuilder
SqlBuilder::setLimit() — Method in class SqlBuilder

Sets LIMIT/OFFSET clause.

SqlBuilder::setGroup() — Method in class SqlBuilder

Sets GROUP BY and HAVING clause.

SqlBuilder::setHaving() — Method in class SqlBuilder

T

Connection::transaction() — Method in class Connection

Executes callback inside a transaction. Supports nesting.

Explorer::transaction() — Method in class Explorer

Executes callback inside a transaction.

Explorer::table() — Method in class Explorer

Returns table selection.

$ Helpers#typePatterns — Property in class Helpers
Helpers::toPairs() — Method in class Helpers
$ Reflection#tables — Property in class Reflection
Table — Class in namespace Nette\Database\Reflection

Database table metadata including columns, indexes, and foreign keys.

ActiveRow::toArray() — Method in class ActiveRow
$ SqlBuilder#tableName — Property in class SqlBuilder
SqlBuilder::tryDelimite() — Method in class SqlBuilder

Delimits lowercase identifiers in a SQL fragment while leaving uppercase keywords untouched.

U

ActiveRow::update() — Method in class ActiveRow

Updates row data and refreshes the instance from database. Returns true if the row was changed.

GroupedSelection::update() — Method in class GroupedSelection

Updates all rows matching current conditions. JOINs in UPDATE are supported only by MySQL.

Selection::update() — Method in class Selection

Updates all rows matching current conditions. JOINs in UPDATE are supported only by MySQL.

UniqueConstraintViolationException — Class in namespace Nette\Database

The unique constraint check failed.

V

ResultSet::valid() — Method in class ResultSet
Selection::valid() — Method in class Selection

W

Selection::wherePrimary() — Method in class Selection

Adds condition for primary key.

Selection::where() — Method in class Selection

Adds where condition, more calls append with AND.

Selection::whereOr() — Method in class Selection

Adds where condition using the OR operator between parameters.

$ SqlBuilder#where — Property in class SqlBuilder

_

DatabaseExtension::__construct() — Method in class DatabaseExtension
ConnectionPanel::__construct() — Method in class ConnectionPanel
Connection::__construct() — Method in class Connection
DiscoveredConventions::__construct() — Method in class DiscoveredConventions
StaticConventions::__construct() — Method in class StaticConventions
DateTime::__toString() — Method in class DateTime

Returns the date and time in the format 'Y-m-d H:i:s.u'.

Explorer::__construct() — Method in class Explorer
Reflection::__construct() — Method in class Reflection
Reflection::__get() — Method in class Reflection
Column::__construct() — Method in class Column
Column::__toString() — Method in class Column
ForeignKey::__construct() — Method in class ForeignKey
ForeignKey::__toString() — Method in class ForeignKey
Index::__construct() — Method in class Index
Index::__toString() — Method in class Index
Table::__construct() — Method in class Table
Table::__get() — Method in class Table
Table::__toString() — Method in class Table
ResultSet::__construct() — Method in class ResultSet
Row::__get() — Method in class Row
Row::__isset() — Method in class Row
SqlLiteral::__construct() — Method in class SqlLiteral
SqlLiteral::__toString() — Method in class SqlLiteral
SqlPreprocessor::__construct() — Method in class SqlPreprocessor
Structure::__construct() — Method in class Structure
ActiveRow::__construct() — Method in class ActiveRow
ActiveRow::__toString() — Method in class ActiveRow
ActiveRow::__set() — Method in class ActiveRow
ActiveRow::__get() — Method in class ActiveRow

Returns column value, or a referenced row if the key matches a relationship.

ActiveRow::__isset() — Method in class ActiveRow
ActiveRow::__unset() — Method in class ActiveRow
GroupedSelection::__construct() — Method in class GroupedSelection

Creates filtered and grouped table representation.

Selection::__construct() — Method in class Selection

Creates filtered table representation.

Selection::__destruct() — Method in class Selection
Selection::__clone() — Method in class Selection
SqlBuilder::__construct() — Method in class SqlBuilder