Skip to content

feat(pdo): add set-fetch-mode statement wrapper#27

Merged
Chemaclass merged 1 commit into
mainfrom
feat/13-set-fetch-mode
Jun 3, 2026
Merged

feat(pdo): add set-fetch-mode statement wrapper#27
Chemaclass merged 1 commit into
mainfrom
feat/13-set-fetch-mode

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

Wraps PDOStatement::setFetchMode as pdo/set-fetch-mode: (set-fetch-mode stmt mode & args). Dispatches on the number of extra args to cover all PDO arities (mode alone; + colno for FETCH_COLUMN; + class + ctor-args for FETCH_CLASS/FETCH_INTO). Extra args go through phel->php, and the statement is returned so it threads through ->.

  • Removed from the "Not implemented yet" block in src/pdo/statement.phel.
  • Tests: set-fetch-mode-column-returns-scalar (FETCH_COLUMN) and set-fetch-mode-num-returns-positional-row (FETCH_NUM). They read through the raw fetch because pdo/fetch always requests FETCH_ASSOC.
  • README API table + CHANGELOG ## [Unreleased] updated.

Polish pass: no refactor needed - case on arg count keeps the variadic dispatch flat.

composer test green (43 assertions).

Closes #13

@Chemaclass Chemaclass added the enhancement New feature or request label Jun 3, 2026
@Chemaclass Chemaclass self-assigned this Jun 3, 2026
@Chemaclass Chemaclass merged commit 6e5eee1 into main Jun 3, 2026
1 check passed
@Chemaclass Chemaclass deleted the feat/13-set-fetch-mode branch June 3, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement statement/set-fetch-mode wrapper for PDOStatement::setFetchMode

1 participant