-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.php
More file actions
21 lines (15 loc) · 706 Bytes
/
example.php
File metadata and controls
21 lines (15 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php declare(strict_types=1);
use Pongee\DatabaseSchemaVisualization\DataObject\Sql\Database\Connection\ConnectionCollection;
use Pongee\DatabaseSchemaVisualization\Export\Json;
use Pongee\DatabaseSchemaVisualization\Parser\MysqlParser;
include './vendor/autoload.php';
$sqlSchema = '
CREATE TABLE IF NOT EXISTS `foo` (
`id` INT(10) UNSIGNED NOT NULL COMMENT "The id"
) ENGINE=innodb DEFAULT CHARSET=utf8;
';
$mysqlParser = new MysqlParser();
$jsonExport = new Json(); // or use new Plantuml();
$forcedConnectionCollection = new ConnectionCollection();
$schema = $mysqlParser->run($sqlSchema, $forcedConnectionCollection);
print $jsonExport->export($schema);