{"id":21467464,"url":"https://github.com/elusivecodes/fyredb","last_synced_at":"2025-10-09T16:51:43.916Z","repository":{"id":58994014,"uuid":"418273653","full_name":"elusivecodes/FyreDB","owner":"elusivecodes","description":"FyreDB is a free, open-source database library for PHP.","archived":false,"fork":false,"pushed_at":"2024-11-15T10:35:02.000Z","size":453,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-30T13:38:25.754Z","etag":null,"topics":["database","mysql","php","postgres","sqlite"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elusivecodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-17T22:43:07.000Z","updated_at":"2024-11-15T10:34:55.000Z","dependencies_parsed_at":"2024-05-10T10:50:41.308Z","dependency_job_id":"fcebe677-812e-4c8b-a20e-7cbc4fdea9df","html_url":"https://github.com/elusivecodes/FyreDB","commit_stats":{"total_commits":41,"total_committers":2,"mean_commits":20.5,"dds":"0.024390243902439046","last_synced_commit":"4e2a256ccf8800d70485e4df26da379468c58f21"},"previous_names":[],"tags_count":64,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elusivecodes","download_url":"https://codeload.github.com/elusivecodes/FyreDB/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243982296,"owners_count":20378606,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","mysql","php","postgres","sqlite"],"created_at":"2024-11-23T08:18:12.689Z","updated_at":"2025-10-09T16:51:43.908Z","avatar_url":"https://github.com/elusivecodes.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FyreDB\r\n\r\n**FyreDB** is a free, open-source database library for *PHP*.\r\n\r\n\r\n## Table Of Contents\r\n- [Installation](#installation)\r\n- [Basic Usage](#basic-usage)\r\n- [Methods](#methods)\r\n- [Connections](#connections)\r\n    - [MySQL](#mysql)\r\n    - [Postgres](#postgres)\r\n    - [Sqlite](#sqlite)\r\n- [Queries](#queries)\r\n    - [Delete](#delete)\r\n    - [Insert](#insert)\r\n    - [Insert From](#insert-from)\r\n    - [Replace](#replace)\r\n    - [Select](#select)\r\n    - [Update](#update)\r\n    - [Update Batch](#update-batch)\r\n- [Results](#results)\r\n\r\n\r\n\r\n## Installation\r\n\r\n**Using Composer**\r\n\r\n```\r\ncomposer require fyre/db\r\n```\r\n\r\nIn PHP:\r\n\r\n```php\r\nuse Fyre\\DB\\ConnectionManager;\r\n```\r\n\r\n\r\n## Basic Usage\r\n\r\n- `$container` is a [*Container*](https://github.com/elusivecodes/FyreContainer).\r\n- `$config` is a [*Config*](https://github.com/elusivecodes/FyreConfig).\r\n\r\n```php\r\n$connectionManager = new ConnectionManager($container, $config);\r\n```\r\n\r\nDefault configuration options will be resolved from the \"*Database*\" key in the [*Config*](https://github.com/elusivecodes/FyreConfig).\r\n\r\n**Autoloading**\r\n\r\nIt is recommended to bind the *ConnectionManager* to the [*Container*](https://github.com/elusivecodes/FyreContainer) as a singleton.\r\n\r\n```php\r\n$container-\u003esingleton(ConnectionManager::class);\r\n```\r\n\r\nAny dependencies will be injected automatically when loading from the [*Container*](https://github.com/elusivecodes/FyreContainer).\r\n\r\n```php\r\n$connectionManager = $container-\u003euse(ConnectionManager::class);\r\n```\r\n\r\n\r\n## Methods\r\n\r\n**Build**\r\n\r\nBuild a [*Connection*](#connections).\r\n\r\n- `$options` is an array containing configuration options.\r\n\r\n```php\r\n$connection = $connectionManager-\u003ebuild($options);\r\n```\r\n\r\n[*Connection*](#connections) dependencies will be resolved automatically from the [*Container*](https://github.com/elusivecodes/FyreContainer).\r\n\r\n**Clear**\r\n\r\nClear and close connections.\r\n\r\n```php\r\n$connectionManager-\u003eclear();\r\n```\r\n\r\n**Get Config**\r\n\r\nSet a [*Connection*](#connections) config.\r\n\r\n- `$key` is a string representing the [*Connection*](#connections) key.\r\n\r\n```php\r\n$config = $connectionManager-\u003egetConfig($key);\r\n```\r\n\r\nAlternatively, if the `$key` argument is omitted an array containing all configurations will be returned.\r\n\r\n```php\r\n$config = $connectionManager-\u003egetConfig();\r\n```\r\n\r\n**Has Config**\r\n\r\nDetermine whether a [*Connection*](#connections) config exists.\r\n\r\n- `$key` is a string representing the [*Connection*](#connections) key, and will default to `ConnectionManager::DEFAULT`.\r\n\r\n```php\r\n$hasConfig = $connectionManager-\u003ehasConfig($key);\r\n```\r\n\r\n**Is Loaded**\r\n\r\nDetermine whether a [*Connection*](#connections) instance is loaded.\r\n\r\n- `$key` is a string representing the [*Connection*](#connections) key, and will default to `ConnectionManager::DEFAULT`.\r\n\r\n```php\r\n$isLoaded = $connectionManager-\u003eisLoaded($key);\r\n```\r\n\r\n**Set Config**\r\n\r\nSet the [*Connection*](#connections) config.\r\n\r\n- `$key` is a string representing the [*Connection*](#connections) key.\r\n- `$options` is an array containing configuration options.\r\n\r\n```php\r\n$connectionManager-\u003esetConfig($key, $options);\r\n```\r\n\r\n**Unload**\r\n\r\nUnload a [*Connection*](#connections).\r\n\r\n- `$key` is a string representing the [*Connection*](#connections) key, and will default to `ConnectionManager::DEFAULT`.\r\n\r\n```php\r\n$connectionManager-\u003eunload($key);\r\n```\r\n\r\n**Use**\r\n\r\nLoad a shared [*Connection*](#connections) instance.\r\n\r\n- `$key` is a string representing the [*Connection*](#connections) key, and will default to `ConnectionManager::DEFAULT`.\r\n\r\n```php\r\n$connection = $connectionManager-\u003euse($key);\r\n```\r\n\r\n[*Connection*](#connections) dependencies will be resolved automatically from the [*Container*](https://github.com/elusivecodes/FyreContainer).\r\n\r\n\r\n## Connections\r\n\r\nYou can load a specific connection handler by specifying the `className` option of the `$options` variable above.\r\n\r\nCustom connection handlers can be created by extending `\\Fyre\\DB\\Connection`, ensuring all below methods are implemented.\r\n\r\nCustom handlers should also implement a `generator` method that returns a new *QueryGenerator* (if required) and a `resultSetClass` static method that returns the class name to use for [results](#results).\r\n\r\n**Affected Rows**\r\n\r\nGet the number of affected rows.\r\n\r\n```php\r\n$affectedRows = $connection-\u003eaffectedRows();\r\n```\r\n\r\n**After Commit**\r\n\r\nQueue a callback to execute after the transaction is committed.\r\n\r\n- `$callback` is a *Closure*.\r\n- `$priority` is a number representing the callback priority, and will default to *1*.\r\n- `$key` is a string representing a unique identifier for the callback, and will default to *null*.\r\n\r\n```php\r\n$connection-\u003eafterCommit($callback, $priority, $key);\r\n```\r\n\r\nThe callback will be executed immediately if there is no active transaction.\r\n\r\n**Begin**\r\n\r\nBegin a transaction.\r\n\r\n```php\r\n$connection-\u003ebegin();\r\n```\r\n\r\n**Commit**\r\n\r\nCommit a transaction.\r\n\r\n```php\r\n$connection-\u003ecommit();\r\n```\r\n\r\n**Connect**\r\n\r\nConnect to the database.\r\n\r\n```php\r\n$connection-\u003econnect();\r\n```\r\n\r\nThis method is called automatically when the *Connection* is created.\r\n\r\n**Delete**\r\n\r\nCreate a [*DeleteQuery*](#delete).\r\n\r\n- `$alias` is a string or array containing the table aliases to delete, and will default to *null*.\r\n\r\n```php\r\n$query = $connection-\u003edelete($alias);\r\n```\r\n\r\n**Disable Foreign Keys**\r\n\r\nDisable foreign key checks.\r\n\r\n```php\r\n$connection-\u003edisableForeignKeys();\r\n```\r\n\r\n**Disable Query Logging**\r\n\r\nDisable query logging.\r\n\r\n```php\r\n$connection-\u003edisableQueryLogging();\r\n```\r\n\r\n**Disconnect**\r\n\r\nDisconnect from the database.\r\n\r\n```php\r\n$connection-\u003edisconnect();\r\n```\r\n\r\n**Enable Foreign Keys**\r\n\r\nEnable foreign key checks.\r\n\r\n```php\r\n$connection-\u003eenableForeignKeys();\r\n```\r\n\r\n**Enable Query Logging**\r\n\r\nEnable query logging.\r\n\r\n```php\r\n$connection-\u003eenableQueryLogging();\r\n```\r\n\r\n**Execute**\r\n\r\nExecute a SQL query with bound parameters.\r\n\r\n- `$sql` is a string representing the SQL query.\r\n- `$params` is an array containing the bound parameters.\r\n\r\n```php\r\n$result = $connection-\u003eexecute($sql, $params);\r\n```\r\n\r\nThe SQL query can use either *?* as a placeholder (for numerically indexed parameters), or the array key prefixed with *:*.\r\n\r\nThis method will return a [*ResultSet*](#results) for SELECT queries. Other query types will return a boolean value.\r\n\r\n**Get Charset**\r\n\r\nGet the connection character set.\r\n\r\n```php\r\n$charset = $connection-\u003egetCharset();\r\n```\r\n\r\n**Get Error**\r\n\r\nGet the last connection error.\r\n\r\n```php\r\n$error = $connection-\u003egetError();\r\n```\r\n\r\n**Get Savepoint Level**\r\n\r\nGet the transaction save point level.\r\n\r\n```php\r\n$savePointLevel = $connection-\u003egetSavePointLevel();\r\n```\r\n\r\n**In Transaction**\r\n\r\nDetermine whether a transaction is in progress.\r\n\r\n```php\r\n$inTransaction = $connection-\u003einTransaction();\r\n```\r\n\r\n**Insert**\r\n\r\nCreate an [*InsertQuery*](#insert).\r\n\r\n```php\r\n$query = $connection-\u003einsert();\r\n```\r\n\r\n**Insert From**\r\n\r\nCreate an [*InsertFromQuery*](#insert-from).\r\n\r\n- `$from` is a *Closure*, *SelectQuery*, *QueryLiteral* or string representing the query.\r\n- `$columns` is an array of column names.\r\n\r\n```php\r\n$query = $connection-\u003einsertFrom($from, $columns);\r\n```\r\n\r\n**Insert ID**\r\n\r\nGet the last inserted ID.\r\n\r\n```php\r\n$id = $connection-\u003einsertId();\r\n```\r\n\r\nWhen performing bulk inserts, this method will return the first ID for [*MySQL*](#mysql) connections, and the last ID for [*Postgres*](#postgres) and [*Sqlite*](#sqlite).\r\n\r\n**Literal**\r\n\r\nCreate a *QueryLiteral*.\r\n\r\n- `$string` is a string representing the literal string.\r\n\r\n```php\r\n$literal = $connection-\u003eliteral($string);\r\n```\r\n\r\n**Query**\r\n\r\nExecute a SQL query.\r\n\r\n- `$sql` is a string representing the SQL query.\r\n\r\n```php\r\n$result = $connection-\u003equery($sql);\r\n```\r\n\r\nThis method will return a [*ResultSet*](#results) for SELECT queries. Other query types will return a boolean value.\r\n\r\n**Quote**\r\n\r\nQuote a string for use in SQL queries.\r\n\r\n- `$value` is a string representing the value to quote.\r\n\r\n```php\r\n$quoted = $connection-\u003equote($value);\r\n```\r\n\r\n**Replace**\r\n\r\nCreate a [*ReplaceQuery*](#replace).\r\n\r\n```php\r\n$query = $connection-\u003ereplace();\r\n```\r\n\r\nThis method is only supported for queries using a *MysqlConnection* or *SqliteConnection*.\r\n\r\n**Rollback**\r\n\r\nRollback a transaction.\r\n\r\n```php\r\n$connection-\u003erollback();\r\n```\r\n\r\n**Select**\r\n\r\nCreate a [*SelectQuery*](#select).\r\n\r\n- `$fields` is an array or string representing the fields to select, and will default to \"*\".\r\n\r\n```php\r\n$query = $connection-\u003eselect($fields);\r\n```\r\n\r\nNon-numeric array keys will be used as field aliases.\r\n\r\nIf a *SelectQuery* or *QueryLiteral* is supplied as an array value they will be converted to a string and not escaped.\r\n\r\nA *Closure* can also be supplied as an array value, where the first argument will be the *Connection* and the second argument will be the *ValueBinder*.\r\n\r\n**Set Charset**\r\n\r\nSet the connection character set.\r\n\r\n- `$charset` is a string representing the connection character set.\r\n\r\n```php\r\n$connection-\u003esetCharset($charset);\r\n```\r\n\r\n**Transactional**\r\n\r\nExecute a callback inside a database transaction.\r\n\r\n- `$callback` is a *Closure* that will be executed inside the transaction.\r\n\r\n```php\r\n$result = $connection-\u003etransactional($callback);\r\n```\r\n\r\nIf the callback returns *false* or throws an *Exception* the transaction will be rolled back, otherwise it will be committed.\r\n\r\n**Truncate**\r\n\r\nTruncate a table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n\r\n```php\r\n$connection-\u003etruncate($tableName);\r\n```\r\n\r\n**Update**\r\n\r\nCreate an [*UpdateQuery*](#update).\r\n\r\n- `$table` is an array or string representing the table(s).\r\n\r\n```php\r\n$query = $connection-\u003eupdate($table);\r\n```\r\n\r\nNon-numeric array keys will be used as table aliases.\r\n\r\n**Update Batch**\r\n\r\nCreate an [*UpdateBatchQuery*](#update-batch).\r\n\r\n- `$table` is an array or string representing the table(s).\r\n\r\n```php\r\n$query = $connection-\u003eupdateBatch($table);\r\n```\r\n\r\nNon-numeric array keys will be used as table aliases.\r\n\r\n**Version**\r\n\r\nGet the server version.\r\n\r\n```php\r\n$version = $connection-\u003eversion();\r\n```\r\n\r\n\r\n### MySQL\r\n\r\nThe MySQL connection can be loaded using custom configuration.\r\n\r\n- `$options` is an array containing configuration options.\r\n    - `className` must be set to `\\Fyre\\DB\\Handlers\\Mysql\\MysqlConnection`.\r\n    - `host` is a string representing the MySQL host, and will default to \"*127.0.0.1*\".\r\n    - `username` is a string representing the MySQL username.\r\n    - `password` is a string representing the MySQL password.\r\n    - `database` is a string representing the MySQL database.\r\n    - `port` is a number indicating the MySQL port, and will default to *3306*.\r\n    - `collation` is a string representing the collation, and will default to \"*utf8mb4_unicode_ci*\".\r\n    - `charset` is a string representing the character set, and will default to \"*utf8mb4*\".\r\n    - `compress` is a boolean indicating whether to enable compression, and will default to *false*.\r\n    - `persist` is a boolean indicating whether to use a persistent connection, and will default to *false*.\r\n    - `timeout` is a number indicating the connection timeout.\r\n    - `ssl` is an array containing SSL options.\r\n        - `key` is a string representing the path to the key file.\r\n        - `cert` is a string representing the path to the certificate file.\r\n        - `ca` is a string representing the path to the certificate authority file.\r\n        - `capath` is a string representing the path to a directory containing CA certificates.\r\n        - `cipher` is a string representing a list of allowable ciphers to use for encryption.\r\n    - `flags` is an array containing PDO connection options.\r\n    - `log` is a boolean indicating whether to log queries, and will default to *false*.\r\n\r\n```php\r\n$container-\u003euse(Config::class)-\u003eset('Database.mysql', $options);\r\n```\r\n\r\n**Get Collation**\r\n\r\nGet the connection collation.\r\n\r\n```php\r\n$collation = $connection-\u003egetCollation();\r\n```\r\n\r\n### Postgres\r\n\r\nThe Postgres connection can be loaded using custom configuration.\r\n\r\n- `$options` is an array containing configuration options.\r\n    - `className` must be set to `\\Fyre\\DB\\Handlers\\Postgres\\PostgresConnection`.\r\n    - `host` is a string representing the Postgres host, and will default to \"*127.0.0.1*\".\r\n    - `username` is a string representing the Postgres username.\r\n    - `password` is a string representing the Postgres password.\r\n    - `database` is a string representing the Postgres database.\r\n    - `port` is a number indicating the Postgres port, and will default to *5432*.\r\n    - `charset` is a string representing the character set, and will default to \"*utf8*\".\r\n    - `schema` is a string representing the character set, and will default to \"*public*\".\r\n    - `persist` is a boolean indicating whether to use a persistent connection, and will default to *false*.\r\n    - `timeout` is a number indicating the connection timeout.\r\n    - `flags` is an array containing PDO connection options.\r\n    - `log` is a boolean indicating whether to log queries, and will default to *false*.\r\n\r\n```php\r\n$container-\u003euse(Config::class)-\u003eset('Database.postgres', $options);\r\n```\r\n\r\n**Set Schema**\r\n\r\nSet the connection schema.\r\n\r\n- `$schema` is a string representing the connection schema.\r\n\r\n```php\r\n$connection-\u003esetSchema($schema);\r\n```\r\n\r\n### Sqlite\r\n\r\nThe Sqlite connection can be loaded using custom configuration.\r\n\r\n- `$options` is an array containing configuration options.\r\n    - `className` must be set to `\\Fyre\\DB\\Handlers\\Sqlite\\SqliteConnection`.\r\n    - `database` is a string representing the Sqlite database file, and will default to \"*:memory:*\".\r\n    - `mask ` is a number indicating the database file permissions, and will default to 0644.\r\n    - `cache` is a string representing the cache flag.\r\n    - `mode` is a string representing the mode flag.\r\n    - `persist` is a boolean indicating whether to use a persistent connection, and will default to *false*.\r\n    - `flags` is an array containing PDO connection options.\r\n    - `log` is a boolean indicating whether to log queries, and will default to *false*.\r\n\r\n```php\r\n$container-\u003euse(Config::class)-\u003eset('Database.sqlite', $options);\r\n```\r\n\r\n\r\n## Queries\r\n\r\nThe `\\Fyre\\DB\\Query` class provides base methods related to building queries, and is extended by the query type classes below.\r\n\r\n**Execute**\r\n\r\nExecute the query.\r\n\r\n```php\r\n$result = $query-\u003eexecute();\r\n```\r\n\r\nThis method will return a [*ResultSet*](#results) for SELECT queries. Other query types will return a boolean value.\r\n\r\n**Connection**\r\n\r\nGet the [*Connection*](#connections).\r\n\r\n```php\r\n$connection = $query-\u003egetConnection();\r\n```\r\n\r\n**Get Table**\r\n\r\nGet the table(s).\r\n\r\n```php\r\n$table = $query-\u003egetTable();\r\n```\r\n\r\n**Sql**\r\n\r\nGenerate the SQL query.\r\n\r\n```php\r\n$sql = $query-\u003esql();\r\n```\r\n\r\n**Table**\r\n\r\nSet the table(s).\r\n\r\n- `$table` is an array or string representing the table(s).\r\n- `$overwrite` is a boolean indicating whether to overwrite existing tables, and will default to *false*.\r\n\r\n```php\r\n$query-\u003etable($table, $overwrite);\r\n```\r\n\r\nNon-numeric array keys will be used as table aliases.\r\n\r\nIf a *SelectQuery* or *QueryLiteral* is supplied as an array value they will be converted to a string and not escaped.\r\n\r\nA *Closure* can also be supplied as an array value, where the first argument will be the *Connection*.\r\n\r\n### Delete\r\n\r\nThe `\\Fyre\\DB\\Queries\\DeleteQuery` class extends the [*Query*](#queries) class, while providing additional methods for executing DELETE queries.\r\n\r\n```php\r\n$connection\r\n    -\u003edelete($alias)\r\n    -\u003efrom($table)\r\n    -\u003ewhere($conditions)\r\n    -\u003eexecute();\r\n```\r\n\r\nMultiple tables is only supported for queries using a *MysqlConnection*.\r\n\r\n**Alias**\r\n\r\nSet the delete alias(es).\r\n\r\n- `$alias` is a string or array containing the table aliases to delete, and will default to *null*.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing aliases, and will default to *false*.\r\n\r\n```php\r\n$query-\u003ealias($alias, $overwrite);\r\n```\r\n\r\nThis method is only supported for queries using a *MysqlConnection*.\r\n\r\n**Epilog**\r\n\r\nSet the epilog.\r\n\r\n- `$epilog` is a string representing the epilog for the query.\r\n\r\n```php\r\n$query-\u003eepilog($epilog);\r\n```\r\n\r\n**From**\r\n\r\nSet the FROM table(s).\r\n\r\n- `$table` is an array or string representing the table(s).\r\n- `$overwrite` is a boolean indicating whether to overwrite existing tables, and will default to *false*.\r\n\r\n```php\r\n$query-\u003efrom($table, $overwrite);\r\n```\r\n\r\nNon-numeric array keys will be used as table aliases.\r\n\r\n**Get Alias**\r\n\r\nGet the delete alias(es).\r\n\r\n```php\r\n$alias = $query-\u003egetAlias();\r\n```\r\n\r\n**Get Epilog**\r\n\r\nGet the epilog.\r\n\r\n```php\r\n$epilog = $query-\u003egetEpilog();\r\n```\r\n\r\n**Get From**\r\n\r\nGet the FROM table(s).\r\n\r\n```php\r\n$table = $query-\u003egetFrom();\r\n```\r\n\r\n**Get Join**\r\n\r\nGet the JOIN tables.\r\n\r\n```php\r\n$joins = $query-\u003egetJoin();\r\n```\r\n\r\n**Get Limit**\r\n\r\nGet the LIMIT clause.\r\n\r\n```php\r\n$limit = $query-\u003egetLimit();\r\n```\r\n\r\n**Get Order By**\r\n\r\nGet the ORDER BY fields.\r\n\r\n```php\r\n$orderBy = $query-\u003egetOrderBy();\r\n```\r\n\r\n**Get Using**\r\n\r\nGet the USING tables.\r\n\r\n```php\r\n$table = $query-\u003egetUsing();\r\n```\r\n\r\n**Get Where**\r\n\r\nGet the WHERE conditions.\r\n\r\n```php\r\n$conditions = $query-\u003egetWhere();\r\n```\r\n\r\n**Join**\r\n\r\nSet the JOIN tables.\r\n\r\n- `$joins` is a 2-dimensional array of joins.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing joins, and will default to *false*.\r\n\r\n```php\r\n$query-\u003ejoin($joins, $overwrite);\r\n```\r\n\r\nEach join array can contain a `table`, `alias`, `type` and an array of `conditions`. If the `type` is not specified it will default to INNER.\r\n\r\nThis method is only supported for queries using a *MysqlConnection*.\r\n\r\n**Limit**\r\n\r\nSet the LIMIT clause.\r\n\r\n- `$limit` is a number indicating the query limit.\r\n\r\n```php\r\n$query-\u003elimit($limit);\r\n```\r\n\r\n**Order By**\r\n\r\nSet the ORDER BY fields.\r\n\r\n- `$fields` is an array or string representing the fields to order by.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing fields, and will default to *false*.\r\n\r\n```php\r\n$query-\u003eorderBy($fields, $overwrite);\r\n```\r\n\r\n**Using**\r\n\r\nSet the USING tables.\r\n\r\n- `$table` is an array or string representing the using table(s).\r\n- `$overwrite` is a boolean indicating whether to overwrite existing using tables, and will default to *false*.\r\n\r\n```php\r\n$query-\u003eusing($table, $overwrite);\r\n```\r\n\r\nThis method is only supported for queries using a *PostgresConnection*.\r\n\r\n**Where**\r\n\r\nSet the WHERE conditions.\r\n\r\n- `$conditions` is an array or string representing the where conditions.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing conditions, and will default to *false*.\r\n\r\n```php\r\n$query-\u003ewhere($conditions, $overwrite);\r\n```\r\n\r\nArray conditions can contain:\r\n- Literal values with numeric keys.\r\n- Key/value pairs where the key is the field (and comparison operator) and the value(s) will be escaped.\r\n- Array values containing a group of conditions. These will be joined using the *AND* operator unless the array key is \"*OR*\" or \"*NOT*\".\r\n\r\nIf a *SelectQuery* or *QueryLiteral* is supplied as an array value they will be converted to a string and not escaped.\r\n\r\nA *Closure* can also be supplied as an array value, where the first argument will be the *Connection* and the second argument will be the *ValueBinder*.\r\n\r\n### Insert\r\n\r\nThe `\\Fyre\\DB\\Queries\\InsertQuery` class extends the [*Query*](#queries) class, while providing additional methods for executing INSERT queries.\r\n\r\n```php\r\n$connection\r\n    -\u003einsert()\r\n    -\u003einto($table)\r\n    -\u003evalues($values)\r\n    -\u003eexecute();\r\n```\r\n\r\n**Epilog**\r\n\r\nSet the epilog.\r\n\r\n- `$epilog` is a string representing the epilog for the query.\r\n\r\n```php\r\n$query-\u003eepilog($epilog);\r\n```\r\n\r\n**Get Epilog**\r\n\r\nGet the epilog.\r\n\r\n```php\r\n$epilog = $query-\u003egetEpilog();\r\n```\r\n\r\n**Get Into**\r\n\r\nGet the INTO table.\r\n\r\n```php\r\n$table = $query-\u003egetInto();\r\n```\r\n\r\n**Get Values**\r\n\r\nGet the REPLACE data.\r\n\r\n```php\r\n$values = $query-\u003egetValues();\r\n```\r\n\r\n**Into**\r\n\r\nSet the INTO table.\r\n\r\n- `$table` is a string representing the table.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing tables, and will default to *false*.\r\n\r\n```php\r\n$query-\u003einto($table, $overwrite);\r\n```\r\n\r\n**Values**\r\n\r\n- `$values` is a 2-dimensional array of values to insert.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing data, and will default to *false*.\r\n\r\n```php\r\n$query-\u003evalues($values, $overwrite);\r\n```\r\n\r\nArray keys will be used for the column names, and the values will be escaped automatically.\r\n\r\nIf a *SelectQuery* or *QueryLiteral* is supplied as an array value they will be converted to a string and not escaped.\r\n\r\nA *Closure* can also be supplied as an array value, where the first argument will be the *Connection* and the second argument will be the *ValueBinder*.\r\n\r\n### Insert From\r\n\r\nThe `\\Fyre\\DB\\Queries\\InsertFromQuery` class extends the [*Query*](#queries) class, while providing additional methods for executing INSERT queries from SELECT queries.\r\n\r\n```php\r\n$connection\r\n    -\u003einsertFrom($from, $columns)\r\n    -\u003einto($table)\r\n    -\u003eexecute();\r\n```\r\n\r\n**Epilog**\r\n\r\nSet the epilog.\r\n\r\n- `$epilog` is a string representing the epilog for the query.\r\n\r\n```php\r\n$query-\u003eepilog($epilog);\r\n```\r\n\r\n**Get Epilog**\r\n\r\nGet the epilog.\r\n\r\n```php\r\n$epilog = $query-\u003egetEpilog();\r\n```\r\n\r\n**Get Into**\r\n\r\nGet the INTO table.\r\n\r\n```php\r\n$table = $query-\u003egetInto();\r\n```\r\n\r\n**Into**\r\n\r\nSet the INTO table.\r\n\r\n- `$table` is a string representing the table.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing tables, and will default to *false*.\r\n\r\n```php\r\n$query-\u003einto($table, $overwrite);\r\n```\r\n\r\n### Replace\r\n\r\nThe `\\Fyre\\DB\\Queries\\ReplaceQuery` class extends the [*Query*](#queries) class, while providing additional methods for executing REPLACE queries.\r\n\r\n```php\r\n$connection\r\n    -\u003ereplace()\r\n    -\u003einto($table)\r\n    -\u003evalues($values)\r\n    -\u003eexecute();\r\n```\r\n\r\n**Epilog**\r\n\r\nSet the epilog.\r\n\r\n- `$epilog` is a string representing the epilog for the query.\r\n\r\n```php\r\n$query-\u003eepilog($epilog);\r\n```\r\n\r\n**Get Epilog**\r\n\r\nGet the epilog.\r\n\r\n```php\r\n$epilog = $query-\u003egetEpilog();\r\n```\r\n\r\n**Get Into**\r\n\r\nGet the INTO table.\r\n\r\n```php\r\n$table = $query-\u003egetInto();\r\n```\r\n\r\n**Get Values**\r\n\r\nGet the REPLACE data.\r\n\r\n```php\r\n$values = $query-\u003egetValues();\r\n```\r\n\r\n**Into**\r\n\r\nSet the INTO table.\r\n\r\n- `$table` is a string representing the table.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing tables, and will default to *false*.\r\n\r\n```php\r\n$query-\u003einto($table, $overwrite);\r\n```\r\n\r\n**Values**\r\n\r\n- `$values` is a 2-dimensional array of values to insert.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing data, and will default to *false*.\r\n\r\n```php\r\n$query-\u003evalues($values, $overwrite);\r\n```\r\n\r\nArray keys will be used for the column names, and the values will be escaped automatically.\r\n\r\nIf a *SelectQuery* or *QueryLiteral* is supplied as an array value they will be converted to a string and not escaped.\r\n\r\nA *Closure* can also be supplied as an array value, where the first argument will be the *Connection* and the second argument will be the *ValueBinder*.\r\n\r\n### Select\r\n\r\nThe `\\Fyre\\DB\\Queries\\SelectQuery` class extends the [*Query*](#queries) class, while providing additional methods for executing SELECT queries.\r\n\r\n```php\r\n$results = $connection\r\n    -\u003eselect($fields)\r\n    -\u003efrom($table)\r\n    -\u003ewhere($conditions)\r\n    -\u003eexecute();\r\n```\r\n\r\n**Distinct**\r\n\r\nSet the DISTINCT clause.\r\n\r\n- `$distinct` is a boolean indicating whether to set the query as DISTINCT, and will default to *true*.\r\n\r\n```php\r\n$query-\u003edistinct($distinct);\r\n```\r\n\r\n**Epilog**\r\n\r\nSet the epilog.\r\n\r\n- `$epilog` is a string representing the epilog for the query.\r\n\r\n```php\r\n$query-\u003eepilog($epilog);\r\n```\r\n\r\n**Except**\r\n\r\nAdd an EXCEPT query.\r\n\r\n- `$union` is a *Closure*, *SelectQuery*, *QueryLiteral* or string representing the query.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing unions, and will default to *false*.\r\n\r\n```php\r\n$query-\u003eexcept($union, $overwrite);\r\n```\r\n\r\n**From**\r\n\r\nSet the FROM table(s).\r\n\r\n- `$table` is an array or string representing the table(s).\r\n- `$overwrite` is a boolean indicating whether to overwrite existing tables, and will default to *false*.\r\n\r\n```php\r\n$query-\u003efrom($table, $overwrite);\r\n```\r\n\r\nNon-numeric array keys will be used as table aliases.\r\n\r\nIf a *SelectQuery* or *QueryLiteral* is supplied as an array value they will be converted to a string and not escaped.\r\n\r\nA *Closure* can also be supplied as an array value, where the first argument will be the *Connection*.\r\n\r\n**Get Distinct**\r\n\r\nGet the DISTINCT clause.\r\n\r\n```php\r\n$distinct = $query-\u003egetDistinct();\r\n```\r\n\r\n**Get Epilog**\r\n\r\nGet the epilog.\r\n\r\n```php\r\n$epilog = $query-\u003egetEpilog();\r\n```\r\n\r\n**Get Group By**\r\n\r\nGet the GROUP BY fields.\r\n\r\n```php\r\n$groupBy = $query-\u003egetGroupBy();\r\n```\r\n\r\n**Get From**\r\n\r\nGet the FROM table(s).\r\n\r\n```php\r\n$table = $query-\u003egetFrom();\r\n```\r\n\r\n**Get Having**\r\n\r\nGet the HAVING conditions.\r\n\r\n```php\r\n$having = $query-\u003egetHaving();\r\n```\r\n\r\n**Get Join**\r\n\r\nGet the JOIN tables.\r\n\r\n```php\r\n$joins = $query-\u003egetJoin();\r\n```\r\n\r\n**Get Limit**\r\n\r\nGet the LIMIT clause.\r\n\r\n```php\r\n$limit = $query-\u003egetLimit();\r\n```\r\n\r\n**Get Offset**\r\n\r\nGet the OFFSET clause.\r\n\r\n```php\r\n$offset = $query-\u003egetOffset();\r\n```\r\n\r\n**Get Order By**\r\n\r\nGet the ORDER BY fields.\r\n\r\n```php\r\n$orderBy = $query-\u003egetOrderBy();\r\n```\r\n\r\n**Get Select**\r\n\r\nGet the SELECT fields.\r\n\r\n```php\r\n$fields = $query-\u003egetSelect();\r\n```\r\n\r\n**Get Union**\r\n\r\nGet the UNION queries.\r\n\r\n```php\r\n$unions = $query-\u003egetUnion();\r\n```\r\n\r\n**Get Where**\r\n\r\nGet the WHERE conditions.\r\n\r\n```php\r\n$conditions = $query-\u003egetWhere();\r\n```\r\n\r\n**Get With**\r\n\r\nGet the WITH queries.\r\n\r\n```php\r\n$with = $query-\u003egetWith();\r\n```\r\n\r\n**Group By**\r\n\r\nSet the GROUP BY fields.\r\n\r\n- `$fields` is an array or string representing the fields to group by.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing fields, and will default to *false*.\r\n\r\n```php\r\n$query-\u003egroupBy($fields, $overwrite);\r\n```\r\n\r\n**Having**\r\n\r\nSet the HAVING conditions.\r\n\r\n- `$conditions` is an array or string representing the having conditions.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing conditions, and will default to *false*.\r\n\r\n```php\r\n$query-\u003ehaving($conditions, $overwrite);\r\n```\r\n\r\nArray conditions can contain:\r\n- Literal values with numeric keys.\r\n- Key/value pairs where the key is the field (and comparison operator) and the value(s) will be escaped automatically.\r\n- Array values containing a group of conditions. These will be joined using the *AND* operator unless the array key is \"*OR*\" or \"*NOT*\".\r\n\r\nIf a *SelectQuery* or *QueryLiteral* is supplied as an array value they will be converted to a string and not escaped.\r\n\r\nA *Closure* can also be supplied as an array value, where the first argument will be the *Connection* and the second argument will be the *ValueBinder*.\r\n\r\n**Intersect**\r\n\r\nAdd an INTERSECT query.\r\n\r\n- `$union` is a *Closure*, *SelectQuery*, *QueryLiteral* or string representing the query.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing unions, and will default to *false*.\r\n\r\n```php\r\n$query-\u003eintersect($union, $overwrite);\r\n```\r\n\r\n**Join**\r\n\r\nSet the JOIN tables.\r\n\r\n- `$joins` is a 2-dimensional array of joins.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing joins, and will default to *false*.\r\n\r\n```php\r\n$query-\u003ejoin($joins, $overwrite);\r\n```\r\n\r\nEach join array can contain a `table`, `alias`, `type` and an array of `conditions`. If the `type` is not specified it will default to INNER.\r\n\r\n**Limit**\r\n\r\nSet the LIMIT and OFFSET clauses.\r\n\r\n- `$limit` is a number indicating the query limit.\r\n- `$offset` is a number indicating the query offset.\r\n\r\n```php\r\n$query-\u003elimit($limit, $offset);\r\n```\r\n\r\n**Offset**\r\n\r\nSet the OFFSET clause.\r\n\r\n- `$offset` is a number indicating the query offset.\r\n\r\n```php\r\n$query-\u003eoffset($offset);\r\n```\r\n\r\n**Order By**\r\n\r\nSet the ORDER BY fields.\r\n\r\n- `$fields` is an array or string representing the fields to order by.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing fields, and will default to *false*.\r\n\r\n```php\r\n$query-\u003eorderBy($fields, $overwrite);\r\n```\r\n\r\n**Select**\r\n\r\nSet the SELECT fields.\r\n\r\n- `$fields` is an array or string representing the fields to select, and will default to \"*\".\r\n- `$overwrite` is a boolean indicating whether to overwrite existing fields, and will default to *false*.\r\n\r\n```php\r\n$query-\u003eselect($fields, $overwrite);\r\n```\r\n\r\nNon-numeric array keys will be used as field aliases.\r\n\r\nIf a *SelectQuery* or *QueryLiteral* is supplied as an array value they will be converted to a string and not escaped.\r\n\r\nA *Closure* can also be supplied as an array value, where the first argument will be the *Connection* and the second argument will be the *ValueBinder*.\r\n\r\n**Union**\r\n\r\nAdd a UNION DISTINCT query.\r\n\r\n- `$union` is a *Closure*, *SelectQuery*, *QueryLiteral* or string representing the query.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing unions, and will default to *false*.\r\n\r\n```php\r\n$query-\u003eunion($union, $overwrite);\r\n```\r\n\r\n**Union All**\r\n\r\nAdd a UNION ALL query.\r\n\r\n- `$union` is a *Closure*, *SelectQuery*, *QueryLiteral* or string representing the query.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing unions, and will default to *false*.\r\n\r\n```php\r\n$query-\u003eunionAll($union, $overwrite);\r\n```\r\n\r\n**Where**\r\n\r\nSet the WHERE conditions.\r\n\r\n- `$conditions` is an array or string representing the where conditions.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing conditions, and will default to *false*.\r\n\r\n```php\r\n$query-\u003ewhere($conditions, $overwrite);\r\n```\r\n\r\nArray conditions can contain:\r\n- Literal values with numeric keys.\r\n- Key/value pairs where the key is the field (and comparison operator) and the value(s) will be escaped.\r\n- Array values containing a group of conditions. These will be joined using the *AND* operator unless the array key is \"*OR*\" or \"*NOT*\".\r\n\r\nIf a *SelectQuery* or *QueryLiteral* is supplied as an array value they will be converted to a string and not escaped.\r\n\r\nA *Closure* can also be supplied as an array value, where the first argument will be the *Connection* and the second argument will be the *ValueBinder*.\r\n\r\n**With**\r\n\r\nSet the WITH clause.\r\n\r\n- `$with` is an array of common table expressions.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing expressions, and will default to *false*.\r\n\r\n```php\r\n$query-\u003ewith($with, $overwrite);\r\n```\r\n\r\nArray keys will be used as table aliases.\r\n\r\nIf a *SelectQuery* or *QueryLiteral* is supplied as an array value they will be converted to a string and not escaped.\r\n\r\nA *Closure* can also be supplied as an array value, where the first argument will be the *Connection*.\r\n\r\n**With Recursive**\r\n\r\nSet the WITH RECURSIVE clause.\r\n\r\n- `$with` is an array of common table expressions.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing expressions, and will default to *false*.\r\n\r\n```php\r\n$query-\u003ewithRecursive($with, $overwrite);\r\n```\r\n\r\nArray keys will be used as table aliases.\r\n\r\nIf a *SelectQuery* or *QueryLiteral* is supplied as an array value they will be converted to a string and not escaped.\r\n\r\nA *Closure* can also be supplied as an array value, where the first argument will be the *Connection*.\r\n\r\n### Update\r\n\r\nThe `\\Fyre\\DB\\Queries\\UpdateQuery` class extends the [*Query*](#queries) class, while providing additional methods for executing UPDATE queries.\r\n\r\n```php\r\n$connection\r\n    -\u003eupdate($table)\r\n    -\u003eset($data)\r\n    -\u003ewhere($conditions)\r\n    -\u003eexecute();\r\n```\r\n\r\nMultiple tables is only supported for queries using a *MysqlConnection*.\r\n\r\n**Epilog**\r\n\r\nSet the epilog.\r\n\r\n- `$epilog` is a string representing the epilog for the query.\r\n\r\n```php\r\n$query-\u003eepilog($epilog);\r\n```\r\n\r\n**From**\r\n\r\nSet the FROM tables.\r\n\r\n- `$table` is an array or string representing the from table(s).\r\n- `$overwrite` is a boolean indicating whether to overwrite existing from tables, and will default to *false*.\r\n\r\n```php\r\n$query-\u003efrom($table, $overwrite);\r\n```\r\n\r\nThis method is only supported for queries using a *PostgresConnection* or *SqliteConnection*.\r\n\r\n**Get Data**\r\n\r\nGet the UPDATE data.\r\n\r\n```php\r\n$data = $query-\u003egetData();\r\n```\r\n\r\n**Get Epilog**\r\n\r\nGet the epilog.\r\n\r\n```php\r\n$epilog = $query-\u003egetEpilog();\r\n```\r\n\r\n**Get From**\r\n\r\nGet the FROM table(s).\r\n\r\n```php\r\n$table = $query-\u003egetFrom();\r\n```\r\n\r\n**Get Join**\r\n\r\nGet the JOIN tables.\r\n\r\n```php\r\n$joins = $query-\u003egetJoin();\r\n```\r\n\r\n**Get Where**\r\n\r\nGet the WHERE conditions.\r\n\r\n```php\r\n$conditions = $query-\u003egetWhere();\r\n```\r\n\r\n**Join**\r\n\r\nSet the JOIN tables.\r\n\r\n- `$joins` is a 2-dimensional array of joins.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing joins, and will default to *false*.\r\n\r\n```php\r\n$query-\u003ejoin($joins, $overwrite);\r\n```\r\n\r\nEach join array can contain a `table`, `alias`, `type` and an array of `conditions`. If the `type` is not specified it will default to INNER.\r\n\r\nThis method is only supported for queries using a *MysqlConnection*.\r\n\r\n**Set**\r\n\r\n- `$data` is an array of values to update.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing data, and will default to *false*.\r\n\r\n```php\r\n$query-\u003eset($data, $overwrite);\r\n```\r\n\r\nArray keys will be used for the column names, and the values will be escaped automatically.\r\n\r\nIf a *SelectQuery* or *QueryLiteral* is supplied as an array value they will be converted to a string and not escaped.\r\n\r\nA *Closure* can also be supplied as an array value, where the first argument will be the *Connection* and the second argument will be the *ValueBinder*.\r\n\r\n**Where**\r\n\r\nSet the WHERE conditions.\r\n\r\n- `$conditions` is an array or string representing the where conditions.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing conditions, and will default to *false*.\r\n\r\n```php\r\n$query-\u003ewhere($conditions, $overwrite);\r\n```\r\n\r\nArray conditions can contain:\r\n- Literal values with numeric keys.\r\n- Key/value pairs where the key is the field (and comparison operator) and the value(s) will be escaped.\r\n- Array values containing a group of conditions. These will be joined using the *AND* operator unless the array key is \"*OR*\" or \"*NOT*\".\r\n\r\nIf a *SelectQuery* or *QueryLiteral* is supplied as an array value they will be converted to a string and not escaped.\r\n\r\nA *Closure* can also be supplied as an array value, where the first argument will be the *Connection* and the second argument will be the *ValueBinder*.\r\n\r\n### Update Batch\r\n\r\nThe `\\Fyre\\DB\\Queries\\UpdateBatchQuery` class extends the [*Query*](#queries) class, while providing additional methods for executing batch UPDATE queries.\r\n\r\n```php\r\n$connection\r\n    -\u003eupdateBatch($table)\r\n    -\u003eset($data, $keys)\r\n    -\u003eexecute();\r\n```\r\n\r\n**Epilog**\r\n\r\nSet the epilog.\r\n\r\n- `$epilog` is a string representing the epilog for the query.\r\n\r\n```php\r\n$query-\u003eepilog($epilog);\r\n```\r\n\r\n**Get Data**\r\n\r\nGet the UPDATE data.\r\n\r\n```php\r\n$data = $query-\u003egetData();\r\n```\r\n\r\n**Get Epilog**\r\n\r\nGet the epilog.\r\n\r\n```php\r\n$epilog = $query-\u003egetEpilog();\r\n```\r\n\r\n**Set**\r\n\r\n- `$data` is a 2-dimensional array of values to update.\r\n- `$keys` is a string or array containing the keys to use for updating.\r\n- `$overwrite` is a boolean indicating whether to overwrite existing data, and will default to *false*.\r\n\r\n```php\r\n$query-\u003eset($data, $keys, $overwrite);\r\n```\r\n\r\nArray keys will be used for the column names, and the values will be escaped automatically.\r\n\r\nIf a *SelectQuery* or *QueryLiteral* is supplied as an array value they will be converted to a string and not escaped.\r\n\r\nA *Closure* can also be supplied as an array value, where the first argument will be the *Connection* and the second argument will be the *ValueBinder*.\r\n\r\n\r\n## Results\r\n\r\nSELECT queries will return a new *ResultSet* containing the results of the query.\r\n\r\nThe *ResultSet* is an implementation of an *Iterator* and can be used in a *foreach* loop.\r\n\r\n```php\r\nforeach ($result AS $row) { }\r\n```\r\n\r\n**All**\r\n\r\nGet the results as an array.\r\n\r\n```php\r\n$array = $result-\u003eall();\r\n```\r\n\r\n**Clear Buffer**\r\n\r\nClear the results from the buffer.\r\n\r\n- `$index` is a number representing the index of the result to clear.\r\n\r\n```php\r\n$result-\u003eclearBuffer($index);\r\n```\r\n\r\nAlternatively, if the `$index` argument is omitted, the entire buffer will be cleared.\r\n\r\n```php\r\n$result-\u003eclearBuffer();\r\n```\r\n\r\n**Column Count**\r\n\r\nGet the column count.\r\n\r\n```php\r\n$columnCount = $result-\u003ecolumnCount();\r\n```\r\n\r\n**Columns**\r\n\r\nGet the result columns.\r\n\r\n```php\r\n$columns = $result-\u003ecolumns();\r\n```\r\n\r\n**Count**\r\n\r\nGet the result count.\r\n\r\n```php\r\n$count = $result-\u003ecount();\r\n```\r\n\r\n**Fetch**\r\n\r\nGet a result by index.\r\n\r\n- `$index` is a number indicating the row index.\r\n\r\n```php\r\n$row = $result-\u003efetch($index);\r\n```\r\n\r\n**First**\r\n\r\nGet the first result.\r\n\r\n```php\r\n$first = $result-\u003efirst();\r\n```\r\n\r\n**Free**\r\n\r\nFree the result from memory.\r\n\r\n```php\r\n$result-\u003efree();\r\n```\r\n\r\n**Get Type**\r\n\r\nGet the [*Type*](https://github.com/elusivecodes/FyreTypeParser#types) for a column.\r\n\r\n- `$name` is a string representing the column name.\r\n\r\n```php\r\n$parser = $result-\u003egetType($name);\r\n```\r\n\r\n**Last**\r\n\r\nGet the last result.\r\n\r\n```php\r\n$last = $result-\u003elast();\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felusivecodes%2Ffyredb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felusivecodes%2Ffyredb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felusivecodes%2Ffyredb/lists"}