danilocgsilva/class_to_sql_schema_script

1.9.0 2024-09-05 17:47 UTC

This package is auto-updated.

Last update: 2024-11-14 20:01:51 UTC


README

Instalation

composer require danilocgsilva/class_to_sql_schema_script

Usage

  1. Create a classe with the database properies.

  2. Get the sql script.

Example:

use Danilocgsilva\ClassToSqlSchemaScript\DatabaseScriptSpitter;
.
.
.
$databaseScriptSpitter = new DatabaseScriptSpitter("your_database_name");

return $databaseScriptSpitter->getString();

It will result in:

CREATE DATABASE your_database_name DEFAULT CHARACTER SET utf8 COLLATE utf8mb3_unicode_ci;

Check more usage examples in tests.