SpacetimeDB icon indicating copy to clipboard operation
SpacetimeDB copied to clipboard

Implemented Some-typed literals in SQL

Open egormanga opened this issue 2 months ago • 0 comments

Description of Changes

Ability to, given a table:

#[table(name=table)]
struct Table {
	option: Option<i32>,
}

do:

INSERT INTO table (option) VALUES (0);

instead of getting:

Error: The literal expression `0` cannot be parsed as type `(some: I32 | none: ())`
  • Companion pull request for #3606.

API and ABI breaking changes

None.

Expected complexity level and risk

1:

Quite literally almost a one-liner.

Testing

  • [x] Manual testing
  • [ ] Unit tests

egormanga avatar Nov 08 '25 00:11 egormanga