Repository navigation
Fix six more bugs (phone DB push on reads, JSON export, json/xml/geometric edits, env bools, SQLite row counts) - #6
Merged
Conversation
…dits, env bools, SQLite row counts - On-device SQLite pushes the file back only when a statement changed it (total_changes / schema_version / write keyword), once per transaction. - JSON export writes DateTime/BigInt as text and keeps repeated columns. - Postgres cell edits on json and xml columns compare as jsonb / text. - DBSCOPE_AUTO_READ_ONLY and DBSCOPE_AUTO_ASSIGN_IP accept 1/0, yes/no. - SqliteExecutor reports 0 affected rows for DDL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EqzDdWjzbRhR11uqy5k4wL
…to claude/project-thread-sroiel # Conflicts: # CHANGELOG.md
The optimistic guard has no usable = for point/line/lseg/box/path/polygon/ circle, and the driver can't bind most of them back. Send the old value as Postgres text and compare the server's text of both sides. The editor starts from Postgres syntax instead of the driver's toString. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EqzDdWjzbRhR11uqy5k4wL
…to claude/project-thread-sroiel # Conflicts: # CHANGELOG.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EqzDdWjzbRhR11uqy5k4wL
…to claude/project-thread-sroiel # Conflicts: # CHANGELOG.md
This was referenced Nov 3, 2026
robertsolves
changed the base branch from
claude/project-thread-ecky3x
to
main
November 3, 2026 09:13
4 tasks done
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.
Requested by Robert · project thread
What & why
Follow-up to #5, which is now merged. This PR targets
main.DeviceSqliteExecutortookaffectedRows > 0to mean "wrote", but SQLite reports a SELECT's row count there. It now decides from what the statement did: SQLite'stotal_changes()orschema_versionmoved, or a write keyword with no counter (VACUUM, ANALYZE,PRAGMA x = y). Writes insideBEGIN … COMMITpush once, at the COMMIT, rather than sending the device an uncommitted file. The old keyword check also only skipped--comments, so a/* … */ SELECTpushed too.DateTime, whichjsonEncoderefuses. The export now writes non-JSON values as text (dates as UTC ISO-8601) and suffixes repeated column names instead of lettingb.idoverwritea.id. Newlib/grid/export_json.dart, used by the io and web exporters.col IS NOT DISTINCT FROM $olderrors with "operator does not exist" for these types. Most geometric types fail even earlier: the driver can't bind them back ("Could not infer type of value").jsonb, and xml astext.lib/db/pg_geometry.dart). The guard compares the server's text of both sides:col::text IS NOT DISTINCT FROM ($n::point)::text.(1,2)works. Before, it started fromPoint(1.0,2.0), which Postgres rejects.DBSCOPE_AUTO_READ_ONLY=1opened the connection writable. Only the exact stringtruecounted. It now accepts true/1/yes/on and false/0/no/off in any case, and anything else falls back to the name heuristic.DBSCOPE_AUTO_ASSIGN_IPuses the same parser.sqlite3_changes()keeps the count from the last write, so aCREATE TABLEafter an UPDATE of 5 rows said 5. It now reports 0 unless this statement changed rows.Records: closed the BUGS.md entry for the phone push. BUGS.md has no open entries now. Added 6 changelog lines, and updated the on-device write path in
docs/architecture.md.How it was tested
test/device_sqlite_push_test.dartruns the real executor against a fake device backend: reads don't push, writes push once, a transaction pushes once at COMMIT. It fails on the old code (4 pushes for 4 reads).test/dml_live_pg_test.dartsaves json, xml and all seven geometric types against a real Postgres, and checks that a stale old value is still a conflict. It is skipped unlessDBSCOPE_LIVE_PGis set. I ran it against a local Postgres 16; on the old code it fails with the operator error. There are also SQL-shape cases indml_test.pg_geometry_test,export_json_test,cli_auto_connect_test,sqlite_executor_test.Checklist
fvm flutter analyzeis clean (and the sqflite plugin package)fvm flutter testpasses (306 passed, 16 skipped live-PG)🤖 Generated with Claude Code
https://claude.ai/code/session_01EqzDdWjzbRhR11uqy5k4wL