DbalSchemaFactory
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
The NodeAggregateId is limited to 64 ascii characters and therefore we should do the same in the database.
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).
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.
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.
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.
The NodeTypeName is an ascii string, we should be able to sort it properly, but we don't need unicode here.
No description
No description
No description
No description
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.
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.
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.
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.
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.
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