You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(spinel): column_value hands back native types — and unpin pluck's RBS
The FFI Db shim returned every column as text, a placeholder its own
comment flagged as "until per-column sqlite3_column_type dispatch is
wired". Both gem-backed shims (db_cruby, db_jruby) already answered the
native-type contract, and sqlite_adapter's select_rows comment already
claimed all of them did. Wire the dispatch so the claim is true.
Two changes, because the first alone did nothing:
1. Db.column_value dispatches on sqlite3_column_type (storage class),
returning Integer/Float/String/nil. Storage class, NOT decltype: the
declared type diverges from the gem shims exactly when the two
disagree, and it cannot detect NULL at all — which is the whole
reason the nullable reads need a per-row probe. Same price
column_int_opt already pays.
2. Relation's RBS pinned pluck to Array[String] and pick to String?,
which FORCED the coercion straight back — measured, still String
after change 1. Both are untyped now, which is what the catalog
(src/catalog/mod.rs, ArrayOfUntyped) already said; the sidecar was
the outlier.
Measured on the lobsters AOT lane: recent_threads' pluck(:thread_id)
went from "19948" to 19948, so the thread_ids it returns once again
match the Integer keys model attributes carry. Also closes a second
silent one on a different path — tag.rb's all_with_filtered_counts_for
looks up counts[t.id] against group(:tag_id).group_count, whose keys
were Strings, so filtered_count read 0 for every tag.
/threads itself stays empty: it is blocked behind matz/spinel#3505, a
nil returned through a block typed Integer? that is a different Hash
key than a literal nil. This clears the layer behind that one.
All 26 lobsters routes byte-identical before/after; cargo test green.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments