Skip to content

Type safe getters for JSON fields #377

@g105b

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.

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