JSONToSQLConverter
class JSONToSQLConverter
This class allows the conversion of a json-schema.org compliant JSON database and exported from G6K to a SQL database
Properties
private array | $parameters | ||
private array | $datatypes | ||
private string | $databasesDir | ||
private Database | $database |
Methods
Constructor of class JSONToSQLConverter
Prepares a value according to its type for its insertion in a SQL database
Decodes a properties list from JSON schema
Connects to the database
Imports a JSON database to a SQL database and returns an array descriptor of the database for the update of DataSources.xml
Details
at line 116
void
__construct(array $fparameters, string $databasesDir)
Constructor of class JSONToSQLConverter
at line 129
private string
getType(stdClass $coldef)
Returns the data type of a database column
at line 156
private string
getValue(string $type, string $value)
Prepares a value according to its type for its insertion in a SQL database
at line 175
private stdClass
properties(string $arg)
Decodes a properties list from JSON schema
at line 194
private void
connectDatabase(string $dbschema, string $dbtype)
Connects to the database
at line 222
array
convert(string $name, string $schemafile, string $datafile)
Imports a JSON database to a SQL database and returns an array descriptor of the database for the update of DataSources.xml