Skip to content

Type safe getters for JSON fields #377

Description

@g105b

I've been working on an application where we've started adding JSON fields to our database, and I've seen a developer writing this:

$tagList = $row->getString("tags") ? json_decode($row->getString("tags")) : [];

An obvious code smell that would be greatly improved by some json functionality in the database layer.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNon-breaking improvements to existing behaviour

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions