Repository navigation
Qualify predicates chapter's index, sort-order, and function-availability claims - #49
Merged
Merged
Conversation
…lity claims The AVET-index speedup for range predicates only applies without qualification on Datomic Cloud/Local; on Pro the attribute needs :db/index or :db/unique. String comparison is by character code, not dictionary order, which is why the >= "S" / < "T" trick only matches starts-with? because every name here is capitalized. Also spell out which functions are actually available to a predicate and why the Client API changes that. Closes #26 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Closes #26
What changed
:db/index trueor:db/unique; the site's schema doesn't set either on:pokemon/name/the stat attributes, but Datomic Cloud/Local (what this site runs on) index every attribute regardless.>= "S"/< "T"trick only equalsstarts-with? "S"because every Pokemon name in this dataset happens to be capitalized.clojure.corefunction (excepteval), or a Java/Clojure function on the classpath of the process running the query, and that with the Client API that process is the server, not the caller's application.Verification
resources/pokemon.ednthat neither:pokemon/namenor the stat attributes have:db/indexor:db/unique.app.core/run-qagainst the pokemon dataset:starts-with? ?name "S"→ 14 rows>= ?name "S"and< ?name "T"→ 14 rows (same set)>= ?name "a"(lowercase) → 0 rows, confirming case-sensitive code-unit orderingclojure -X:test: 32 tests, 493 assertions, 0 failures.Only
resources/chapters/predicates.ednis touched; the dead-anchor link fix in this same file is left alone since it's scoped to issue #31.🤖 Generated with Claude Code