首页 > 解决方案 > 如何使用 go-tarantool 在 Tarantool 中插入 UUID?

问题描述

Tarantool 现在有一个内置类型 UUID。
如何使用https://github.com/tarantool/go-tarantool插入记录并传递此字段?

现在我有这个:

Tuple field 1 type does not match one required by operation: expected uuid (0x17)

尝试将 UUID 作为字符串插入时

"github.com/satori/go.uuid"

...

var (
    Tarantool *tarantool.Connection
)

...

Tarantool.Insert("log", []interface{}{
        uuid.NewV4().String(),
...

指数:

index:
    0: &0
      unique: true
      parts:
      - type: uuid
        is_nullable: false
        fieldno: 1
      id: 0
      space_id: 513
      type: HASH
      name: primary
    primary: *0

标签: tarantool

解决方案


这是官方 Go 驱动程序不支持的新功能。您可以在此处跟踪实施进度并公开讨论


推荐阅读