Skip to content

Commit 94746f4

Browse files
committed
Small changes to docstring and comments.
1 parent f414bbe commit 94746f4

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

ext/sqlite3/statement.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -460,13 +460,13 @@ bind_parameter_count(VALUE self)
460460
return INT2NUM(sqlite3_bind_parameter_count(ctx->st));
461461
}
462462

463-
/** call-seq: stmt.params
463+
/** call-seq: stmt.named_params
464464
*
465-
* Return the list of named alphanumeric parameters in the statement.
466-
* This returns a list of strings.
465+
* Return the list of named parameters in the statement.
466+
* This returns a frozen array of strings (without the leading prefix character).
467467
* The values of this list can be used to bind parameters
468-
* to the statement using bind_param. Numeric and anonymous parameters
469-
* are ignored.
468+
* to the statement using bind_param. Positional (?NNN) and anonymous (?)
469+
* parameters are excluded.
470470
*
471471
*/
472472
static VALUE
@@ -484,10 +484,9 @@ named_params(VALUE self)
484484
// The first host parameter has an index of 1, not 0.
485485
for (int i = 1; i <= param_count; i++) {
486486
const char *name = sqlite3_bind_parameter_name(ctx->st, i);
487-
// We ignore numbered parameters (starting with ?)
488-
// And null values, since there can be gaps in the list
487+
// We ignore positional and anonymous parameters, and also null values, since there can be
488+
// gaps in the list.
489489
if (name && *name != '?') {
490-
// We ignore numeric parameters
491490
VALUE param = interned_utf8_cstr(name + 1);
492491
rb_ary_push(params, param);
493492
}

0 commit comments

Comments
 (0)