final class DbalSchemaFactory (View source)

internal  Because platform checks are limited for now and the input and output format of functions might change.
 

Provide doctrine DBAL column schema definitions for common types in the content repository to produce consistent columns across projections.

Constants

DEFAULT_MYSQL_COLLATION

Methods

static Column
columnForNodeAggregateId(string $columnName, AbstractPlatform $platform)

The NodeAggregateId is limited to 64 ascii characters and therefore we should do the same in the database.

static Column
columnForContentStreamId(string $columnName, AbstractPlatform $platform)

The ContentStreamId is generally a UUID, therefore not a real "string" but at the moment a strified identifier, we can safely store it as binary string as the charset doesn't matter for the characters we use (they are all asscii).

static Column
columnForNodeAnchorPoint(string $columnName, AbstractPlatform $platform)

An anchorpoint can be used in a given projection to link two nodes, it is a purely internal identifier and should be as performant as possible in queries, the current code uses UUIDs, so we will store the stringified UUID as binary for now.

static Column
columnForDimensionSpacePoint(string $columnName, AbstractPlatform $platform)

DimensionSpacePoints are PHP objects that need to be serialized as JSON, therefore we store them as TEXT for now, with a sensible collation for case insensitive text search.

static Column
columnForDimensionSpacePointHash(string $columnName, AbstractPlatform $platform)

The hash for a given dimension space point for better query performance. As this is a hash, the size and type of content is deterministic, a binary type can be used as the actual content is not so important.

static Column
columnForNodeTypeName(string $columnName, AbstractPlatform $platform)

The NodeTypeName is an ascii string, we should be able to sort it properly, but we don't need unicode here.

static Column
columnForWorkspaceName(string $columnName, AbstractPlatform $platform)

No description

static Column
columnForProperties(string $columnName, AbstractPlatform $platform)

No description

static Column
columnForGenericString(string $columnName, AbstractPlatform $platform)

No description

static Column
columnForGenericText(string $columnName, AbstractPlatform $platform)

No description

static Schema
createSchemaWithTables(Connection $dbal, array $tables)

No description

Details

static Column columnForNodeAggregateId(string $columnName, AbstractPlatform $platform)

The NodeAggregateId is limited to 64 ascii characters and therefore we should do the same in the database.

Parameters

string $columnName
AbstractPlatform $platform

Return Value

Column

See also

NodeAggregateId

static Column columnForContentStreamId(string $columnName, AbstractPlatform $platform)

The ContentStreamId is generally a UUID, therefore not a real "string" but at the moment a strified identifier, we can safely store it as binary string as the charset doesn't matter for the characters we use (they are all asscii).

We should however reduce the allowed size to 36 like suggested here in the schema and as further improvement store the UUID in a more DB friendly format.

Parameters

string $columnName
AbstractPlatform $platform

Return Value

Column

See also

ContentStreamId

static Column columnForNodeAnchorPoint(string $columnName, AbstractPlatform $platform)

An anchorpoint can be used in a given projection to link two nodes, it is a purely internal identifier and should be as performant as possible in queries, the current code uses UUIDs, so we will store the stringified UUID as binary for now.

A simpler and faster format would be preferable though, int or a shorter binary format if possible. Fortunately this is a pure projection information and therefore could change by replay.

Parameters

string $columnName
AbstractPlatform $platform

Return Value

Column

static Column columnForDimensionSpacePoint(string $columnName, AbstractPlatform $platform)

DimensionSpacePoints are PHP objects that need to be serialized as JSON, therefore we store them as TEXT for now, with a sensible collation for case insensitive text search.

Using a dedicated JSON column format should be considered for the future.

Parameters

string $columnName
AbstractPlatform $platform

Return Value

Column

See also

DimensionSpacePoint

static Column columnForDimensionSpacePointHash(string $columnName, AbstractPlatform $platform)

The hash for a given dimension space point for better query performance. As this is a hash, the size and type of content is deterministic, a binary type can be used as the actual content is not so important.

We could imrpove by actually storing the hash in binary form and shortening and fixing the length.

Parameters

string $columnName
AbstractPlatform $platform

Return Value

Column

See also

DimensionSpacePoint

static Column columnForNodeTypeName(string $columnName, AbstractPlatform $platform)

The NodeTypeName is an ascii string, we should be able to sort it properly, but we don't need unicode here.

Parameters

string $columnName
AbstractPlatform $platform

Return Value

Column

See also

NodeTypeName

static Column columnForWorkspaceName(string $columnName, AbstractPlatform $platform)

No description

Parameters

string $columnName
AbstractPlatform $platform

Return Value

Column

See also

WorkspaceName

static Column columnForProperties(string $columnName, AbstractPlatform $platform)

No description

Parameters

string $columnName
AbstractPlatform $platform

Return Value

Column

static Column columnForGenericString(string $columnName, AbstractPlatform $platform)

No description

Parameters

string $columnName
AbstractPlatform $platform

Return Value

Column

static Column columnForGenericText(string $columnName, AbstractPlatform $platform)

No description

Parameters

string $columnName
AbstractPlatform $platform

Return Value

Column

static Schema createSchemaWithTables(Connection $dbal, array $tables)

No description

Parameters

Connection $dbal
array $tables

Return Value

Schema

Exceptions

Exception
SchemaException