Problem
RecordData returns internal Record errors through the public interface, but Apps have no stable public type, codes, or helpers to inspect them. Business logic cannot reliably distinguish not found, validation, permission, conflict, and temporary failures without matching error text or importing internal packages.
Required behavior
- Define stable Record operation errors in pkg/dygo.
- Expose documented codes and errors.As-compatible types or helper functions.
- Preserve safe details such as Entity, field, constraint, and Record identity when applicable.
- Convert internal database errors at the SDK boundary.
- Do not expose SQL text, database driver details, or secrets.
- Use the same public error contract for direct RecordData calls and transaction callbacks.
Acceptance criteria
- App code can branch on not found, validation, permission denied, and conflict errors.
- Error matching does not depend on message text.
- Internal packages remain private.
- Existing HTTP error mapping continues to use the same stable semantics.
Problem
RecordData returns internal Record errors through the public interface, but Apps have no stable public type, codes, or helpers to inspect them. Business logic cannot reliably distinguish not found, validation, permission, conflict, and temporary failures without matching error text or importing internal packages.
Required behavior
Acceptance criteria