Skip to content

Support UUIDs in ORM #619

@brendt

Description

@brendt

In case we need to convert from UUID to binary (MySQL and SQLite), the easiest way to do it would be in PHP:

  • That way we don't have to worry about special inserts per database-dialect.
  • Selecting should be done using the binary format of the UUID, so we'd have to convert it before building the select query
  • The CreateTableStatement and AlterTableStatement should simply have a uuid() method that creates the field with a unique index
  • We might have an option to store the "human readable" version in the database as well

An example of how this was done with a Laravel package (before Laravel had support for it): https://github.com/spatie/laravel-binary-uuid/tree/master

Having thought it through, I think we're in the clear about breaking changes, and can move this to post-1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions