Skip to content
Search
Examples

Schema

Description

A Schema is built from per-column definitions, and nesting is a structure_schema() wrapped around a type_structure().

Documentation

The schema describes every column a frame carries, and gates what a row may hold.

Code

<?php

declare(strict_types=1);

use function Flow\ETL\DSL\{integer_schema, schema, schema_to_ascii, string_schema, structure_schema};
use function Flow\Types\DSL\{type_float, type_string, type_structure};

require __DIR__ . '/vendor/autoload.php';

echo schema_to_ascii(schema(
    integer_schema('id'),
    string_schema('name', nullable: true),
    structure_schema('address', type_structure([
        'city' => type_string(),
        'lat' => type_float(),
        'lon' => type_float(),
    ])),
));
Contributors

Built in the open.

Join us on GitHub
scroll back to top