Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Return JSON natively from Postgres in Python
CREATE TABLE author (
id INTEGER NOT NULL,
name VARCHAR(255) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE book (
id INTEGER NOT NULL,
name VARCHAR(255) NOT NULL,
author_id INTEGER,
PRIMARY KEY (id),
FOREIGN KEY(author_id) REFERENCES author (id)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.