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:

  1. test docstring claimed the round-trip is verified by examples/ffi/sqlite/blog.rb, but blog.rb uses inline-escape and its -1 argument passes to sqlite3_prepare_v2's nByte (an :int- typed length, not a :ptr sentinel). 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.

  2. 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

@@ -23,6 +23,7 @@
2323 ffi_func :sqlite3_close, [:ptr], :int
2424 ffi_func :sqlite3_exec, [:ptr, :str, :ptr, :ptr, :ptr], :int
2525 ffi_func :sqlite3_prepare_v2, [:ptr, :str, :int, :ptr, :ptr], :int
26+ ffi_func :sqlite3_bind_text, [:ptr, :int, :str, :int, :ptr], :int
2627 ffi_func :sqlite3_step, [:ptr], :int
2728 ffi_func :sqlite3_finalize, [:ptr], :int
2829 ffi_func :sqlite3_column_int, [:ptr, :int], :int