Home / Learn Secure SQL / JSON Columns: a Brief Introduction

JSON Columns: a Brief Introduction

Storing semi-structured data inside a relational column.

Bottom lineStoring semi-structured data inside a relational column.

Breaking it down

A JSON columnapplication builds aJSON valuesent as one boundparameterstored in aJSON/JSONB column
A JSON column

The basic idea

Modern databases can store and query JSON documents inside a column, blending relational and document-style storage.

Why this comes up

JSON columns are convenient for flexible or rarely-queried data, but every value still reaches the database the same safe way: as a bound parameter, never built into the query text.

The mechanics

Store the JSON as a bound parameter value; use the database's JSON functions to query inside it when needed.

Where it is used

  • Web application code review
  • Backend development
  • Database administration
A JSON columnSQL: edit and run

The whole JSON document was sent as a single value; json_extract reads inside it safely.

Quick check

1. A JSON value going into a JSON column should be sent...