Skip to content

feat(pdo): statement-level error-code/error-info via polymorphic dispatch#28

Merged
Chemaclass merged 1 commit into
mainfrom
feat/14-statement-errors
Jun 3, 2026
Merged

feat(pdo): statement-level error-code/error-info via polymorphic dispatch#28
Chemaclass merged 1 commit into
mainfrom
feat/14-statement-errors

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

Wraps PDOStatement::errorCode / errorInfo. Same approach as #12: instead of new names colliding in the single phel.pdo namespace, error-code / error-info now dispatch on the handle.

(pdo/error-code conn)   ;; connection (unchanged)
(pdo/error-code stmt)   ;; statement

Generalized the attr-target helper from #12 into handle-target (resolves :pdo vs :stmt), now shared by the attribute and error accessors.

  • Removed both methods from the "Not implemented yet" block in src/pdo/statement.phel.
  • Tests: statement-error-code-on-constraint-violation and statement-error-info-on-constraint-violation, mirroring the existing connection-level error tests (UNIQUE violation via a prepared statement). Existing connection error tests still green.
  • README + CHANGELOG (### Changed) updated.

Polish pass: renamed attr-target -> handle-target and reused it, so error and attribute accessors share one resolver.

composer test green (45 assertions).

Closes #14

@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 c8f160a into main Jun 3, 2026
1 check passed
@Chemaclass Chemaclass deleted the feat/14-statement-errors branch June 3, 2026 05:14
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-level error-code / error-info

1 participant