{"id":18893240,"url":"https://github.com/elusivecodes/fyreforge","last_synced_at":"2026-03-11T12:22:20.427Z","repository":{"id":62551364,"uuid":"502550724","full_name":"elusivecodes/FyreForge","owner":"elusivecodes","description":"FyreForge is a free, open-source database forge library for PHP.","archived":false,"fork":false,"pushed_at":"2025-04-12T01:25:19.000Z","size":231,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T01:48:04.948Z","etag":null,"topics":["database","forge","php","schema"],"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":"2022-06-12T07:42:26.000Z","updated_at":"2025-04-12T01:25:03.000Z","dependencies_parsed_at":"2025-03-23T14:15:17.126Z","dependency_job_id":null,"html_url":"https://github.com/elusivecodes/FyreForge","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreForge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreForge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreForge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreForge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elusivecodes","download_url":"https://codeload.github.com/elusivecodes/FyreForge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248984315,"owners_count":21193723,"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","forge","php","schema"],"created_at":"2024-11-08T08:12:39.636Z","updated_at":"2026-03-11T12:22:20.418Z","avatar_url":"https://github.com/elusivecodes.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FyreForge\r\n\r\n**FyreForge** is a free, open-source database forge 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- [Forges](#forges)\r\n    - [MySQL Forges](#mysql-forges)\r\n    - [Postgres Forges](#postgres-forges)\r\n    - [Sqlite Forges](#sqlite-forges)\r\n- [Table](#tables)\r\n    - [MySQL Tables](#mysql-tables)\r\n    - [Postgres Tables](#postgres-tables)\r\n    - [Sqlite Tables](#sqlite-tables)\r\n- [Columns](#columns)\r\n    - [MySQL Columns](#mysql-columns)\r\n- [Indexes](#indexes)\r\n- [Foreign Keys](#foreign-keys)\r\n\r\n\r\n\r\n## Installation\r\n\r\n**Using Composer**\r\n\r\n```\r\ncomposer require fyre/forge\r\n```\r\n\r\nIn PHP:\r\n\r\n```php\r\nuse Fyre\\Forge\\ForgeRegistry;\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\r\n```php\r\n$forgeRegistry = new ForgeRegistry($container);\r\n```\r\n\r\n**Autoloading**\r\n\r\nIt is recommended to bind the *ForgeRegistry* to the [*Container*](https://github.com/elusivecodes/FyreContainer) as a singleton.\r\n\r\n```php\r\n$container-\u003esingleton(ForgeRegistry::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$forgeRegistry = $container-\u003euse(ForgeRegistry::class);\r\n```\r\n\r\n\r\n## Methods\r\n\r\n**Map**\r\n\r\nMap a [*Connection*](https://github.com/elusivecodes/FyreDB#connections) class to a [*Forge*](#forges) handler.\r\n\r\n- `$connectionClass` is a string representing the [*Connection*](https://github.com/elusivecodes/FyreDB#connections) class name.\r\n- `$forgeClass` is a string representing the [*Forge*](#forges) class name.\r\n\r\n```php\r\n$forgeRegistry-\u003emap($connectionClass, $forgeClass);\r\n```\r\n\r\n**Use**\r\n\r\nLoad the shared [*Forge*](#forges) for a [*Connection*](https://github.com/elusivecodes/FyreDB#connections).\r\n\r\n- `$connection` is a [*Connection*](https://github.com/elusivecodes/FyreDB#connections).\r\n\r\n```php\r\n$forge = $forgeRegistry-\u003euse($connection);\r\n```\r\n\r\n[*Forge*](#forges) dependencies will be resolved automatically from the [*Container*](https://github.com/elusivecodes/FyreContainer).\r\n\r\n\r\n## Forges\r\n\r\n**Add Column**\r\n\r\nAdd a column to a table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$columnName` is a string representing the column name.\r\n- `$options` is an array containing the column options.\r\n    - `type` is a string representing the column type, and will default to `StringType::class`.\r\n    - `length` is a number representing the column length, and will default to the type default.\r\n    - `precision` is a number representing the column precision, and will default to the type default.\r\n    - `nullable` is a boolean indicating whether the column is nullable, and will default to *false*.\r\n    - `default` is a string representing the column default value, and will default to *null* (no default).\r\n    - `autoIncrement` is a boolean indicating whether the column is an an auto incrementing column, and will default to *false*.\r\n\r\n```php\r\n$forge-\u003eaddColumn($tableName, $columnName, $options);\r\n```\r\n\r\nYou can also specify a [*Type*](https://github.com/elusivecodes/FyreTypeParser#types) class name as the `type`, which will be automatically mapped to the correct type.\r\n\r\nAdditional column options may be available depending on the connection handler.\r\n\r\n**Add Foreign Key**\r\n\r\nAdd a foreign key to a table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$foreignKeyName` is a string representing the foreign key name.\r\n- `$options` is an array containing the foreign key options.\r\n    - `columns` is a string or array containing the columns to use for the foreign key, and will default to the foreign key name.\r\n    - `referencedTable` is a string representing the referenced table to use.\r\n    - `referencedColumns` is a string or array containing the columns to use in the referenced table.\r\n    - `onUpdate` is a string containing the ON UPDATE operation, and will default to *null*.\r\n    - `onDelete` is a string containing the ON DELETE operation, and will default to *null*.\r\n\r\n```php\r\n$forge-\u003eaddForeignKey($tableName, $foreignKeyName, $options);\r\n```\r\n\r\nForeign keys cannot be added to an existing Sqlite table.\r\n\r\n**Add Index**\r\n\r\nAdd an index to a table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$indexName` is a string representing the index name.\r\n- `$options` is an array containing the index options.\r\n    - `columns` is a string or array containing the columns to use for the index, and will default to the index name.\r\n    - `unique` is a boolean indicating whether the index must be unique, and will default to *false*.\r\n    - `primary` is a boolean indicating whether the index is a primary key, and will default to *false*.\r\n\r\n```php\r\n$forge-\u003eaddIndex($tableName, $indexName, $options);\r\n```\r\n\r\nAdditional index options may be available depending on the connection handler.\r\n\r\nPrimary keys cannot be added to an existing Sqlite table.\r\n\r\n**Alter Table**\r\n\r\nAlter a table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$options` is an array containing the table options.\r\n\r\n```php\r\n$forge-\u003ealterTable($tableName, $options);\r\n```\r\n\r\nAdditional table options may be available depending on the connection handler.\r\n\r\n**Build**\r\n\r\nBuild a [*Table*](#tables).\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$options` is an array containing the table options.\r\n\r\n```php\r\n$table = $forge-\u003ebuild($tableName, $options);\r\n```\r\n\r\n[*Table*](#tables) dependencies will be resolved automatically from the Container.\r\n\r\nAdditional table options may be available depending on the connection handler.\r\n\r\n**Create Table**\r\n\r\nCreate a new table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$columns` is an array containing the column definitions.\r\n- `$indexes` is an array containing the index definitions.\r\n- `$foreignKeys` is an array containing the foreign key definitions.\r\n- `$options` is an array containing the schema options.\r\n\r\n```php\r\n$forge-\u003ecreateTable($tableName, $columns, $indexes, $foreignKeys, $options);\r\n```\r\n\r\nAdditional table options may be available depending on the connection handler.\r\n\r\n**Drop Column**\r\n\r\nDrop a column from a table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$columnName` is a string representing the column name.\r\n\r\n```php\r\n$forge-\u003edropColumn($tableName, $columnName);\r\n```\r\n\r\n**Drop Foreign Key**\r\n\r\nDrop a foreign key from a table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$foreignKeyName` is a string representing the foreign key name.\r\n\r\n```php\r\n$forge-\u003edropForeignKey($tableName, $foreignKeyName);\r\n```\r\n\r\nForeign keys cannot be dropped from an existing Sqlite table.\r\n\r\n**Drop Index**\r\n\r\nDrop an index from a table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$indexName` is a string representing the index name.\r\n\r\n```php\r\n$forge-\u003edropIndex($tableName, $indexName);\r\n```\r\n\r\nPrimary keys cannot be dropped from an existing Sqlite table.\r\n\r\n**Drop Table**\r\n\r\nDrop a table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n\r\n```php\r\n$forge-\u003edropTable($tableName, $options);\r\n```\r\n\r\n**Get Connection**\r\n\r\nGet the [*Connection*](https://github.com/elusivecodes/FyreDB#connections).\r\n\r\n```php\r\n$connection = $forge-\u003egetConnection();\r\n```\r\n\r\n**Rename Column**\r\n\r\nRename a column.\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$columnName` is a string representing the column name.\r\n- `$newColumnName` is a string representing the new column name.\r\n\r\n```php\r\n$forge-\u003erenameColumn($tableName, $columnName, $newColumnName);\r\n```\r\n\r\n**Rename Table**\r\n\r\nRename a table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$newTableName` is a string representing the new table name.\r\n\r\n```php\r\n$forge-\u003erenameTable($tableName, $newTableName);\r\n```\r\n\r\n### MySQL Forges\r\n\r\nThe [*MySQL*](https://github.com/elusivecodes/FyreDB#MySQL) Forge extends the *Forge* class and provides additional methods and options specific to MySQL databases.\r\n\r\n**Add Column**\r\n\r\nAdd a column to a table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$columnName` is a string representing the column name.\r\n- `$options` is an array containing the column options.\r\n    - `type` is a string representing the column type, and will default to `StringType::class`.\r\n    - `length` is a number representing the column length, and will default to the type default.\r\n    - `precision` is a number representing the column precision, and will default to the type default.\r\n    - `values` is an array containing the enum/set values, and will default to *null*.\r\n    - `nullable` is a boolean indicating whether the column is nullable, and will default to *false*.\r\n    - `unsigned` is a boolean indicating whether the column is unsigned, and will default to *false*.\r\n    - `default` is a string representing the column default value, and will default to *null* (no default).\r\n    - `charset` is a string representing the column character set, and will default to the connection character set.\r\n    - `collation` is a string representing the column collation, and will default to the connection collation.\r\n    - `autoIncrement` is a boolean indicating whether the column is an an auto incrementing column, and will default to *false*.\r\n    - `comment` is a string representing the column comment, and will default to \"\".\r\n    - `after` is a string representing the column to add this column after, and will default to *null*.\r\n    - `first` is a boolean indicating whether to add this column first in the table, and will default to *false*.\r\n\r\n```php\r\n$forge-\u003eaddColumn($tableName, $columnName, $options);\r\n```\r\n\r\nYou can also specify a [*Type*](https://github.com/elusivecodes/FyreTypeParser#types) class name as the `type`, which will be automatically mapped to the correct type.\r\n\r\n**Add Index**\r\n\r\nAdd an index to a table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$indexName` is a string representing the index name.\r\n- `$options` is an array containing the index options.\r\n    - `columns` is a string or array containing the columns to use for the index, and will default to the index name.\r\n    - `type` is a string representing the index type, and will default to \"*BTREE*\".\r\n    - `unique` is a boolean indicating whether the index must be unique, and will default to *false*.\r\n    - `primary` is a boolean indicating whether the index is a primary key, and will default to *false*.\r\n\r\n```php\r\n$forge-\u003eaddIndex($tableName, $indexName, $options);\r\n```\r\n\r\n**Alter Table**\r\n\r\nAlter a table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$options` is an array containing the table options.\r\n    - `engine` is a string representing the table engine, and will default to \"*InnoDB*\".\r\n    - `charset` is a string representing the table character set, and will default to the connection character set.\r\n    - `collation` is a string representing the table collation, and will default to the connection collation.\r\n    - `comment` is a string representing the table comment, and will default to \"\".\r\n\r\n```php\r\n$forge-\u003ealterTable($tableName, $options);\r\n```\r\n\r\n**Build**\r\n\r\nBuild a [*Table*](#tables).\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$options` is an array containing the table options.\r\n    - `engine` is a string representing the table engine, and will default to \"*InnoDB*\".\r\n    - `charset` is a string representing the table character set, and will default to the connection character set.\r\n    - `collation` is a string representing the table collation, and will default to the connection collation.\r\n    - `comment` is a string representing the table comment, and will default to \"\".\r\n\r\n```php\r\n$table = $forge-\u003ebuild($tableName, $options);\r\n```\r\n\r\n[*Table*](#tables) dependencies will be resolved automatically from the Container.\r\n\r\n**Change Column**\r\n\r\nChange a table column.\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$columnName` is a string representing the column name.\r\n- `$options` is an array containing the column options.\r\n    - `name` is a string representing the new column name.\r\n    - `type` is a string representing the column type.\r\n    - `length` is a number representing the column length.\r\n    - `precision` is a number representing the column precision.\r\n    - `values` is an array containing the enum/set values.\r\n    - `nullable` is a boolean indicating whether the column is nullable.\r\n    - `unsigned` is a boolean indicating whether the column is unsigned.\r\n    - `default` is a string representing the column default value.\r\n    - `charset` is a string representing the column character set.\r\n    - `collation` is a string representing the column collation.\r\n    - `autoIncrement` is a boolean indicating whether the column is an an auto incrementing column.\r\n    - `comment` is a string representing the column comment.\r\n    - `after` is a string representing the column to add this column after.\r\n    - `first` is a boolean indicating whether to add this column first in the table.\r\n\r\n```php\r\n$forge-\u003echangeColumn($tableName, $columnName, $options);\r\n```\r\n\r\nYou can also specify a [*Type*](https://github.com/elusivecodes/FyreTypeParser#types) class name as the `type`, which will be automatically mapped to the correct type.\r\n\r\nUnspecified options will default to the current value.\r\n\r\n**Create Schema**\r\n\r\nCreate a new schema.\r\n\r\n- `$schema` is a string representing the schema name.\r\n- `$options` is an array containing the schema options.\r\n    - `charset` is a string representing the schema character set, and will default to the connection character set.\r\n    - `collation` is a string representing the schema collation, and will default to the connection collation.\r\n    - `ifNotExists` is a boolean indicating whether to use an `IF NOT EXISTS` clause, and will default to *false*.\r\n\r\n```php\r\n$forge-\u003ecreateSchema($schema, $options);\r\n```\r\n\r\n**Create Table**\r\n\r\nCreate a new table.\r\n\r\n- `$table` is a string representing the table name.\r\n- `$columns` is an array containing the column definitions.\r\n- `$indexes` is an array containing the index definitions.\r\n- `$foreignKeys` is an array containing the foreign key definitions.\r\n- `$options` is an array containing the schema options.\r\n    - `engine` is a string representing the table engine, and will default to \"*InnoDB*\".\r\n    - `charset` is a string representing the table character set, and will default to the connection character set.\r\n    - `collation` is a string representing the table collation, and will default to the connection collation.\r\n    - `comment` is a string representing the table comment, and will default to \"\".\r\n\r\n```php\r\n$forge-\u003ecreateTable($table, $columns, $indexes, $foreignKeys, $options);\r\n```\r\n\r\n**Drop Primary Key**\r\n\r\nDrop a primary key from a table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n\r\n```php\r\n$forge-\u003edropPrimaryKey($tableName);\r\n```\r\n\r\n**Drop Schema**\r\n\r\nDrop a schema.\r\n\r\n- `$schema` is a string representing the schema name.\r\n- `$options` is an array containing the schema options.\r\n    - `ifExists` is a boolean indicating whether to use an `IF EXISTS` clause, and will default to *false*.\r\n\r\n```php\r\n$forge-\u003edropSchema($schema, $options);\r\n```\r\n\r\n### Postgres\r\n\r\nThe [*Postgres*](https://github.com/elusivecodes/FyreDB#Postgres) Forge extends the *Forge* class and provides additional methods and options specific to Postgres databases.\r\n\r\n**Add Column**\r\n\r\nAdd a column to a table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$columnName` is a string representing the column name.\r\n- `$options` is an array containing the column options.\r\n    - `type` is a string representing the column type, and will default to `StringType::class`.\r\n    - `length` is a number representing the column length, and will default to the type default.\r\n    - `precision` is a number representing the column precision, and will default to the type default.\r\n    - `nullable` is a boolean indicating whether the column is nullable, and will default to *false*.\r\n    - `default` is a string representing the column default value, and will default to *null* (no default).\r\n    - `autoIncrement` is a boolean indicating whether the column is an an auto incrementing column, and will default to *false*.\r\n    - `comment` is a string representing the column comment, and will default to \"\".\r\n\r\n```php\r\n$forge-\u003eaddColumn($tableName, $columnName, $options);\r\n```\r\n\r\nYou can also specify a [*Type*](https://github.com/elusivecodes/FyreTypeParser#types) class name as the `type`, which will be automatically mapped to the correct type.\r\n\r\n**Alter Table**\r\n\r\nAlter a table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$options` is an array containing the table options.\r\n    - `comment` is a string representing the table comment, and will default to \"\".\r\n\r\n```php\r\n$forge-\u003ealterTable($tableName, $options);\r\n```\r\n\r\n**Build**\r\n\r\nBuild a [*Table*](#tables).\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$options` is an array containing the table options.\r\n    - `comment` is a string representing the table comment, and will default to \"\".\r\n\r\n```php\r\n$table = $forge-\u003ebuild($tableName, $options);\r\n```\r\n\r\n[*Table*](#tables) dependencies will be resolved automatically from the Container.\r\n\r\n**Change Column**\r\n\r\nChange a table column.\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$columnName` is a string representing the column name.\r\n- `$options` is an array containing the column options.\r\n    - `name` is a string representing the new column name.\r\n    - `type` is a string representing the column type.\r\n    - `length` is a number representing the column length.\r\n    - `precision` is a number representing the column precision.\r\n    - `nullable` is a boolean indicating whether the column is nullable.\r\n    - `default` is a string representing the column default value.\r\n    - `autoIncrement` is a boolean indicating whether the column is an an auto incrementing column.\r\n    - `comment` is a string representing the column comment.\r\n\r\n```php\r\n$forge-\u003echangeColumn($tableName, $columnName, $options);\r\n```\r\n\r\nYou can also specify a [*Type*](https://github.com/elusivecodes/FyreTypeParser#types) class name as the `type`, which will be automatically mapped to the correct type.\r\n\r\nUnspecified options will default to the current value.\r\n\r\n**Create Schema**\r\n\r\nCreate a new schema.\r\n\r\n- `$schema` is a string representing the schema name.\r\n- `$options` is an array containing the schema options.\r\n    - `ifNotExists` is a boolean indicating whether to use an `IF NOT EXISTS` clause, and will default to *false*.\r\n\r\n```php\r\n$forge-\u003ecreateSchema($schema, $options);\r\n```\r\n\r\n**Create Table**\r\n\r\nCreate a new table.\r\n\r\n- `$table` is a string representing the table name.\r\n- `$columns` is an array containing the column definitions.\r\n- `$indexes` is an array containing the index definitions.\r\n- `$foreignKeys` is an array containing the foreign key definitions.\r\n- `$options` is an array containing the schema options.\r\n    - `comment` is a string representing the table comment, and will default to \"\".\r\n\r\n```php\r\n$forge-\u003ecreateTable($tableName, $columns, $indexes, $foreignKeys, $options);\r\n```\r\n\r\n**Drop Primary Key**\r\n\r\nDrop a primary key from a table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n\r\n```php\r\n$forge-\u003edropPrimaryKey($tableName);\r\n```\r\n\r\n**Drop Schema**\r\n\r\nDrop a schema.\r\n\r\n- `$schema` is a string representing the schema name.\r\n- `$options` is an array containing the schema options.\r\n    - `ifExists` is a boolean indicating whether to use an `IF EXISTS` clause, and will default to *false*.\r\n\r\n```php\r\n$forge-\u003edropSchema($schema, $options);\r\n```\r\n\r\n### Sqlite\r\n\r\nThe [*Sqlite*](https://github.com/elusivecodes/FyreDB#Sqlite) Forge extends the *Forge* class.\r\n\r\n**Add Column**\r\n\r\nAdd a column to a table.\r\n\r\n- `$tableName` is a string representing the table name.\r\n- `$columnName` is a string representing the column name.\r\n- `$options` is an array containing the column options.\r\n    - `type` is a string representing the column type, and will default to `StringType::class`.\r\n    - `length` is a number representing the column length, and will default to the type default.\r\n    - `precision` is a number representing the column precision, and will default to the type default.\r\n    - `nullable` is a boolean indicating whether the column is nullable, and will default to *false*.\r\n    - `unsigned` is a boolean indicating whether the column is unsigned, and will default to *false*.\r\n    - `default` is a string representing the column default value, and will default to *null* (no default).\r\n    - `autoIncrement` is a boolean indicating whether the column is an an auto incrementing column, and will default to *false*.\r\n\r\n```php\r\n$forge-\u003eaddColumn($tableName, $columnName, $options);\r\n```\r\n\r\nYou can also specify a [*Type*](https://github.com/elusivecodes/FyreTypeParser#types) class name as the `type`, which will be automatically mapped to the correct type.\r\n\r\n\r\n## Tables\r\n\r\n**Add Column**\r\n\r\nAdd a column to the table.\r\n\r\n- `$column` is a string representing the column name.\r\n- `$options` is an array containing the column options.\r\n    - `name` is a string representing the new column name, and will default to the column name.\r\n    - `type` is a string representing the column type, and will default to `StringType::class`.\r\n    - `length` is a number representing the column length, and will default to the type default.\r\n    - `precision` is a number representing the column precision, and will default to the type default.\r\n    - `nullable` is a boolean indicating whether the column is nullable, and will default to *false*.\r\n    - `default` is a string representing the column default value, and will default to *null* (no default).\r\n    - `autoIncrement` is a boolean indicating whether the column is an an auto incrementing column, and will default to *false*.\r\n\r\n```php\r\n$table-\u003eaddColumn($column, $options);\r\n```\r\nYou can also specify a [*Type*](https://github.com/elusivecodes/FyreTypeParser#types) class name as the `type`, which will be automatically mapped to the correct type.\r\n\r\nAdditional column options may be available depending on the connection handler.\r\n\r\n**Add Foreign Key**\r\n\r\nAdd a foreign key to the table.\r\n\r\n- `$foreignKey` is a string representing the foreign key name.\r\n- `$options` is an array containing the foreign key options.\r\n    - `columns` is a string or array containing the columns to use for the foreign key, and will default to the foreign key name.\r\n    - `referencedTable` is a string representing the referenced table to use.\r\n    - `referencedColumns` is a string or array containing the columns to use in the referenced table.\r\n    - `onUpdate` is a string containing the ON UPDATE operation, and will default to *null*.\r\n    - `onDelete` is a string containing the ON DELETE operation, and will default to *null*.\r\n\r\n```php\r\n$table-\u003eaddForeignKey($foreignKey, $options);\r\n```\r\n\r\nForeign keys cannot be added to an existing Sqlite table.\r\n\r\n**Add Index**\r\n\r\nAdd an index to the table.\r\n\r\n- `$index` is a string representing the index name.\r\n- `$options` is an array containing the index options.\r\n    - `columns` is a string or array containing the columns to use for the index, and will default to the index name.\r\n    - `unique` is a boolean indicating whether the index must be unique, and will default to *false*.\r\n    - `primary` is a boolean indicating whether the index is a primary key, and will default to *false*.\r\n\r\n```php\r\n$table-\u003eaddIndex($index, $options);\r\n```\r\n\r\nAdditional index options may be available depending on the connection handler.\r\n\r\nPrimary keys cannot be added to an existing Sqlite table.\r\n\r\n**Change Column**\r\n\r\nChange a table column.\r\n\r\n- `$column` is a string representing the column name.\r\n- `$options` is an array containing the column options.\r\n    - `name` is a string representing the new column name, and will default to the column name.\r\n\r\n```php\r\n$table-\u003echangeColumn($column, $options);\r\n```\r\n\r\nAdditional column options may be available depending on the connection handler.\r\n\r\nColumn definitions can not be modified for an existing Sqlite table.\r\n\r\n**Clear**\r\n\r\nClear the column and index data.\r\n\r\n```php\r\n$table-\u003eclear();\r\n```\r\n\r\n**Column**\r\n\r\nGet a [*Column*](#columns).\r\n\r\n- `$name` is a string representing the column name.\r\n\r\n```php\r\n$column = $table-\u003ecolumn($name);\r\n```\r\n\r\n**Column Names**\r\n\r\nGet the names of all table columns.\r\n\r\n```php\r\n$columnNames = $table-\u003ecolumnNames();\r\n```\r\n\r\n**Columns**\r\n\r\nGet all table [columns](#columns).\r\n\r\n```php\r\n$columns = $table-\u003ecolumns();\r\n```\r\n\r\n**Drop**\r\n\r\nDrop the table.\r\n\r\n```php\r\n$table-\u003edrop();\r\n```\r\n\r\n**Drop Column**\r\n\r\nDrop a column from the table.\r\n\r\n- `$column` is a string representing the column name.\r\n\r\n```php\r\n$table-\u003edropColumn($column);\r\n```\r\n\r\n**Drop Foreign Key**\r\n\r\nDrop a foreign key from the table.\r\n\r\n- `$foreignKey` is a string representing the foreign key name.\r\n\r\n```php\r\n$table-\u003edropForeignKey($foreignKey);\r\n```\r\n\r\nForeign keys cannot be dropped from an existing Sqlite table.\r\n\r\n**Drop Index**\r\n\r\nDrop an index from the table.\r\n\r\n- `$index` is a string representing the index name.\r\n\r\n```php\r\n$table-\u003edropIndex($index);\r\n```\r\n\r\nPrimary keys cannot be dropped from an existing Sqlite table.\r\n\r\n**Execute**\r\n\r\nGenerate and execute the SQL queries.\r\n\r\n```php\r\n$table-\u003eexecute();\r\n```\r\n\r\n**Foreign Key**\r\n\r\nGet a table [*ForeignKey*](#foreign-keys).\r\n\r\n- `$name` is a string representing the foreign key name.\r\n\r\n```php\r\n$foreignKey = $table-\u003eforeignKey($name);\r\n```\r\n\r\n**Foreign Keys**\r\n\r\nGet all table [foreign keys](#foreign-keys).\r\n\r\n```php\r\n$foreignKeys = $table-\u003eforeignKeys();\r\n```\r\n\r\n**Get Comment**\r\n\r\nGet the table comment.\r\n\r\n```php\r\n$comment = $table-\u003egetComment();\r\n```\r\n\r\n**Get Forge**\r\n\r\nGet the [*Forge*](#forges).\r\n\r\n```php\r\n$forge = $table-\u003egetForge();\r\n```\r\n\r\n**Get Name**\r\n\r\nGet the table name.\r\n\r\n```php\r\n$name = $table-\u003egetName();\r\n```\r\n\r\n**Has Column**\r\n\r\nDetermine whether the table has a column.\r\n\r\n- `$name` is a string representing the column name.\r\n\r\n```php\r\n$hasColumn = $table-\u003ehasColumn($name);\r\n```\r\n\r\n**Has Foreign Key**\r\n\r\nDetermine whether the table has a foreign key.\r\n\r\n- `$name` is a string representing the foreign key name.\r\n\r\n```php\r\n$hasForeignKey = $table-\u003ehasForeignKey($name);\r\n```\r\n\r\n**Has Index**\r\n\r\nDetermine whether the table has an index.\r\n\r\n- `$name` is a string representing the index name.\r\n\r\n```php\r\n$hasIndex = $table-\u003ehasIndex($name);\r\n```\r\n\r\n**Index**\r\n\r\nGet a table [*Index*](#indexes).\r\n\r\n- `$name` is a string representing the index name.\r\n\r\n```php\r\n$index = $table-\u003eindex($name);\r\n```\r\n\r\n**Indexes**\r\n\r\nGet all table [indexes](#indexes).\r\n\r\n```php\r\n$indexes = $table-\u003eindexes();\r\n```\r\n\r\n**Rename**\r\n\r\nRename the table.\r\n\r\n- `$table` is a string representing the new table name.\r\n\r\n```php\r\n$table-\u003erename($table);\r\n```\r\n\r\n**Set Primary Key**\r\n\r\nSet the primary key.\r\n\r\n- `$columns` is a string or array containing the columns to use for the primary key.\r\n\r\n```php\r\n$table-\u003esetPrimaryKey($columns);\r\n```\r\n\r\nPrimary keys cannot be added to an existing Sqlite table.\r\n\r\n**SQL**\r\n\r\nGenerate the SQL queries.\r\n\r\n```php\r\n$queries = $table-\u003esql();\r\n```\r\n\r\n**To Array**\r\n\r\nGet the table data as an array.\r\n\r\n```php\r\n$data = $table-\u003etoArray();\r\n```\r\n\r\n### MySQL Tables\r\n\r\n**Add Column**\r\n\r\nAdd a column to the table.\r\n\r\n- `$column` is a string representing the column name.\r\n- `$options` is an array containing the column options.\r\n    - `type` is a string representing the column type, and will default to `StringType::class`.\r\n    - `length` is a number representing the column length, and will default to the type default.\r\n    - `precision` is a number representing the column precision, and will default to the type default.\r\n    - `values` is an array containing the enum/set values, and will default to *null*.\r\n    - `nullable` is a boolean indicating whether the column is nullable, and will default to *false*.\r\n    - `unsigned` is a boolean indicating whether the column is unsigned, and will default to *false*.\r\n    - `default` is a string representing the column default value, and will default to *null* (no default).\r\n    - `charset` is a string representing the column character set, and will default to the connection character set.\r\n    - `collation` is a string representing the column collation, and will default to the connection collation.\r\n    - `autoIncrement` is a boolean indicating whether the column is an an auto incrementing column, and will default to *false*.\r\n    - `comment` is a string representing the column comment, and will default to \"\".\r\n    - `after` is a string representing the column to add this column after, and will default to *null*.\r\n    - `first` is a boolean indicating whether to add this column first in the table, and will default to *false*.\r\n\r\n```php\r\n$table-\u003eaddColumn($column, $options);\r\n```\r\n\r\nYou can also specify a [*Type*](https://github.com/elusivecodes/FyreTypeParser#types) class name as the `type`, which will be automatically mapped to the correct type.\r\n\r\n**Add Index**\r\n\r\nAdd an index to the table.\r\n\r\n- `$index` is a string representing the index name.\r\n- `$options` is an array containing the index options.\r\n    - `columns` is a string or array containing the columns to use for the index, and will default to the index name.\r\n    - `type` is a string representing the index type, and will default to \"*BTREE*\".\r\n    - `unique` is a boolean indicating whether the index must be unique, and will default to *false*.\r\n    - `primary` is a boolean indicating whether the index is a primary key, and will default to *false*.\r\n\r\n```php\r\n$table-\u003eaddIndex($index, $options);\r\n```\r\n\r\n**Change Column**\r\n\r\nChange a table column.\r\n\r\n- `$column` is a string representing the column name.\r\n- `$options` is an array containing the column options.\r\n    - `name` is a string representing the new column name.\r\n    - `type` is a string representing the column type.\r\n    - `length` is a number representing the column length.\r\n    - `precision` is a number representing the column precision.\r\n    - `values` is an array containing the enum/set values.\r\n    - `nullable` is a boolean indicating whether the column is nullable.\r\n    - `unsigned` is a boolean indicating whether the column is unsigned.\r\n    - `default` is a string representing the column default value.\r\n    - `charset` is a string representing the column character set.\r\n    - `collation` is a string representing the column collation.\r\n    - `autoIncrement` is a boolean indicating whether the column is an an auto incrementing column.\r\n    - `comment` is a string representing the column comment.\r\n    - `after` is a string representing the column to add this column after.\r\n    - `first` is a boolean indicating whether to add this column first in the table.\r\n\r\n```php\r\n$table-\u003echangeColumn($column, $options);\r\n```\r\n\r\nYou can also specify a [*Type*](https://github.com/elusivecodes/FyreTypeParser#types) class name as the `type`, which will be automatically mapped to the correct type.\r\n\r\nUnspecified options will default to the current value.\r\n\r\n**Get Charset**\r\n\r\nGet the table character set.\r\n\r\n```php\r\n$charset = $table-\u003egetCharset();\r\n```\r\n\r\n**Get Collation**\r\n\r\nGet the table collation.\r\n\r\n```php\r\n$collation = $table-\u003egetCollation();\r\n```\r\n\r\n**Get Engine**\r\n\r\nGet the table engine.\r\n\r\n```php\r\n$engine = $table-\u003egetEngine();\r\n```\r\n\r\n### Postgres Tables\r\n\r\n**Add Column**\r\n\r\nAdd a column to the table.\r\n\r\n- `$column` is a string representing the column name.\r\n- `$options` is an array containing the column options.\r\n    - `type` is a string representing the column type, and will default to `StringType::class`.\r\n    - `length` is a number representing the column length, and will default to the type default.\r\n    - `precision` is a number representing the column precision, and will default to the type default.\r\n    - `nullable` is a boolean indicating whether the column is nullable, and will default to *false*.\r\n    - `default` is a string representing the column default value, and will default to *null* (no default).\r\n    - `autoIncrement` is a boolean indicating whether the column is an an auto incrementing column, and will default to *false*.\r\n    - `comment` is a string representing the column comment, and will default to \"\".\r\n\r\n```php\r\n$table-\u003eaddColumn($column, $options);\r\n```\r\n\r\nYou can also specify a [*Type*](https://github.com/elusivecodes/FyreTypeParser#types) class name as the `type`, which will be automatically mapped to the correct type.\r\n\r\n**Add Index**\r\n\r\nAdd an index to the table.\r\n\r\n- `$index` is a string representing the index name.\r\n- `$options` is an array containing the index options.\r\n    - `columns` is a string or array containing the columns to use for the index, and will default to the index name.\r\n    - `type` is a string representing the index type, and will default to \"*BTREE*\".\r\n    - `unique` is a boolean indicating whether the index must be unique, and will default to *false*.\r\n    - `primary` is a boolean indicating whether the index is a primary key, and will default to *false*.\r\n\r\n```php\r\n$table-\u003eaddIndex($index, $options);\r\n```\r\n\r\n**Change Column**\r\n\r\nChange a table column.\r\n\r\n- `$column` is a string representing the column name.\r\n- `$options` is an array containing the column options.\r\n    - `name` is a string representing the new column name.\r\n    - `type` is a string representing the column type.\r\n    - `length` is a number representing the column length.\r\n    - `precision` is a number representing the column precision.\r\n    - `nullable` is a boolean indicating whether the column is nullable.\r\n    - `default` is a string representing the column default value.\r\n    - `autoIncrement` is a boolean indicating whether the column is an an auto incrementing column.\r\n    - `comment` is a string representing the column comment.\r\n\r\n```php\r\n$table-\u003echangeColumn($column, $options);\r\n```\r\n\r\nYou can also specify a [*Type*](https://github.com/elusivecodes/FyreTypeParser#types) class name as the `type`, which will be automatically mapped to the correct type.\r\n\r\nUnspecified options will default to the current value.\r\n\r\n### Sqlite Tables\r\n\r\n**Add Column**\r\n\r\nAdd a column to the table.\r\n\r\n- `$column` is a string representing the column name.\r\n- `$options` is an array containing the column options.\r\n    - `type` is a string representing the column type, and will default to `StringType::class`.\r\n    - `length` is a number representing the column length, and will default to the type default.\r\n    - `precision` is a number representing the column precision, and will default to the type default.\r\n    - `nullable` is a boolean indicating whether the column is nullable, and will default to *false*.\r\n    - `unsigned` is a boolean indicating whether the column is unsigned, and will default to *false*.\r\n    - `default` is a string representing the column default value, and will default to *null* (no default).\r\n    - `autoIncrement` is a boolean indicating whether the column is an an auto incrementing column, and will default to *false*.\r\n\r\n```php\r\n$table-\u003eaddColumn($column, $options);\r\n```\r\n\r\nYou can also specify a [*Type*](https://github.com/elusivecodes/FyreTypeParser#types) class name as the `type`, which will be automatically mapped to the correct type.\r\n\r\n\r\n## Columns\r\n\r\n**Get Comment**\r\n\r\nGet the column comment.\r\n\r\n```php\r\n$comment = $column-\u003egetComment();\r\n```\r\n\r\n**Get Default**\r\n\r\nGet the column default value.\r\n\r\n```php\r\n$default = $column-\u003egetDefault();\r\n```\r\n\r\n**Get Length**\r\n\r\nGet the column length.\r\n\r\n```php\r\n$length = $column-\u003egetLength();\r\n```\r\n\r\n**Get Name**\r\n\r\nGet the column name.\r\n\r\n```php\r\n$name = $column-\u003egetName();\r\n```\r\n\r\n**Get Precision**\r\n\r\nGet the column precision.\r\n\r\n```php\r\n$precision = $column-\u003egetPrecision();\r\n```\r\n\r\n**Get Table**\r\n\r\nGet the [*Table*](#tables).\r\n\r\n```php\r\n$table = $column-\u003egetTable();\r\n```\r\n\r\n**Get Type**\r\n\r\nGet the column type.\r\n\r\n```php\r\n$type = $column-\u003egetType();\r\n```\r\n\r\n**Is Auto Increment**\r\n\r\nDetermine whether the column is an auto increment column.\r\n\r\n```php\r\n$isAutoIncrement = $column-\u003eisAutoIncrement();\r\n```\r\n\r\n**Is Nullable**\r\n\r\nDetermine whether the column is nullable.\r\n\r\n```php\r\n$isNullable = $column-\u003eisNullable();\r\n```\r\n\r\n**Is Unsigned**\r\n\r\nDetermine whether the column is unsigned.\r\n\r\n```php\r\n$isUnsigned = $column-\u003eisUnsigned();\r\n```\r\n\r\n**To Array**\r\n\r\nGet the column data as an array.\r\n\r\n```php\r\n$data = $column-\u003etoArray();\r\n```\r\n\r\n### MySQL Columns\r\n\r\n**Get Charset**\r\n\r\nGet the column character set.\r\n\r\n```php\r\n$charset = $column-\u003egetCharset();\r\n```\r\n\r\n**Get Collation**\r\n\r\nGet the column collation.\r\n\r\n```php\r\n$collation = $column-\u003egetCollation();\r\n```\r\n\r\n**Get Values**\r\n\r\nGet the column enum values.\r\n\r\n```php\r\n$values = $column-\u003egetValues();\r\n```\r\n\r\n\r\n## Indexes\r\n\r\n**Get Columns**\r\n\r\nGet the column names.\r\n\r\n```php\r\n$columns = $index-\u003egetColumns();\r\n```\r\n\r\n**Get Name**\r\n\r\nGet the index name.\r\n\r\n```php\r\n$name = $index-\u003egetName();\r\n```\r\n\r\n**Get Table**\r\n\r\nGet the [*Table*](#tables).\r\n\r\n```php\r\n$table = $index-\u003egetTable();\r\n```\r\n\r\n**Get Type**\r\n\r\nGet the index type.\r\n\r\n```php\r\n$type = $index-\u003egetType();\r\n```\r\n\r\n**Is Primary**\r\n\r\nDetermine whether the index is primary.\r\n\r\n```php\r\n$isPrimary = $index-\u003eisPrimary();\r\n```\r\n\r\n**Is Unique**\r\n\r\nDetermine whether the index is unique.\r\n\r\n```php\r\n$isUnique = $index-\u003eisUnique();\r\n```\r\n\r\n**To Array**\r\n\r\nGet the index data as an array.\r\n\r\n```php\r\n$data = $index-\u003etoArray();\r\n```\r\n\r\n\r\n## Foreign Keys\r\n\r\n**Get Columns**\r\n\r\nGet the column names.\r\n\r\n```php\r\n$columns = $foreignKey-\u003egetColumns();\r\n```\r\n\r\n**Get Name**\r\n\r\n```php\r\n$name = $foreignKey-\u003egetName();\r\n```\r\n\r\n**Get On Delete**\r\n\r\nGet the delete action.\r\n\r\n```php\r\n$onDelete = $foreignKey-\u003egetOnDelete();\r\n```\r\n\r\n**Get On Update**\r\n\r\nGet the update action.\r\n\r\n```php\r\n$onUpdate = $foreignKey-\u003egetOnUpdate();\r\n```\r\n**Get Referenced Columns**\r\n\r\nGet the referenced column names.\r\n\r\n```php\r\n$referencedColumn = $foreignKey-\u003egetReferencedColumns();\r\n```\r\n\r\n**Get Referenced Table**\r\n\r\nGet the referenced table name.\r\n\r\n```php\r\n$referencedTable = $foreignKey-\u003egetReferencedTable();\r\n```\r\n\r\n**Get Table**\r\n\r\nGet the [*Table*](#tables).\r\n\r\n```php\r\n$table = $foreignKey-\u003egetTable();\r\n```\r\n\r\n**To Array**\r\n\r\nGet the foreign key data as an array.\r\n\r\n```php\r\n$data = $foreignKey-\u003etoArray();\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felusivecodes%2Ffyreforge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felusivecodes%2Ffyreforge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felusivecodes%2Ffyreforge/lists"}