Skip to content

Commit

Permalink
Remove schema definition constraint and simlify metadatA
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech committed Jan 28, 2024
1 parent 346065a commit ef7d2f3
Show file tree
Hide file tree
Showing 18 changed files with 69 additions and 516 deletions.
1 change: 0 additions & 1 deletion src/core/etl/docs/new_type.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ interface, below you can find list of things that must be checked.

* Schema
* [Definition](../src/Flow/ETL/Row/Schema/Definition.php)
* [Constraint](../src/Flow/ETL/Row/Schema/Constraint.php)
* [EntryFactory](../src/Flow/ETL/Row/EntryFactory.php)
60 changes: 30 additions & 30 deletions src/core/etl/src/Flow/ETL/DSL/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1007,87 +1007,87 @@ function schema(Definition ...$definitions) : Schema
return new Schema(...$definitions);
}

function int_schema(string $name, bool $nullable = false, ?Schema\Constraint $constraint = null, ?Schema\Metadata $metadata = null) : Definition
function int_schema(string $name, bool $nullable = false, ?Schema\Metadata $metadata = null) : Definition
{
return Definition::integer($name, $nullable, $constraint, $metadata);
return Definition::integer($name, $nullable, $metadata);
}

function str_schema(string $name, bool $nullable = false, ?Schema\Constraint $constraint = null, ?Schema\Metadata $metadata = null) : Definition
function str_schema(string $name, bool $nullable = false, ?Schema\Metadata $metadata = null) : Definition
{
return Definition::string($name, $nullable, $constraint, $metadata);
return Definition::string($name, $nullable, $metadata);
}

function bool_schema(string $name, bool $nullable = false, ?Schema\Constraint $constraint = null, ?Schema\Metadata $metadata = null) : Definition
function bool_schema(string $name, bool $nullable = false, ?Schema\Metadata $metadata = null) : Definition
{
return Definition::boolean($name, $nullable, $constraint, $metadata);
return Definition::boolean($name, $nullable, $metadata);
}

function float_schema(string $name, bool $nullable = false, ?Schema\Constraint $constraint = null, ?Schema\Metadata $metadata = null) : Definition
function float_schema(string $name, bool $nullable = false, ?Schema\Metadata $metadata = null) : Definition
{
return Definition::float($name, $nullable, $constraint, $metadata);
return Definition::float($name, $nullable, $metadata);
}

function array_schema(string $name, bool $empty = false, bool $nullable = false, ?Schema\Constraint $constraint = null, ?Schema\Metadata $metadata = null) : Definition
function array_schema(string $name, bool $empty = false, bool $nullable = false, ?Schema\Metadata $metadata = null) : Definition
{
return Definition::array($name, $empty, $nullable, $constraint, $metadata);
return Definition::array($name, $empty, $nullable, $metadata);
}

function object_schema(string $name, ObjectType $type, ?Schema\Constraint $constraint = null, ?Schema\Metadata $metadata = null) : Definition
function object_schema(string $name, ObjectType $type, ?Schema\Metadata $metadata = null) : Definition
{
return Definition::object($name, $type, $constraint, $metadata);
return Definition::object($name, $type, $metadata);
}

function map_schema(string $name, MapType $type, ?Schema\Constraint $constraint = null, ?Schema\Metadata $metadata = null) : Definition
function map_schema(string $name, MapType $type, ?Schema\Metadata $metadata = null) : Definition
{
return Definition::map($name, $type, $constraint, $metadata);
return Definition::map($name, $type, $metadata);
}

function list_schema(string $name, ListType $type, ?Schema\Constraint $constraint = null, ?Schema\Metadata $metadata = null) : Definition
function list_schema(string $name, ListType $type, ?Schema\Metadata $metadata = null) : Definition
{
return Definition::list($name, $type, $constraint, $metadata);
return Definition::list($name, $type, $metadata);
}

