Skip to content

“add_user” and “update_user” handle additional data differently #155

@kun432

Description

@kun432

add an user with additional data:

from dataclasses import asdict
import json

uid = client.add_user({"name": "Gustavo"})
u = client.get_user(uid)

print(json.dumps(asdict(u), indent=2))
{
  "user_id": "9c805721-5053-485d-81c8-c058617e2b09",
  "project_client": {
    "api_key": "secret",
    "api_version": "api/v1",
    "project_url": "http://host.docker.internal:8019/"
  },
  "fields": {
    "data": {
      "name": "Gustavo"
    },
    "id": null,
    "created_at": "2026-02-12T07:22:12.732569Z",
    "updated_at": "2026-02-12T07:22:12.732569Z"
  }
}

update with additional data:

client.update_user(uid, {"ANY": "NEW_DATA"})
u = client.get_user(uid)
print(json.dumps(asdict(u), indent=2))
{
  "user_id": "9c805721-5053-485d-81c8-c058617e2b09",
  "project_client": {
    "api_key": "secret",
    "api_version": "api/v1",
    "project_url": "http://host.docker.internal:8019/"
  },
  "fields": {
    "data": {
      "data": {
        "ANY": "NEW_DATA"
      }
    },
    "id": null,
    "created_at": "2026-02-12T07:22:12.732569Z",
    "updated_at": "2026-02-12T07:23:01.094241Z"
  }
}

Memobase server: 0.0.40
Memobase Python SDK: memobase-0.0.27

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