Commit 062f94b3
062f94b3d40fMerged
Sam Ruby <[email protected]> · 6 months ago · 2 files · ~2 modified
Description
review: drop misleading blog.rb reference; declare sqlite3_bind_text
Two Gemini review findings on #576:
-
test docstring claimed the round-trip is verified by examples/ffi/sqlite/blog.rb, but blog.rb uses inline-escape and its
-1argument passes to sqlite3_prepare_v2's nByte (an:int- typed length, not a:ptrsentinel). The actual empirical verification was a throwaway spike during development against sqlite3_bind_text with the literal -1. Replace the misleading reference with the specific case that was checked. -
sqlite3_lib.rb's updated comment describes bind_text as "supported" without sqlite3_bind_text being declared in the module — a reader following the comment would hit an undefined- method error. Add the ffi_func declaration so the comment matches the module's surface.
Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]
Details
- Commit
- 062f94b3d40f
- Parent
- 8379ca6e8502
examples/ffi/sqlite/sqlite3_lib.rbmodifiedView file
ffi_func :sqlite3_close, [:ptr], :int ffi_func :sqlite3_exec, [:ptr, :str, :ptr, :ptr, :ptr], :int ffi_func :sqlite3_prepare_v2, [:ptr, :str, :int, :ptr, :ptr], :int ffi_func :sqlite3_bind_text, [:ptr, :int, :str, :int, :ptr], :int ffi_func :sqlite3_step, [:ptr], :int ffi_func :sqlite3_finalize, [:ptr], :int ffi_func :sqlite3_column_int, [:ptr, :int], :inttest/ffi_ptr_int_literal.rbmodifiedView file
Loading diff…