Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider storing IDs as bytes #16

Open
bwaidelich opened this issue Jan 16, 2024 · 0 comments
Open

Consider storing IDs as bytes #16

bwaidelich opened this issue Jan 16, 2024 · 0 comments

Comments

@bwaidelich
Copy link
Member

Instead of

(new Column('id', Type::getType(Types::STRING)))
    ->setFixed(true)
    ->setLength(EventId::MAX_LENGTH)
    ->setCustomSchemaOptions($isSQLite ? [] : ['charset' => 'ascii']),

we could store the event id (and potentially causationId and correlationId) as binary:

(new Column('id', Type::getType(Types::BINARY)))
    ->setFixed(true)
    ->setLength(EventId::MAX_LENGTH)

Note:
For SQLite this is not supported (i.e. a table diff will always drop and re-add the column)
For PostgreSQL we could even use the UUID type (using DBALs Types::GUID abstraction)

Related: #12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant