Skip to content

Instantly share code, notes, and snippets.

-- This presents an example of rendering templates in the database.
-- DO NOT DO THIS! It's a terrible idea, and just example for my talk
-- which you can see at https://speakerdeck.com/andrewgodwin/dubious-database-design
CREATE EXTENSION plpythonu;
-- Table to store template HTML by name
CREATE TABLE templates (
"name" text PRIMARY KEY,
"template" text