Skip to content

Port bindings-doctests.sh into CI#5155

Open
bfops wants to merge 2 commits into
masterfrom
bfops/port-doctest-script
Open

Port bindings-doctests.sh into CI#5155
bfops wants to merge 2 commits into
masterfrom
bfops/port-doctest-script

Conversation

@bfops
Copy link
Copy Markdown
Collaborator

@bfops bfops commented May 31, 2026

Description of Changes

Part of #4970.

Doing this part in a separate PR because it turns out that this test was failing, so this PR also includes the fixes.

API and ABI breaking changes

None

Expected complexity level and risk

1

Testing

CI passes (but only with the "code" changes).

@bfops bfops changed the title Port bindings-doctests.sh into CI Port bindings-doctests.sh into CI May 31, 2026
@bfops bfops marked this pull request as ready for review May 31, 2026 20:11
/// ctx.db.country().code().update(Country {
/// // If we wanted to replace the row for Australia, we can delete it and insert the new row.
/// assert!(ctx.db.country().code().delete("AU".to_string()));
/// ctx.db.country().insert(Country {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI says:

UniqueColumn::update is now constrained to primary-key columns only:

  pub fn update(&self, new_row: Tbl::Row) -> Tbl::Row
  where
      Col: PrimaryKey,

The docs in table.rs explicitly say this is intentional: for a non-primary unique column, use .delete(key) > followed by .insert(row). So the old text saying “update the row for Australia” with ctx.db.country().code().update(...) failed doctests because code is unique, not primary key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant