Repository navigation
feat: prepared queries with plain Python bind values (minigraf#181) - #14
Merged
Merged
Conversation
…pi (minigraf#181) Shim from minigraf-binding-template#7 and core pin 5f2ba46e (minigraf#738). db.prepare(text) -> PreparedQuery; execute()/query() take keyword arguments or a dict. bool, int, float, str, None and uuid.UUID bind as they are; Entity/TxCount/Timestamp/ANY_VALID_TIME and minigraf.Value for the rest. API-category errors raise MiniGrafError.Api. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Urda7FD9CYYoxdeGGJa11x
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Urda7FD9CYYoxdeGGJa11x
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Urda7FD9CYYoxdeGGJa11x
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Urda7FD9CYYoxdeGGJa11x
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.
PR 3 (python) of project-minigraf/minigraf#181 (spec §4.2, §5, §7.1; plan steps 11–14).
src/lib.rscopied from feat: prepared queries and MiniGrafError::Api (minigraf#181) minigraf-binding-template#7:MiniGrafDb.prepare→MiniGrafPreparedQuery,MiniGrafBindValue,MiniGrafError.Api. Core pin bumped to5f2ba46e(minigraf#738).minigraf/__init__.py:pq.execute(age=30)/pq.execute({"age": 30})(same forquery).bool(checked beforeint),int(outside i64 →API-017),float,str,Noneanduuid.UUID(an entity, which also fits value and rule-argument slots) bind as they are.minigraf.Entity,TxCount,Timestamp,ANY_VALID_TIMEandminigraf.Value.*cover the rest; any other type raisesTypeError. AliasesPreparedQueryandBindValue.MiniGrafError.Api, no longerMiniGrafError.Other.Tests (bench machine, Python 3.12): 43 passed, 21 of them new in
tests/test_prepared.py. The contract passes. Codex: one test gap (UUID in value/rule slots), fixed.Merge after minigraf-binding-template#7.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Urda7FD9CYYoxdeGGJa11x