Skip to content

gleam db: AppError type, book_decoder, and map_error helper #17

@HeyItWorked

Description

@HeyItWorked

Sub-issue of #9

Scaffold db.gleam with shared infrastructure before the CRUD functions:

  • AppError custom type — NotFound | DatabaseError(String)
  • book_decoder() — decodes (id, title, author, status) row tuple into a Book using gleam/dynamic/decode, converts status string via status_from_string
  • map_error() — converts pog.QueryErrorAppError via string.inspect

Imports: gleam/dynamic/decode, gleam/result, gleam/string, models, pog

Metadata

Metadata

Assignees

Labels

db-layerDatabase/query layergleamGleam implementation

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions