clockworklabs / clockworklabs/SpacetimeDB

CLI correct SQL query to update struct field

Open
#4,530 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
25.2k
Forks
1.1k
Avg merge
2d 7h
Merged PRs (30d)
46

Description

spacetime sql conquer-mmo "SELECT * FROM character_position"
WARNING: This command is UNSTABLE and subject to breaking changes.

 character_id | prev_map_id | last_move_time                   | location                                        | direction
--------------+-------------+----------------------------------+-------------------------------------------------+--------------
 1            | 1010        | 2026-03-01T11:21:18.924697+00:00 | (map_id = 1010, x = 61, y = 109, elevation = 0) | (south = ())
spacetime sql conquer-mmo "UPDATE character_position SET location = (1000, 61, 109, 0) WHERE character_id = 1"
WARNING: This command is UNSTABLE and subject to breaking changes.

Error: Unsupported column/variable assignment expression: (1000, 61, 109, 0)

i tired a lot of syntax but no luck!. the docs show this syntax but i cant understand how to make it work!:

UPDATE table SET [ '(' assignment { ',' assignment } ')' ] [ WHERE predicate ]

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported spacetime sql UPDATE command and trace the SQL UPDATE assignment handling for struct fields. Compare the documented assignment syntax with the accepted expression forms; done means the shown character_position update succeeds and the relevant regression behavior is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, sql
Domain
cli, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.