Turn PostgreSQL snippets into images worth sharing, without leaving your Mac.
Postgres-specific syntax is worth screenshotting precisely because it is not portable SQL. The window functions and CTEs are the point.
Codeshot detects PostgreSQL from the code you paste, so there is no language picker to get wrong. Here is the same snippet in three of the 30 themes it ships with, rendered with the app's own stylesheets.
WITH recent AS (
SELECT theme, created_at
FROM snapshots
WHERE created_at >= NOW() - INTERVAL'30 days'
)
SELECT theme,
COUNT(*) AS total,
RANK() OVER (ORDERBY COUNT(*) DESC) AS position
FROM recent
GROUPBY theme;
Edge · dark
WITH recent AS (
SELECT theme, created_at
FROM snapshots
WHERE created_at >= NOW() - INTERVAL'30 days'
)
SELECT theme,
COUNT(*) AS total,
RANK() OVER (ORDERBY COUNT(*) DESC) AS position
FROM recent
GROUPBY theme;
GitHub · dark
WITH recent AS (
SELECT theme, created_at
FROM snapshots
WHERE created_at >= NOW() - INTERVAL'30 days'
)
SELECT theme,
COUNT(*) AS total,
RANK() OVER (ORDERBY COUNT(*) DESC) AS position
FROM recent
GROUPBY theme;
Solarized · dark
Choosing a theme for PostgreSQL
Format the query before you capture it. A CTE that wraps mid-line is unreadable as an image, and unlike text nobody can reformat it themselves.
Getting the size right
Let the image follow your content, or lock it to a ratio — 1:1, 4:3, 3:2, 16:9, 9:16, 2:3, or 3:4 — then export at 1×, 2×, or 3× so it stays sharp on a retina display. Copy it straight to the clipboard with ⌘⇧C, or save with ⌘S.