Skip to content

Support UUIDs as keys #84

@akudiyar

Description

@akudiyar

Given this space:

local customers = box.schema.space.create(
        'customers',
        {
            format = {
                {name = 'uuid', type = 'uuid'},
                {name = 'bucket_id', type = 'unsigned'},
                {name = 'name', type = 'string'},
                {name = 'tags', type = 'array'},
            },
            if_not_exists = true,
        }
    )

    customers:create_index('uuid', {
        parts = {'uuid'},
        if_not_exists = true,
    })

    customers:create_index('bucket_id', {
        parts = {'bucket_id'},
        unique = false,
        if_not_exists = true,
    })

It is impossible to perform crud.select('customers'), since it fails with an error like

E> LuajitError: /app/.rocks/share/tarantool/crud/select/comparators.lua:53: attempt to compare 'struct tt_uuid' with 'struct tt_uuid'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions