Documentation

DatabaseExportDirector extends Director
in package

The database director allows to use the models to quickly create the database schema on the DBMS, and import and export data from the DBMS to a File system.

This util should also make it infinitely more easy to change data to a new encoding. Sadly, MySQL, MariaDB (and I suspect the other DBMSs too) are a real pain to change the encoding and collation. Just being able to export the tables, load them into files and write them back into the database seems like a godsend for many of these operations.

It also makes it more approachable to backup and restore data, since many of the SQL based import/export tools will cause artifacts.

Tags
todo

Move to Database rather than utils

todo

Allow for incremental updates (this is tricky due to the fact that deletes may happen)

author

César de la Cal Bretschneider cesar@magic3w.com

Table of Contents

exec()  : int
Initializes the schemas on the DBMS side. This removes the need for spitfire's old mechanism where it would fall back from these errors and attempt to fix the database for each request.
parameters()  : array<string|int, mixed>
This currently accepts no parameters at all

Methods

exec()

Initializes the schemas on the DBMS side. This removes the need for spitfire's old mechanism where it would fall back from these errors and attempt to fix the database for each request.

public exec(array<string|int, mixed> $parameters, CLIParameters $arguments) : int
Parameters
$parameters : array<string|int, mixed>

The array of parameters parsed from the input, using the data provided by parameters()

$arguments : CLIParameters

The raw arguments read from the process

Tags
todo

Introduce migrations / repairs / upgrades to add and remove indexes

todo

This only creates tables for the top level application, child apps are not processed

todo

This has debugging output that needs to go

todo

Replace this with dependency injected database?

todo

Spitfire has no abstracted mean to load / list models, controllers, directors, templates that removes the need for this glob madness and allows it to cache known locations

Return values
int

The return code

parameters()

This currently accepts no parameters at all

public parameters() : array<string|int, mixed>
Return values
array<string|int, mixed>

Search results