Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
eb88865Thanks @flyon! - Properties inselect()andupdate()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()).Expression-based WHERE filters — filter using computed conditions, not just equality checks. Works on queries, updates, and deletes.
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.Exprmodule — for expressions that don't start from a property, like the current timestamp, conditional logic, or coalescing nulls.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.