PHP code example of fyre / schema
1. Go to this page and download the library: Download fyre/schema library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fyre / schema example snippets
use Fyre\Schema\SchemaRegistry;
$schemaRegistry = new SchemaRegistry($container);
$container->singleton(SchemaRegistry::class);
$schemaRegistry = $container->use(SchemaRegistry::class);
$schemaRegistry->map($connectionClass, $schemaClass);
$schema = $schemaRegistry->use($connection);
$schema->clear();
$tableSchema = $schema->describe($name);
$connection = $schema->getConnection();
$database = $schema->getDatabaseName();
$hasTable = $schema->hasTable($name);
$table = $schema->table($name);
$tableNames = $schema->tableNames();
$tables = $schema->tables();
$tableSchema->clear();
$column = $tableSchema->column($name);
$columnNames = $tableSchema->columnNames();
$columns = $tableSchema->columns();
$defaultValue = $tableSchema->defaultValue($name);
$foreignKey = $tableSchema->foreignKey($name);
$foreignKeys = $tableSchema->foreignKeys();
$schema = $tableSchema->getSchema();
$tableName = $tableSchema->getTableName();
$parser = $tableSchema->getType($name);
$hasAutoIncrement = $tableSchema->hasAutoIncrement();
$hasColumn = $tableSchema->hasColumn($name);
$hasForeignKey = $tableSchema->hasForeignKey($name);
$hasIndex = $tableSchema->hasIndex($name);
$index = $tableSchema->index($name);
$indexes = $tableSchema->indexes();
$isNullable = $tableSchema->isNullable($name);
$primaryKey = $tableSchema->primaryKey();