/**
* @param class-string<\UnitEnum> $type
*/
function enum_schema(string $name, string $type, bool $nullable = false, ?Schema\Constraint $constraint = null, ?Schema\Metadata $metadata = null) : Definition
function enum_schema(string $name, string $type, bool $nullable = false, ?Schema\Metadata $metadata = null) : Definition
{
return Definition::enum($name, $type, $nullable, $constraint, $metadata);
return Definition::enum($name, $type, $nullable, $metadata);
}

function null_schema(string $name, ?Schema\Metadata $metadata = null) : Definition
{
return Definition::null($name, $metadata);
}

function datetime_schema(string $name, bool $nullable = false, ?Schema\Constraint $constraint = null, ?Schema\Metadata $metadata = null) : Definition
function datetime_schema(string $name, bool $nullable = false, ?Schema\Metadata $metadata = null) : Definition
{
return Definition::datetime($name, $nullable, $constraint, $metadata);
return Definition::datetime($name, $nullable, $metadata);
}

function json_schema(string $name, bool $nullable = false, ?Schema\Constraint $constraint = null, ?Schema\Metadata $metadata = null) : Definition
function json_schema(string $name, bool $nullable = false, ?Schema\Metadata $metadata = null) : Definition
{
return Definition::json($name, $nullable, $constraint, $metadata);
return Definition::json($name, $nullable, $metadata);
}

function xml_schema(string $name, bool $nullable = false, ?Schema\Constraint $constraint = null, ?Schema\Metadata $metadata = null) : Definition
function xml_schema(string $name, bool $nullable = false, ?Schema\Metadata $metadata = null) : Definition
{
return Definition::xml($name, $nullable, $constraint, $metadata);
return Definition::xml($name, $nullable, $metadata);
}

function xml_node_schema(string $name, bool $nullable = false, ?Schema\Constraint $constraint = null, ?Schema\Metadata $metadata = null) : Definition
function xml_node_schema(string $name, bool $nullable = false, ?Schema\Metadata $metadata = null) : Definition
{
return Definition::xml_node($name, $nullable, $constraint, $metadata);
return Definition::xml_node($name, $nullable, $metadata);
}

function struct_schema(string $name, StructureType $type, ?Schema\Constraint $constraint = null, ?Schema\Metadata $metadata = null) : Definition
function struct_schema(string $name, StructureType $type, ?Schema\Metadata $metadata = null) : Definition
{
return Definition::structure($name, $type, $constraint, $metadata);
return Definition::structure($name, $type, $metadata);
}

function uuid_schema(string $name, bool $nullable = false, ?Schema\Constraint $constraint = null, ?Schema\Metadata $metadata = null) : Definition
function uuid_schema(string $name, bool $nullable = false, ?Schema\Metadata $metadata = null) : Definition
{
return Definition::uuid($name, \uuid_type($nullable), $constraint, $metadata);
return Definition::uuid($name, \uuid_type($nullable), $metadata);
}

function execution_context(?Config $config = null) : FlowContext
Expand Down
12 changes: 0 additions & 12 deletions src/core/etl/src/Flow/ETL/Row/Schema/Constraint.php

This file was deleted.

32 changes: 0 additions & 32 deletions src/core/etl/src/Flow/ETL/Row/Schema/Constraint/All.php

This file was deleted.

32 changes: 0 additions & 32 deletions src/core/etl/src/Flow/ETL/Row/Schema/Constraint/Any.php

This file was deleted.

23 changes: 0 additions & 23 deletions src/core/etl/src/Flow/ETL/Row/Schema/Constraint/IsInstanceOf.php

This file was deleted.

27 changes: 0 additions & 27 deletions src/core/etl/src/Flow/ETL/Row/Schema/Constraint/ListType.php

This file was deleted.

27 changes: 0 additions & 27 deletions src/core/etl/src/Flow/ETL/Row/Schema/Constraint/NotEmpty.php

This file was deleted.

20 changes: 0 additions & 20 deletions src/core/etl/src/Flow/ETL/Row/Schema/Constraint/SameAs.php

This file was deleted.

16 changes: 0 additions & 16 deletions src/core/etl/src/Flow/ETL/Row/Schema/Constraint/VoidConstraint.php

This file was deleted.

Loading

0 comments on commit ef7d2f3

Please sign in to comment.