Skip to content

Fix name collisions, SQLite :execresult with RETURNING, cross-fiber transactions and late PostgreSQL enum arrays - #53

Merged
devin-ai-integration[bot] merged 4 commits into
mainfrom
devin/1793747716-fix-sweep-bugs
Nov 4, 2026
Merged

devin-ai-integration[bot] merged 4 commits into
mainfrom
devin/1793747716-fix-sweep-bugs

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This fixes the five bugs found by the latest independent pre-release check. Each bug has a new E2E test in tests/end2end_*.rb, and each of those tests fails on main until its fix is applied.

Bug Test Fix
With a table exceptions, a raise inside transaction committed instead of rolling back, because the generated Exception model shadowed ::Exception (all engines) test_models_named_like_core_constants_do_not_shadow_them (pg, mysql2, sqlite3) Generated Ruby and RBS now refer to core and driver constants with a leading :: (::Exception, ::Thread, ::Data, ::Struct, ::Set, ::Monitor, ::PG, ::ConnectionPool, ...), in the driver templates and in TypeResolver#driver_type
Other table names (data, structs, threads, processes, standard_errors, sets, strings, integers, times, encodings, monitors, mutexes, connection_pools) broke loading, transactions or the logger same test. The example schemas now include 14 tables with these names same fix
SQLite :execresult with RETURNING never ran the statement test_execresult_with_returning_runs_the_statement (sqlite3), new CreateTagResult query Sqlite3#exec_result_lines now runs the statement to the end (.to_a) when it returns columns
A tx used from an Enumerator, Fiber, Thread or Async task ran its queries on another pooled connection, outside the transaction (pg, mysql2). SQLite raised ThreadError or hung test_transaction_query_object_works_from_other_fibers_and_threads (pg, mysql2, sqlite3) transaction now yields a copy of the query object bound to a TransactionConnection. It runs queries from any fiber or thread one at a time (mutex), unlocks while a nested savepoint block runs, and raises TransactionEnded once the transaction is over. The README documents that other query objects used from other fibers still run outside the transaction
PostgreSQL enum arrays came back as a raw "{a,b}" string when the enum was created after the connection was configured test_enum_arrays_of_a_type_created_after_connecting_are_decoded (pg, late schema) Unknown result oids now fall back to a NewTypes (PG::TypeMapInRuby) map. It looks each oid up in pg_type once per connection, so arrays of the type become Array[String]

Behavior change: the tx yielded by transaction is no longer self. Code that keeps tx after the block now gets TransactionEnded instead of silently running outside the transaction.

Also in this PR:

  • tests/rbs_types.rb strips the leading :: from RBS types before checking them.
  • Examples, golden files, test/fixtures/*.bin and steep_expectations.yml are regenerated.
  • README.md, docs/Coverage.md and docs/Testing.md are updated.
  • main is merged in, including the cross-platform CI from CI: run codegen checks and E2E on macOS and Windows #50.

Checklist

  • examples/ is regenerated (rake sqlc_generate_process) and committed
  • Tests added or updated (rake test, and rake end2end_* when the generated code changes)
  • The generated code stays RuboCop-clean (rake rubocop) and Steep-clean (rake steep)
  • Labelled (bug, enhancement, documentation, or breaking) so the release notes are grouped correctly

devin-ai-integration Bot and others added 2 commits November 3, 2026 23:48
…ransactions and late PostgreSQL enum arrays

Co-Authored-By: Doron Eli Rachman <doron050@gmail.com>
Co-Authored-By: Doron Eli Rachman <doron050@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot added the bug Something isn't working label Nov 3, 2026
devin-ai-integration Bot and others added 2 commits November 3, 2026 23:51
Co-Authored-By: Doron Eli Rachman <doron050@gmail.com>
…nRuby subclass on first use

Co-Authored-By: Doron Eli Rachman <doron050@gmail.com>
@devin-ai-integration
devin-ai-integration Bot merged commit 7bc7c7d into main Nov 4, 2026
41 checks passed
@devin-ai-integration
devin-ai-integration Bot deleted the devin/1793747716-fix-sweep-bugs branch November 4, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant