rails-ai-context 5.12.0 → 5.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4544796594e923abe87c73ee94e07d87c3cec17aa0df7ad2d631dad8fbb4fee5
4
- data.tar.gz: 4a41fc88963c28d5f3725ca1f6899c18d2d5b65a9ab201b9210d76f340e8229b
3
+ metadata.gz: 16b12889884c4694d6e4a0c9e7f13f5eeefadfc2335e3a1706e94f7d50ce0696
4
+ data.tar.gz: 7dcef331b58f8fb58d2cc4708bb2081a47ea45807fdb8feca42f31a3fe3185cd
5
5
  SHA512:
6
- metadata.gz: 5bb1a0735533dcac1f9b35e639e15feb46c0f55e72686db352d3f312ccb737392f3783fd931ce0403141ccdb0a4bd46d95d85455519d0ebdb9e21a30c23d9d7d
7
- data.tar.gz: 03cc5484cc2774320155ac1272564d58b82e5418a1a8e815f88e32fd7ed849a795f939fb32823beb53557a514050336f239c62bf9f06c0314ec8d96b23eb60cb
6
+ metadata.gz: 76ffa75a43e4f58344addab5a5dcd1a305b390bb987b33be27ecab456ba3e8cd07b99791e410d11a91591211131c4cc9304ba79dbc760349fa1dbe18d7d3d7c2
7
+ data.tar.gz: 34e7d398f0d6157f36d9f4a606f8f53b6f5d59fdafeb156e4fd654547e1d837254e407e647bda55bfc624909bb3b6dcaa20f00a92f4ccc5630e27997188afd63
data/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [5.12.1] - 2026-07-10
9
+
10
+ ### Fixed
11
+
12
+ - `rails_query` no longer fails on MySQL with `Transaction characteristics can't be changed while a transaction is in progress`. `execute_mysql` issued `SET TRANSACTION READ ONLY` inside `conn.transaction`, but Rails materializes the lazy `BEGIN` before the first in-block statement, so MySQL (error 1568) rejected the SET on every call -- a 100% failure rate for plain queries and `explain: true`. The SET now runs before the transaction opens; without `GLOBAL`/`SESSION` scope it applies only to the next transaction, which the query transaction immediately consumes, so the read-only guard still holds and nothing leaks onto the pooled connection. PostgreSQL (where `SET TRANSACTION` applies to the current transaction) and SQLite are unaffected. (#89)
13
+ - The static `schema.rb` parser now recognizes the PostgreSQL `timestamptz` and `tsvector` column types. `t.timestamptz` and `t.tsvector` columns were dropped from the parsed schema because the DSL listener's column-type set omitted them, so schema-backed tools under-reported columns on Postgres apps using `timestamp with time zone` or full-text search vectors. (#88)
14
+
8
15
  ## [5.12.0] - 2026-06-29
9
16
 
10
17
  ### Fixed
@@ -8,10 +8,10 @@ module RailsAiContext
8
8
  class SchemaDslListener < BaseListener
9
9
  COLUMN_TYPES = %w[
10
10
  string integer text boolean datetime date decimal float binary
11
- references belongs_to jsonb json uuid bigint timestamp time
11
+ references belongs_to jsonb json uuid bigint timestamp timestamptz time
12
12
  inet cidr macaddr hstore ltree numrange tsrange daterange
13
13
  bit bit_varying money oid xml point line lseg box path
14
- polygon circle interval serial virtual primary_key
14
+ polygon circle interval serial tsvector virtual primary_key
15
15
  ].to_set.freeze
16
16
 
17
17
  def on_call_node_enter(node)
@@ -307,9 +307,16 @@ module RailsAiContext
307
307
  sql
308
308
  end
309
309
 
310
+ # The SET must run BEFORE the transaction opens: Rails materializes
311
+ # the lazy BEGIN ahead of the first in-block statement, and MySQL
312
+ # rejects changing transaction characteristics mid-transaction
313
+ # (error 1568). Without GLOBAL/SESSION scope the SET applies only to
314
+ # the next transaction, which the block below immediately consumes,
315
+ # so the read-only characteristic cannot leak onto the pooled
316
+ # connection. (#89)
310
317
  result = nil
318
+ conn.execute("SET TRANSACTION READ ONLY")
311
319
  conn.transaction do
312
- conn.execute("SET TRANSACTION READ ONLY")
313
320
  result = conn.select_all(hinted_sql)
314
321
  raise ActiveRecord::Rollback
315
322
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsAiContext
4
- VERSION = "5.12.0"
4
+ VERSION = "5.12.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-ai-context
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.12.0
4
+ version: 5.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - crisnahine