Skip to content

chore: version package for release#33

Merged
flyon merged 1 commit intomainfrom
changeset-release/main
Mar 12, 2026
Merged

chore: version package for release#33
flyon merged 1 commit intomainfrom
changeset-release/main

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Mar 12, 2026

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@_linked/core@2.1.0

Minor Changes

  • #31 eb88865 Thanks @flyon! - Properties in select() and update() now support expressions — you can compute values dynamically instead of just reading or writing raw fields.

    What's new

    • Computed fields in queries — chain expression methods on properties to derive new values: string manipulation (.strlen(), .ucase(), .concat()), arithmetic (.plus(), .times(), .abs()), date extraction (.year(), .month(), .hours()), and comparisons (.gt(), .eq(), .contains()).

      await Person.select((p) => ({
        name: p.name,
        nameLen: p.name.strlen(),
        ageInMonths: p.age.times(12),
      }));
    • Expression-based WHERE filters — filter using computed conditions, not just equality checks. Works on queries, updates, and deletes.

      await Person.select((p) => p.name).where((p) => p.name.strlen().gt(5));
      await Person.update({ verified: true }).where((p) => p.age.gte(18));
    • Computed updates — when updating data, calculate new values based on existing ones instead of providing static values. Pass a callback to update() to reference current field values.

      await Person.update((p) => ({ age: p.age.plus(1) })).for(entity);
      await Person.update((p) => ({
        label: p.firstName.concat(" ").concat(p.lastName),
      })).for(entity);
    • Expr module — for expressions that don't start from a property, like the current timestamp, conditional logic, or coalescing nulls.

      await Person.update({ lastSeen: Expr.now() }).for(entity);
      await Person.select((p) => ({
        displayName: Expr.firstDefined(p.nickname, p.name),
      }));

    Update expression callbacks are fully typed — .plus() only appears on number properties, .strlen() only on strings, etc.

    New exports

    ExpressionNode, Expr, ExpressionInput, PropertyRefMap, ExpressionUpdateProxy<S>, ExpressionUpdateResult<S>, and per-type method interfaces (NumericExpressionMethods, StringExpressionMethods, DateExpressionMethods, BooleanExpressionMethods, BaseExpressionMethods).

    See the README for the full method reference and more examples.

@flyon flyon merged commit 9961d42 into main Mar 12, 2026
2 checks passed
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