From db122778c08a1838295cc785f946826a277fe4a3 Mon Sep 17 00:00:00 2001 From: logelog <194732487+logelog@users.noreply.github.com> Date: Fri, 11 Sep 2026 16:35:59 +0200 Subject: [PATCH 1/2] Reduce repeated widget reads and archive formatting during renders --- .changeset/archive-month-labels.md | 5 + .changeset/quiet-widgets-share.md | 5 + infra/perf-monitor/probe/src/measure.ts | 4 +- packages/core/src/astro/prefetch.ts | 4 +- packages/core/src/widgets/archives.ts | 19 ++- packages/core/src/widgets/index.ts | 12 +- .../tests/unit/perf-monitor-measure.test.ts | 35 ++++ .../core/tests/unit/widgets/archives.test.ts | 21 ++- .../unit/widgets/widget-request-cache.test.ts | 154 ++++++++++++++++++ scripts/query-counts.mjs | 45 +++-- scripts/query-counts.queries.d1.json | 113 +++++++++---- scripts/query-counts.snapshot.d1.json | 34 ++-- 12 files changed, 367 insertions(+), 84 deletions(-) create mode 100644 .changeset/archive-month-labels.md create mode 100644 .changeset/quiet-widgets-share.md create mode 100644 packages/core/tests/unit/perf-monitor-measure.test.ts create mode 100644 packages/core/tests/unit/widgets/widget-request-cache.test.ts diff --git a/.changeset/archive-month-labels.md b/.changeset/archive-month-labels.md new file mode 100644 index 0000000000..701a5eecae --- /dev/null +++ b/.changeset/archive-month-labels.md @@ -0,0 +1,5 @@ +--- +"emdash": patch +--- + +Reduces Archives widget rendering work on sites with many posts by formatting each displayed month label once. Archive links, ordering, and post counts stay the same. diff --git a/.changeset/quiet-widgets-share.md b/.changeset/quiet-widgets-share.md new file mode 100644 index 0000000000..e7df1fb9b8 --- /dev/null +++ b/.changeset/quiet-widgets-share.md @@ -0,0 +1,5 @@ +--- +"emdash": patch +--- + +Reduces duplicate database reads when widget areas render while layout prefetch is still running on remote database adapters. diff --git a/infra/perf-monitor/probe/src/measure.ts b/infra/perf-monitor/probe/src/measure.ts index 9395fbd5b4..ed8799aa0d 100644 --- a/infra/perf-monitor/probe/src/measure.ts +++ b/infra/perf-monitor/probe/src/measure.ts @@ -101,8 +101,8 @@ async function measureTtfb(url: string): Promise<{ const response = await fetch(url, { method: "GET", headers: { + Accept: "text/html", "User-Agent": "emdash-perf-probe/1.0", - // Bust any edge cache "Cache-Control": "no-cache", }, redirect: "follow", @@ -149,7 +149,7 @@ export async function measureRoutes(req: MeasureRequest): Promise for (const route of req.routes) { const url = `${req.targetUrl}${route.path}`; - // Cold request -- add a unique query param to avoid any isolate reuse + // A distinct URL does not guarantee a fresh Worker isolate. const coldUrl = url + (url.includes("?") ? "&" : "?") + `_perf_cold=${Date.now()}`; const cold = await measureTtfb(coldUrl); diff --git a/packages/core/src/astro/prefetch.ts b/packages/core/src/astro/prefetch.ts index 88265b2993..fbfe4f00d7 100644 --- a/packages/core/src/astro/prefetch.ts +++ b/packages/core/src/astro/prefetch.ts @@ -25,14 +25,14 @@ import { getDb } from "../loader.js"; import { getMenu } from "../menus/index.js"; -import { setRequestCacheEntry } from "../request-cache.js"; +import { requestCached, setRequestCacheEntry } from "../request-cache.js"; import { getSiteSettings } from "../settings/index.js"; import { getTaxonomyDefs, getTaxonomyTerms } from "../taxonomies/index.js"; import { getWidgetAreas } from "../widgets/index.js"; /** Warm widget areas: one bulk load, primed under each per-area cache key. */ async function prefetchWidgetAreas(): Promise { - const areas = await getWidgetAreas(); + const areas = await requestCached("widget-areas", getWidgetAreas); // getWidgetArea(name) caches under `widget-area:${name}` and returns the same // WidgetArea shape getWidgetAreas yields, so priming here makes those calls hit. for (const area of areas) { diff --git a/packages/core/src/widgets/archives.ts b/packages/core/src/widgets/archives.ts index 0b4aa5b22e..cab20d4e12 100644 --- a/packages/core/src/widgets/archives.ts +++ b/packages/core/src/widgets/archives.ts @@ -29,29 +29,23 @@ export function groupEntriesByPublishedAt( ): ArchiveGroup[] { const type = options.type ?? "monthly"; const limit = options.limit ?? 12; - const archives = new Map(); + const archives = new Map(); for (const entry of entries) { const date = toPublishedDate(entry.data.publishedAt); if (!date) continue; let key: string; - let label: string; let url: string; if (type === "yearly") { const year = date.getFullYear(); key = `${year}`; - label = `${year}`; url = `/archives/${year}`; } else { const year = date.getFullYear(); const month = date.getMonth() + 1; key = `${year}-${month.toString().padStart(2, "0")}`; - label = date.toLocaleDateString("en-US", { - year: "numeric", - month: "long", - }); url = `/archives/${year}/${month.toString().padStart(2, "0")}`; } @@ -59,9 +53,16 @@ export function groupEntriesByPublishedAt( if (existing) { existing.count++; } else { - archives.set(key, { label, count: 1, url }); + archives.set(key, { date, count: 1, url }); } } - return [...archives.values()].slice(0, limit); + return [...archives.values()].slice(0, limit).map(({ date, count, url }) => ({ + label: + type === "yearly" + ? `${date.getFullYear()}` + : date.toLocaleDateString("en-US", { year: "numeric", month: "long" }), + count, + url, + })); } diff --git a/packages/core/src/widgets/index.ts b/packages/core/src/widgets/index.ts index 1fa6ace31b..88515af2c3 100644 --- a/packages/core/src/widgets/index.ts +++ b/packages/core/src/widgets/index.ts @@ -1,7 +1,7 @@ import { widgetAreaTag } from "../cache/chrome-tags.js"; import { getDb } from "../loader.js"; import type { CacheHint } from "../query.js"; -import { requestCached } from "../request-cache.js"; +import { peekRequestCache, requestCached } from "../request-cache.js"; import { getWidgetComponents as getComponentRegistry } from "./components.js"; import type { Widget, WidgetArea, WidgetRow, WidgetComponentDef } from "./types.js"; @@ -26,6 +26,16 @@ export type { */ export async function getWidgetArea(name: string): Promise { return requestCached(`widget-area:${name}`, async () => { + const prefetched = peekRequestCache("widget-areas"); + if (prefetched) { + try { + const areas = await prefetched; + return areas.find((area) => area.name === name) ?? null; + } catch { + // Optional prefetch failure must still allow the scoped read. + } + } + const db = await getDb(); const rows = await db .selectFrom("_emdash_widget_areas as a") diff --git a/packages/core/tests/unit/perf-monitor-measure.test.ts b/packages/core/tests/unit/perf-monitor-measure.test.ts new file mode 100644 index 0000000000..59dac7611f --- /dev/null +++ b/packages/core/tests/unit/perf-monitor-measure.test.ts @@ -0,0 +1,35 @@ +import { createServer } from "node:http"; +import { promisify } from "node:util"; + +import { expect, it } from "vitest"; + +import { measureRoutes } from "../../../../infra/perf-monitor/probe/src/measure.js"; + +it("measures the HTML response on both cold and warm page requests", async () => { + let htmlRequests = 0; + const server = createServer((request, response) => { + const acceptsHtml = request.headers.accept?.split(",", 1)[0]?.trim().startsWith("text/html"); + if (acceptsHtml) htmlRequests++; + response.writeHead(200, { + "Content-Type": acceptsHtml ? "text/html" : "application/json", + "Server-Timing": `render;dur=${acceptsHtml ? 12 : 1}`, + }); + response.end(acceptsHtml ? "

Rendered page

" : "{}"); + }); + await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve)); + try { + const address = server.address(); + if (!address || typeof address === "string") throw new Error("Missing test server address"); + const [result] = await measureRoutes({ + targetUrl: `http://127.0.0.1:${address.port}`, + routes: [{ path: "/", label: "Home" }], + warmRequests: 2, + }); + expect(htmlRequests).toBe(3); + expect(result?.coldServerTimings?.render?.dur).toBe(12); + expect(result?.warmServerTimings?.render?.dur).toBe(12); + } finally { + server.closeAllConnections(); + await promisify(server.close.bind(server))(); + } +}); diff --git a/packages/core/tests/unit/widgets/archives.test.ts b/packages/core/tests/unit/widgets/archives.test.ts index 49d021319f..867f266ccb 100644 --- a/packages/core/tests/unit/widgets/archives.test.ts +++ b/packages/core/tests/unit/widgets/archives.test.ts @@ -1,4 +1,4 @@ -import { describe, expect, it } from "vitest"; +import { afterEach, describe, expect, it, vi } from "vitest"; import { groupEntriesByPublishedAt } from "../../../src/widgets/archives.js"; @@ -7,6 +7,25 @@ function entry(publishedAt: unknown) { } describe("groupEntriesByPublishedAt", () => { + afterEach(() => vi.restoreAllMocks()); + + it("formats each displayed month once while counting all entries in that month", () => { + const format = vi.spyOn(Date.prototype, "toLocaleDateString"); + const entries = Array.from({ length: 100 }, () => entry(new Date(2026, 2, 15))); + entries.push(entry(new Date(2026, 1, 1)), entry(new Date(2026, 2, 20))); + + expect(groupEntriesByPublishedAt(entries, { limit: 1 })).toEqual([ + { label: "March 2026", count: 101, url: "/archives/2026/03" }, + ]); + expect(format).toHaveBeenCalledTimes(1); + }); + + it("does not format month labels when no groups are displayed", () => { + const format = vi.spyOn(Date.prototype, "toLocaleDateString"); + expect(groupEntriesByPublishedAt([entry(new Date(2026, 2, 15))], { limit: 0 })).toEqual([]); + expect(format).not.toHaveBeenCalled(); + }); + it("groups Date publishedAt values by month instead of skipping them", () => { const groups = groupEntriesByPublishedAt( [entry(new Date(2026, 2, 15)), entry(new Date(2026, 2, 20)), entry(new Date(2026, 1, 1))], diff --git a/packages/core/tests/unit/widgets/widget-request-cache.test.ts b/packages/core/tests/unit/widgets/widget-request-cache.test.ts new file mode 100644 index 0000000000..e68c13c099 --- /dev/null +++ b/packages/core/tests/unit/widgets/widget-request-cache.test.ts @@ -0,0 +1,154 @@ +import type { KyselyPlugin, QueryId } from "kysely"; +import { afterAll, afterEach, beforeEach, expect, it, vi } from "vitest"; + +import { + describeEachDialect, + destroySharedPool, + setupForDialect, + teardownForDialect, + type DialectTestContext, +} from "../../utils/test-db.js"; + +vi.mock("../../../src/loader.js", () => ({ getDb: vi.fn() })); +vi.mock("virtual:emdash/object-cache", () => ({ createObjectCache: undefined })); + +import { prefetchLayoutData } from "../../../src/astro/prefetch.js"; +import { getDb } from "../../../src/loader.js"; +import { runWithContext } from "../../../src/request-context.js"; +import { getWidgetArea } from "../../../src/widgets/index.js"; + +afterAll(destroySharedPool); + +describeEachDialect("widget area request cache", (dialect) => { + let ctx: DialectTestContext; + let queries: string[]; + let failBulkRead: boolean; + + beforeEach(async () => { + ctx = await setupForDialect(dialect); + await ctx.db + .insertInto("_emdash_widget_areas") + .values([ + { id: "footer", name: "footer", label: "Footer" }, + { id: "sidebar", name: "sidebar", label: "Sidebar" }, + { id: "empty", name: "empty", label: "Empty" }, + ]) + .execute(); + await ctx.db + .insertInto("_emdash_widgets") + .values([ + { id: "links", area_id: "footer", type: "menu", menu_name: "links", sort_order: 2 }, + { + id: "search", + area_id: "footer", + type: "component", + component_id: "core:search", + component_props: JSON.stringify({ placeholder: "Search" }), + sort_order: 1, + }, + { + id: "about", + area_id: "sidebar", + type: "content", + content: JSON.stringify([{ _type: "block", children: [] }]), + sort_order: 0, + }, + ]) + .execute(); + + queries = []; + failBulkRead = false; + const bulkReads = new WeakSet(); + const plugin: KyselyPlugin = { + transformQuery(args) { + const { sql } = ctx.db.getExecutor().compileQuery(args.node, args.queryId); + if (sql.includes("_emdash_widget")) queries.push(sql); + if (sql.includes('from "_emdash_widget_areas"') && !sql.includes(" join ")) { + bulkReads.add(args.queryId); + } + return args.node; + }, + async transformResult(args) { + if (failBulkRead && bulkReads.has(args.queryId)) throw new Error("Bulk read failed"); + return args.result; + }, + }; + vi.mocked(getDb).mockResolvedValue(ctx.db.withPlugin(plugin)); + }); + + afterEach(async () => { + await teardownForDialect(ctx); + vi.clearAllMocks(); + }); + + it("shares in-flight prefetch with concurrent named reads, including missing areas", async () => { + const footer = await getWidgetArea("footer"); + const sidebar = await getWidgetArea("sidebar"); + expect(footer?.widgets.map((widget) => widget.id)).toEqual(["search", "links"]); + queries = []; + + await runWithContext({ editMode: false }, async () => { + const [, actualFooter, actualSidebar, empty, missing] = await Promise.all([ + prefetchLayoutData(), + getWidgetArea("footer"), + getWidgetArea("sidebar"), + getWidgetArea("empty"), + getWidgetArea("missing"), + ]); + expect(actualFooter).toEqual(footer); + expect(actualSidebar).toEqual(sidebar); + expect(empty?.widgets).toEqual([]); + expect(missing).toBeNull(); + expect(queries).toHaveLength(2); + }); + }); + + it("shares the bulk load between repeated prefetch calls", async () => { + await runWithContext({ editMode: false }, async () => { + await Promise.all([prefetchLayoutData(), prefetchLayoutData()]); + expect(queries).toHaveLength(2); + }); + }); + + it("serves completed prefetch results without further queries", async () => { + await runWithContext({ editMode: false }, async () => { + await prefetchLayoutData(); + queries = []; + expect((await getWidgetArea("footer"))?.widgets).toHaveLength(2); + expect(await getWidgetArea("missing")).toBeNull(); + expect(queries).toHaveLength(0); + }); + }); + + it("falls back to a named read when the optional bulk load fails", async () => { + failBulkRead = true; + await runWithContext({ editMode: false }, async () => { + const [, footer] = await Promise.all([prefetchLayoutData(), getWidgetArea("footer")]); + expect(footer?.widgets.map((widget) => widget.id)).toEqual(["search", "links"]); + expect(await getWidgetArea("footer")).toBe(footer); + expect(queries).toHaveLength(2); + }); + }); + + it("keeps named reads scoped when no prefetch runs", async () => { + await runWithContext({ editMode: false }, async () => { + const [first, second] = await Promise.all([getWidgetArea("footer"), getWidgetArea("footer")]); + expect(first).toBe(second); + expect(queries).toHaveLength(1); + expect(queries[0]).toContain("where"); + }); + }); + + it("does not reuse prefetched data across requests", async () => { + await runWithContext({ editMode: false }, () => prefetchLayoutData()); + await ctx.db + .updateTable("_emdash_widget_areas") + .set({ label: "Updated" }) + .where("id", "=", "footer") + .execute(); + queries = []; + const area = await runWithContext({ editMode: false }, () => getWidgetArea("footer")); + expect(area?.label).toBe("Updated"); + expect(queries).toHaveLength(1); + }); +}); diff --git a/scripts/query-counts.mjs b/scripts/query-counts.mjs index 6faa20cec3..c3b4ccbec4 100644 --- a/scripts/query-counts.mjs +++ b/scripts/query-counts.mjs @@ -72,27 +72,27 @@ const PORT = 14321; const BASE = `http://${HOST}:${PORT}`; const ROUTES = [ - ["GET", "/"], - ["GET", "/posts"], - ["GET", "/posts/building-for-the-long-term"], - ["GET", "/pages/about"], - ["GET", "/category/development"], - ["GET", "/tag/webdev"], - ["GET", "/rss.xml"], - ["GET", "/search?q=static"], + ["GET", "/", "text/html"], + ["GET", "/posts", "text/html"], + ["GET", "/posts/building-for-the-long-term", "text/html"], + ["GET", "/pages/about", "text/html"], + ["GET", "/category/development", "text/html"], + ["GET", "/tag/webdev", "text/html"], + ["GET", "/rss.xml", "application/rss+xml"], + ["GET", "/search?q=static", "text/html"], // Byline-avatar list pages. /contributors uses the avatar storage key folded // into byline hydration; /contributors-naive resolves each avatar with a // per-byline media lookup. The gap between them is the N+1 the join removes. - ["GET", "/contributors"], - ["GET", "/contributors-naive"], + ["GET", "/contributors", "text/html"], + ["GET", "/contributors-naive", "text/html"], ]; const TRACKED_PHASES = new Set(["cold", "warm"]); const VALID_TARGETS = new Set(["sqlite", "d1"]); const QUERY_LOG_PREFIX = "[emdash-query-log] "; // Emitted by stream-end-metrics.ts when the response body finishes -// streaming — captures the FULL request cost, including queries issued -// during body streaming that Server-Timing headers can't see. +// streaming, including queries that Server-Timing headers can't see. +// Deferred work that outlives the response body is not included. const STREAM_END_PREFIX = "[emdash-stream-end] "; /** @@ -347,7 +347,7 @@ function startServer({ collectedEvents, streamEndSnapshots = [] }) { return { ready, stop }; } -async function hit(method, path, phase) { +async function hit(method, path, accept, phase) { // Tiny retry for the very first hit against a just-spawned wrangler // preview — "ready" fires before the HTTP listener actually accepts // on some runs. We're not measuring these retry attempts (they're @@ -358,7 +358,7 @@ async function hit(method, path, phase) { try { response = await fetch(`${BASE}${path}`, { method, - headers: { "x-perf-phase": phase }, + headers: { Accept: accept, "x-perf-phase": phase }, redirect: "manual", }); } catch (err) { @@ -507,8 +507,8 @@ async function runSqlite(events, streamEndSnapshots) { try { await server.ready; await warmup(); - for (const [m, p] of ROUTES) await hit(m, p, "cold"); - for (const [m, p] of ROUTES) await hit(m, p, "warm"); + for (const [m, p, accept] of ROUTES) await hit(m, p, accept, "cold"); + for (const [m, p, accept] of ROUTES) await hit(m, p, accept, "warm"); } finally { await server.stop(); } @@ -534,13 +534,13 @@ async function runD1(events, streamEndSnapshots) { if (skipBuild) assertExistingBuildMatchesTarget(); else buildFixture(); - for (const [m, p] of ROUTES) { + for (const [m, p, accept] of ROUTES) { process.stdout.write(`--- fresh isolate for ${m} ${p} ---\n`); const server = startServer({ collectedEvents: events, streamEndSnapshots }); try { await server.ready; - await hit(m, p, "cold"); - await hit(m, p, "warm"); + await hit(m, p, accept, "cold"); + await hit(m, p, accept, "warm"); } finally { await server.stop(); } @@ -548,9 +548,8 @@ async function runD1(events, streamEndSnapshots) { } /** - * Print the per-route stream-end snapshots (full request cost measured - * when the body finished streaming). Informational only — not part of - * the snapshot files, since timings are machine-dependent. The value is + * Print the per-route snapshots through the end of the response body. + * Timings are machine-dependent and are not saved in snapshot files. The value is * `dbCount` here vs. the header-time count: the difference is queries * issued during body streaming, invisible to Server-Timing. */ @@ -561,7 +560,7 @@ function reportStreamEnd(snapshots) { `${a.method} ${a.route} ${a.phase}`.localeCompare(`${b.method} ${b.route} ${b.phase}`), ); if (tracked.length === 0) return; - process.stdout.write("\nStream-end metrics (full request, incl. post-header queries):\n"); + process.stdout.write("\nStream-end metrics (through end of response body):\n"); for (const s of tracked) { const dbMs = typeof s.dbTotalMs === "number" ? s.dbTotalMs.toFixed(1) : "?"; const totalMs = typeof s.totalMs === "number" ? s.totalMs.toFixed(1) : "?"; diff --git a/scripts/query-counts.queries.d1.json b/scripts/query-counts.queries.d1.json index 4a53eb4060..985924b47d 100644 --- a/scripts/query-counts.queries.d1.json +++ b/scripts/query-counts.queries.d1.json @@ -1,6 +1,5 @@ { "GET / (cold)": { - "select \"a\".\"id\" as \"a_id\", \"a\".\"name\" as \"a_name\", \"a\".\"label\" as \"a_label\", \"a\".\"description\" as \"a_description\", \"w\".\"id\" as \"w_id\", \"w\".\"type\" as \"w_type\", \"w\".\"title\" as \"w_title\", \"w\".\"content\" as \"w_content\", \"w\".\"menu_name\" as \"w_menu_name\", \"w\".\"component_id\" as \"w_component_id\", \"w\".\"component_props\" as \"w_component_props\", \"w\".\"area_id\" as \"w_area_id\", \"w\".\"sort_order\" as \"w_sort_order\", \"w\".\"created_at\" as \"w_created_at\" from \"_emdash_widget_areas\" as \"a\" left join \"_emdash_widgets\" as \"w\" on \"w\".\"area_id\" = \"a\".\"id\" where \"a\".\"name\" = ? order by \"w\".\"sort_order\" asc": 1, "select \"name\", \"value\" from \"options\" where \"name\" in (...)": 2, "select \"name\", \"value\" from \"options\" where name LIKE ? ESCAPE '\\'": 1, "select \"plugin_id\", \"status\" from \"_plugin_state\"": 1, @@ -11,21 +10,28 @@ "select * from \"_emdash_menus\" where \"name\" = ? order by \"locale\" asc": 1, "select * from \"_emdash_migrations\" limit ?": 1, "select * from \"_emdash_redirects\" where \"enabled\" = ?": 1, + "select * from \"_emdash_taxonomy_defs\"": 1, + "select * from \"_emdash_widget_areas\"": 1, + "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, + "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC LIMIT ?": 1, "SELECT COUNT(*) as count FROM \"_emdash_migrations\"": 1, + "select distinct \"name\" from \"_emdash_menus\"": 1, "UPDATE _emdash_cron_tasks SET status = 'idle', locked_at = NULL WHERE status = 'running' AND locked_at < ?": 1 }, "GET / (warm)": { - "select \"a\".\"id\" as \"a_id\", \"a\".\"name\" as \"a_name\", \"a\".\"label\" as \"a_label\", \"a\".\"description\" as \"a_description\", \"w\".\"id\" as \"w_id\", \"w\".\"type\" as \"w_type\", \"w\".\"title\" as \"w_title\", \"w\".\"content\" as \"w_content\", \"w\".\"menu_name\" as \"w_menu_name\", \"w\".\"component_id\" as \"w_component_id\", \"w\".\"component_props\" as \"w_component_props\", \"w\".\"area_id\" as \"w_area_id\", \"w\".\"sort_order\" as \"w_sort_order\", \"w\".\"created_at\" as \"w_created_at\" from \"_emdash_widget_areas\" as \"a\" left join \"_emdash_widgets\" as \"w\" on \"w\".\"area_id\" = \"a\".\"id\" where \"a\".\"name\" = ? order by \"w\".\"sort_order\" asc": 1, "select \"value\" from \"options\" where \"name\" = ?": 1, "select * from \"_emdash_menu_items\" where \"menu_id\" = ? order by \"sort_order\" asc": 1, "select * from \"_emdash_menus\" where \"name\" = ? order by \"locale\" asc": 1, + "select * from \"_emdash_widget_areas\"": 1, + "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, + "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, - "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC LIMIT ?": 1 + "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC LIMIT ?": 1, + "select distinct \"name\" from \"_emdash_menus\"": 1 }, "GET /category/development (cold)": { - "select \"a\".\"id\" as \"a_id\", \"a\".\"name\" as \"a_name\", \"a\".\"label\" as \"a_label\", \"a\".\"description\" as \"a_description\", \"w\".\"id\" as \"w_id\", \"w\".\"type\" as \"w_type\", \"w\".\"title\" as \"w_title\", \"w\".\"content\" as \"w_content\", \"w\".\"menu_name\" as \"w_menu_name\", \"w\".\"component_id\" as \"w_component_id\", \"w\".\"component_props\" as \"w_component_props\", \"w\".\"area_id\" as \"w_area_id\", \"w\".\"sort_order\" as \"w_sort_order\", \"w\".\"created_at\" as \"w_created_at\" from \"_emdash_widget_areas\" as \"a\" left join \"_emdash_widgets\" as \"w\" on \"w\".\"area_id\" = \"a\".\"id\" where \"a\".\"name\" = ? order by \"w\".\"sort_order\" asc": 1, "select \"name\", \"collections\" from \"_emdash_taxonomy_defs\"": 1, "select \"name\", \"value\" from \"options\" where \"name\" in (...)": 2, "select \"name\", \"value\" from \"options\" where name LIKE ? ESCAPE '\\'": 1, @@ -37,31 +43,36 @@ "select * from \"_emdash_menus\" where \"name\" = ? order by \"locale\" asc": 1, "select * from \"_emdash_migrations\" limit ?": 1, "select * from \"_emdash_redirects\" where \"enabled\" = ?": 1, - "select * from \"_emdash_taxonomy_defs\" where \"name\" = ? order by \"locale\" asc": 1, + "select * from \"_emdash_taxonomy_defs\"": 1, + "select * from \"_emdash_widget_areas\"": 1, + "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, "select * from \"taxonomies\" where \"name\" = ? and \"slug\" = ? order by \"locale\" asc": 1, + "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "select * from \"taxonomies\" where \"parent_id\" = ? and \"locale\" = ? order by \"sort_order\" asc, \"label\" asc": 1, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT COUNT(*) as count FROM \"_emdash_migrations\"": 1, + "select distinct \"name\" from \"_emdash_menus\"": 1, "select distinct \"translation_group\" from \"taxonomies\" where \"name\" = ? and \"slug\" in (...)": 1, "SELECT taxonomy_id, SUM(count) AS count FROM ( SELECT ct.taxonomy_id AS taxonomy_id, COUNT(DISTINCT e.translation_group) AS count FROM content_taxonomies AS ct CROSS JOIN \"ec_posts\" AS e WHERE e.translation_group = ct.entry_id AND ct.collection = ? AND ct.taxonomy_id IN (SELECT translation_group FROM taxonomies WHERE name = ?) AND e.locale = ? AND \"e\".\"status\" = ? AND e.deleted_at IS NULL GROUP BY ct.taxonomy_id) AS per_collection GROUP BY taxonomy_id": 1, "UPDATE _emdash_cron_tasks SET status = 'idle', locked_at = NULL WHERE status = 'running' AND locked_at < ?": 1, "WITH picked AS ( SELECT r.id AS entry_id, \"r\".\"published_at\" AS sortval FROM content_taxonomies ct CROSS JOIN \"ec_posts\" AS r ON r.translation_group = ct.entry_id WHERE ct.collection = ? AND \"ct\".\"taxonomy_id\" = ? AND r.deleted_at IS NULL AND \"r\".\"status\" = ? ORDER BY sortval DESC, r.id DESC ) SELECT r.*, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"r\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"r\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"r\".id AND b.locale = \"r\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM picked JOIN \"ec_posts\" AS r ON r.id = picked.entry_id WHERE r.deleted_at IS NULL AND \"r\".\"status\" = ? ORDER BY picked.sortval DESC, picked.entry_id DESC": 1 }, "GET /category/development (warm)": { - "select \"a\".\"id\" as \"a_id\", \"a\".\"name\" as \"a_name\", \"a\".\"label\" as \"a_label\", \"a\".\"description\" as \"a_description\", \"w\".\"id\" as \"w_id\", \"w\".\"type\" as \"w_type\", \"w\".\"title\" as \"w_title\", \"w\".\"content\" as \"w_content\", \"w\".\"menu_name\" as \"w_menu_name\", \"w\".\"component_id\" as \"w_component_id\", \"w\".\"component_props\" as \"w_component_props\", \"w\".\"area_id\" as \"w_area_id\", \"w\".\"sort_order\" as \"w_sort_order\", \"w\".\"created_at\" as \"w_created_at\" from \"_emdash_widget_areas\" as \"a\" left join \"_emdash_widgets\" as \"w\" on \"w\".\"area_id\" = \"a\".\"id\" where \"a\".\"name\" = ? order by \"w\".\"sort_order\" asc": 1, "select \"value\" from \"options\" where \"name\" = ?": 1, "select * from \"_emdash_menu_items\" where \"menu_id\" = ? order by \"sort_order\" asc": 1, "select * from \"_emdash_menus\" where \"name\" = ? order by \"locale\" asc": 1, - "select * from \"_emdash_taxonomy_defs\" where \"name\" = ? order by \"locale\" asc": 1, + "select * from \"_emdash_widget_areas\"": 1, + "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, "select * from \"taxonomies\" where \"name\" = ? and \"slug\" = ? order by \"locale\" asc": 1, + "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "select * from \"taxonomies\" where \"parent_id\" = ? and \"locale\" = ? order by \"sort_order\" asc, \"label\" asc": 1, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, + "select distinct \"name\" from \"_emdash_menus\"": 1, "select distinct \"translation_group\" from \"taxonomies\" where \"name\" = ? and \"slug\" in (...)": 1, "SELECT taxonomy_id, SUM(count) AS count FROM ( SELECT ct.taxonomy_id AS taxonomy_id, COUNT(DISTINCT e.translation_group) AS count FROM content_taxonomies AS ct CROSS JOIN \"ec_posts\" AS e WHERE e.translation_group = ct.entry_id AND ct.collection = ? AND ct.taxonomy_id IN (SELECT translation_group FROM taxonomies WHERE name = ?) AND e.locale = ? AND \"e\".\"status\" = ? AND e.deleted_at IS NULL GROUP BY ct.taxonomy_id) AS per_collection GROUP BY taxonomy_id": 1, "WITH picked AS ( SELECT r.id AS entry_id, \"r\".\"published_at\" AS sortval FROM content_taxonomies ct CROSS JOIN \"ec_posts\" AS r ON r.translation_group = ct.entry_id WHERE ct.collection = ? AND \"ct\".\"taxonomy_id\" = ? AND r.deleted_at IS NULL AND \"r\".\"status\" = ? ORDER BY sortval DESC, r.id DESC ) SELECT r.*, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"r\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"r\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"r\".id AND b.locale = \"r\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM picked JOIN \"ec_posts\" AS r ON r.id = picked.entry_id WHERE r.deleted_at IS NULL AND \"r\".\"status\" = ? ORDER BY picked.sortval DESC, picked.entry_id DESC": 1 }, "GET /contributors (cold)": { - "select \"a\".\"id\" as \"a_id\", \"a\".\"name\" as \"a_name\", \"a\".\"label\" as \"a_label\", \"a\".\"description\" as \"a_description\", \"w\".\"id\" as \"w_id\", \"w\".\"type\" as \"w_type\", \"w\".\"title\" as \"w_title\", \"w\".\"content\" as \"w_content\", \"w\".\"menu_name\" as \"w_menu_name\", \"w\".\"component_id\" as \"w_component_id\", \"w\".\"component_props\" as \"w_component_props\", \"w\".\"area_id\" as \"w_area_id\", \"w\".\"sort_order\" as \"w_sort_order\", \"w\".\"created_at\" as \"w_created_at\" from \"_emdash_widget_areas\" as \"a\" left join \"_emdash_widgets\" as \"w\" on \"w\".\"area_id\" = \"a\".\"id\" where \"a\".\"name\" = ? order by \"w\".\"sort_order\" asc": 1, "select \"name\", \"value\" from \"options\" where \"name\" in (...)": 2, "select \"name\", \"value\" from \"options\" where name LIKE ? ESCAPE '\\'": 1, "select \"plugin_id\", \"status\" from \"_plugin_state\"": 1, @@ -72,21 +83,28 @@ "select * from \"_emdash_menus\" where \"name\" = ? order by \"locale\" asc": 1, "select * from \"_emdash_migrations\" limit ?": 1, "select * from \"_emdash_redirects\" where \"enabled\" = ?": 1, + "select * from \"_emdash_taxonomy_defs\"": 1, + "select * from \"_emdash_widget_areas\"": 1, + "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, + "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "SELECT COUNT(*) as count FROM \"_emdash_migrations\"": 1, + "select distinct \"name\" from \"_emdash_menus\"": 1, "UPDATE _emdash_cron_tasks SET status = 'idle', locked_at = NULL WHERE status = 'running' AND locked_at < ?": 1 }, "GET /contributors (warm)": { - "select \"a\".\"id\" as \"a_id\", \"a\".\"name\" as \"a_name\", \"a\".\"label\" as \"a_label\", \"a\".\"description\" as \"a_description\", \"w\".\"id\" as \"w_id\", \"w\".\"type\" as \"w_type\", \"w\".\"title\" as \"w_title\", \"w\".\"content\" as \"w_content\", \"w\".\"menu_name\" as \"w_menu_name\", \"w\".\"component_id\" as \"w_component_id\", \"w\".\"component_props\" as \"w_component_props\", \"w\".\"area_id\" as \"w_area_id\", \"w\".\"sort_order\" as \"w_sort_order\", \"w\".\"created_at\" as \"w_created_at\" from \"_emdash_widget_areas\" as \"a\" left join \"_emdash_widgets\" as \"w\" on \"w\".\"area_id\" = \"a\".\"id\" where \"a\".\"name\" = ? order by \"w\".\"sort_order\" asc": 1, "select \"value\" from \"options\" where \"name\" = ?": 1, "select * from \"_emdash_menu_items\" where \"menu_id\" = ? order by \"sort_order\" asc": 1, "select * from \"_emdash_menus\" where \"name\" = ? order by \"locale\" asc": 1, + "select * from \"_emdash_widget_areas\"": 1, + "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, + "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, - "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC": 1 + "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC": 1, + "select distinct \"name\" from \"_emdash_menus\"": 1 }, "GET /contributors-naive (cold)": { - "select \"a\".\"id\" as \"a_id\", \"a\".\"name\" as \"a_name\", \"a\".\"label\" as \"a_label\", \"a\".\"description\" as \"a_description\", \"w\".\"id\" as \"w_id\", \"w\".\"type\" as \"w_type\", \"w\".\"title\" as \"w_title\", \"w\".\"content\" as \"w_content\", \"w\".\"menu_name\" as \"w_menu_name\", \"w\".\"component_id\" as \"w_component_id\", \"w\".\"component_props\" as \"w_component_props\", \"w\".\"area_id\" as \"w_area_id\", \"w\".\"sort_order\" as \"w_sort_order\", \"w\".\"created_at\" as \"w_created_at\" from \"_emdash_widget_areas\" as \"a\" left join \"_emdash_widgets\" as \"w\" on \"w\".\"area_id\" = \"a\".\"id\" where \"a\".\"name\" = ? order by \"w\".\"sort_order\" asc": 1, "select \"name\", \"value\" from \"options\" where \"name\" in (...)": 2, "select \"name\", \"value\" from \"options\" where name LIKE ? ESCAPE '\\'": 1, "select \"plugin_id\", \"status\" from \"_plugin_state\"": 1, @@ -97,23 +115,30 @@ "select * from \"_emdash_menus\" where \"name\" = ? order by \"locale\" asc": 1, "select * from \"_emdash_migrations\" limit ?": 1, "select * from \"_emdash_redirects\" where \"enabled\" = ?": 1, + "select * from \"_emdash_taxonomy_defs\"": 1, + "select * from \"_emdash_widget_areas\"": 1, + "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, "select * from \"media\" where \"id\" = ?": 7, + "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "SELECT COUNT(*) as count FROM \"_emdash_migrations\"": 1, + "select distinct \"name\" from \"_emdash_menus\"": 1, "UPDATE _emdash_cron_tasks SET status = 'idle', locked_at = NULL WHERE status = 'running' AND locked_at < ?": 1 }, "GET /contributors-naive (warm)": { - "select \"a\".\"id\" as \"a_id\", \"a\".\"name\" as \"a_name\", \"a\".\"label\" as \"a_label\", \"a\".\"description\" as \"a_description\", \"w\".\"id\" as \"w_id\", \"w\".\"type\" as \"w_type\", \"w\".\"title\" as \"w_title\", \"w\".\"content\" as \"w_content\", \"w\".\"menu_name\" as \"w_menu_name\", \"w\".\"component_id\" as \"w_component_id\", \"w\".\"component_props\" as \"w_component_props\", \"w\".\"area_id\" as \"w_area_id\", \"w\".\"sort_order\" as \"w_sort_order\", \"w\".\"created_at\" as \"w_created_at\" from \"_emdash_widget_areas\" as \"a\" left join \"_emdash_widgets\" as \"w\" on \"w\".\"area_id\" = \"a\".\"id\" where \"a\".\"name\" = ? order by \"w\".\"sort_order\" asc": 1, "select \"value\" from \"options\" where \"name\" = ?": 1, "select * from \"_emdash_menu_items\" where \"menu_id\" = ? order by \"sort_order\" asc": 1, "select * from \"_emdash_menus\" where \"name\" = ? order by \"locale\" asc": 1, + "select * from \"_emdash_widget_areas\"": 1, + "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, "select * from \"media\" where \"id\" = ?": 7, + "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, - "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC": 1 + "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC": 1, + "select distinct \"name\" from \"_emdash_menus\"": 1 }, "GET /pages/about (cold)": { - "select \"a\".\"id\" as \"a_id\", \"a\".\"name\" as \"a_name\", \"a\".\"label\" as \"a_label\", \"a\".\"description\" as \"a_description\", \"w\".\"id\" as \"w_id\", \"w\".\"type\" as \"w_type\", \"w\".\"title\" as \"w_title\", \"w\".\"content\" as \"w_content\", \"w\".\"menu_name\" as \"w_menu_name\", \"w\".\"component_id\" as \"w_component_id\", \"w\".\"component_props\" as \"w_component_props\", \"w\".\"area_id\" as \"w_area_id\", \"w\".\"sort_order\" as \"w_sort_order\", \"w\".\"created_at\" as \"w_created_at\" from \"_emdash_widget_areas\" as \"a\" left join \"_emdash_widgets\" as \"w\" on \"w\".\"area_id\" = \"a\".\"id\" where \"a\".\"name\" = ? order by \"w\".\"sort_order\" asc": 1, "select \"name\", \"value\" from \"options\" where \"name\" in (...)": 2, "select \"name\", \"value\" from \"options\" where name LIKE ? ESCAPE '\\'": 1, "select \"plugin_id\", \"status\" from \"_plugin_state\"": 1, @@ -124,21 +149,28 @@ "select * from \"_emdash_menus\" where \"name\" = ? order by \"locale\" asc": 1, "select * from \"_emdash_migrations\" limit ?": 1, "select * from \"_emdash_redirects\" where \"enabled\" = ?": 1, + "select * from \"_emdash_taxonomy_defs\"": 1, + "select * from \"_emdash_widget_areas\"": 1, + "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, + "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT c.*, (SELECT json_object('seo_title', s.seo_title, 'seo_description', s.seo_description, 'seo_image', s.seo_image, 'seo_canonical', s.seo_canonical, 'seo_no_index', s.seo_no_index) FROM \"_emdash_seo\" AS s WHERE s.collection = ? AND s.content_id = \"c\".id LIMIT 1) AS \"_emdash_seo\", (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"c\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"c\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"c\".id AND b.locale = \"c\".locale) AS \"_emdash_bylines\", ( SELECT json_object( 'bylinesExist', _emdash_bylines_exist, 'booleanFields', _emdash_boolean_fields ) FROM (SELECT (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\") AS metadata ) AS _emdash_entry_metadata FROM \"ec_pages\" AS c WHERE c.deleted_at IS NULL AND (c.slug = ? OR c.id = ?) LIMIT 1": 1, "SELECT COUNT(*) as count FROM \"_emdash_migrations\"": 1, + "select distinct \"name\" from \"_emdash_menus\"": 1, "UPDATE _emdash_cron_tasks SET status = 'idle', locked_at = NULL WHERE status = 'running' AND locked_at < ?": 1 }, "GET /pages/about (warm)": { - "select \"a\".\"id\" as \"a_id\", \"a\".\"name\" as \"a_name\", \"a\".\"label\" as \"a_label\", \"a\".\"description\" as \"a_description\", \"w\".\"id\" as \"w_id\", \"w\".\"type\" as \"w_type\", \"w\".\"title\" as \"w_title\", \"w\".\"content\" as \"w_content\", \"w\".\"menu_name\" as \"w_menu_name\", \"w\".\"component_id\" as \"w_component_id\", \"w\".\"component_props\" as \"w_component_props\", \"w\".\"area_id\" as \"w_area_id\", \"w\".\"sort_order\" as \"w_sort_order\", \"w\".\"created_at\" as \"w_created_at\" from \"_emdash_widget_areas\" as \"a\" left join \"_emdash_widgets\" as \"w\" on \"w\".\"area_id\" = \"a\".\"id\" where \"a\".\"name\" = ? order by \"w\".\"sort_order\" asc": 1, "select \"value\" from \"options\" where \"name\" = ?": 1, "select * from \"_emdash_menu_items\" where \"menu_id\" = ? order by \"sort_order\" asc": 1, "select * from \"_emdash_menus\" where \"name\" = ? order by \"locale\" asc": 1, + "select * from \"_emdash_widget_areas\"": 1, + "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, + "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, - "SELECT c.*, (SELECT json_object('seo_title', s.seo_title, 'seo_description', s.seo_description, 'seo_image', s.seo_image, 'seo_canonical', s.seo_canonical, 'seo_no_index', s.seo_no_index) FROM \"_emdash_seo\" AS s WHERE s.collection = ? AND s.content_id = \"c\".id LIMIT 1) AS \"_emdash_seo\", (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"c\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"c\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"c\".id AND b.locale = \"c\".locale) AS \"_emdash_bylines\", ( SELECT json_object( 'bylinesExist', _emdash_bylines_exist, 'booleanFields', _emdash_boolean_fields ) FROM (SELECT (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\") AS metadata ) AS _emdash_entry_metadata FROM \"ec_pages\" AS c WHERE c.deleted_at IS NULL AND (c.slug = ? OR c.id = ?) LIMIT 1": 1 + "SELECT c.*, (SELECT json_object('seo_title', s.seo_title, 'seo_description', s.seo_description, 'seo_image', s.seo_image, 'seo_canonical', s.seo_canonical, 'seo_no_index', s.seo_no_index) FROM \"_emdash_seo\" AS s WHERE s.collection = ? AND s.content_id = \"c\".id LIMIT 1) AS \"_emdash_seo\", (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"c\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"c\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"c\".id AND b.locale = \"c\".locale) AS \"_emdash_bylines\", ( SELECT json_object( 'bylinesExist', _emdash_bylines_exist, 'booleanFields', _emdash_boolean_fields ) FROM (SELECT (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\") AS metadata ) AS _emdash_entry_metadata FROM \"ec_pages\" AS c WHERE c.deleted_at IS NULL AND (c.slug = ? OR c.id = ?) LIMIT 1": 1, + "select distinct \"name\" from \"_emdash_menus\"": 1 }, "GET /posts (cold)": { - "select \"a\".\"id\" as \"a_id\", \"a\".\"name\" as \"a_name\", \"a\".\"label\" as \"a_label\", \"a\".\"description\" as \"a_description\", \"w\".\"id\" as \"w_id\", \"w\".\"type\" as \"w_type\", \"w\".\"title\" as \"w_title\", \"w\".\"content\" as \"w_content\", \"w\".\"menu_name\" as \"w_menu_name\", \"w\".\"component_id\" as \"w_component_id\", \"w\".\"component_props\" as \"w_component_props\", \"w\".\"area_id\" as \"w_area_id\", \"w\".\"sort_order\" as \"w_sort_order\", \"w\".\"created_at\" as \"w_created_at\" from \"_emdash_widget_areas\" as \"a\" left join \"_emdash_widgets\" as \"w\" on \"w\".\"area_id\" = \"a\".\"id\" where \"a\".\"name\" = ? order by \"w\".\"sort_order\" asc": 1, "select \"name\", \"value\" from \"options\" where \"name\" in (...)": 2, "select \"name\", \"value\" from \"options\" where name LIKE ? ESCAPE '\\'": 1, "select \"plugin_id\", \"status\" from \"_plugin_state\"": 1, @@ -149,21 +181,28 @@ "select * from \"_emdash_menus\" where \"name\" = ? order by \"locale\" asc": 1, "select * from \"_emdash_migrations\" limit ?": 1, "select * from \"_emdash_redirects\" where \"enabled\" = ?": 1, + "select * from \"_emdash_taxonomy_defs\"": 1, + "select * from \"_emdash_widget_areas\"": 1, + "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, + "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "SELECT COUNT(*) as count FROM \"_emdash_migrations\"": 1, + "select distinct \"name\" from \"_emdash_menus\"": 1, "UPDATE _emdash_cron_tasks SET status = 'idle', locked_at = NULL WHERE status = 'running' AND locked_at < ?": 1 }, "GET /posts (warm)": { - "select \"a\".\"id\" as \"a_id\", \"a\".\"name\" as \"a_name\", \"a\".\"label\" as \"a_label\", \"a\".\"description\" as \"a_description\", \"w\".\"id\" as \"w_id\", \"w\".\"type\" as \"w_type\", \"w\".\"title\" as \"w_title\", \"w\".\"content\" as \"w_content\", \"w\".\"menu_name\" as \"w_menu_name\", \"w\".\"component_id\" as \"w_component_id\", \"w\".\"component_props\" as \"w_component_props\", \"w\".\"area_id\" as \"w_area_id\", \"w\".\"sort_order\" as \"w_sort_order\", \"w\".\"created_at\" as \"w_created_at\" from \"_emdash_widget_areas\" as \"a\" left join \"_emdash_widgets\" as \"w\" on \"w\".\"area_id\" = \"a\".\"id\" where \"a\".\"name\" = ? order by \"w\".\"sort_order\" asc": 1, "select \"value\" from \"options\" where \"name\" = ?": 1, "select * from \"_emdash_menu_items\" where \"menu_id\" = ? order by \"sort_order\" asc": 1, "select * from \"_emdash_menus\" where \"name\" = ? order by \"locale\" asc": 1, + "select * from \"_emdash_widget_areas\"": 1, + "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, + "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, - "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC": 1 + "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC": 1, + "select distinct \"name\" from \"_emdash_menus\"": 1 }, "GET /posts/building-for-the-long-term (cold)": { - "select \"a\".\"id\" as \"a_id\", \"a\".\"name\" as \"a_name\", \"a\".\"label\" as \"a_label\", \"a\".\"description\" as \"a_description\", \"w\".\"id\" as \"w_id\", \"w\".\"type\" as \"w_type\", \"w\".\"title\" as \"w_title\", \"w\".\"content\" as \"w_content\", \"w\".\"menu_name\" as \"w_menu_name\", \"w\".\"component_id\" as \"w_component_id\", \"w\".\"component_props\" as \"w_component_props\", \"w\".\"area_id\" as \"w_area_id\", \"w\".\"sort_order\" as \"w_sort_order\", \"w\".\"created_at\" as \"w_created_at\" from \"_emdash_widget_areas\" as \"a\" left join \"_emdash_widgets\" as \"w\" on \"w\".\"area_id\" = \"a\".\"id\" where \"a\".\"name\" = ? order by \"w\".\"sort_order\" asc": 2, "select \"name\", \"value\" from \"options\" where \"name\" in (...)": 2, "select \"name\", \"value\" from \"options\" where name LIKE ? ESCAPE '\\'": 1, "select \"plugin_id\", \"status\" from \"_plugin_state\"": 1, @@ -176,7 +215,9 @@ "select * from \"_emdash_menus\" where \"name\" = ? order by \"locale\" asc": 1, "select * from \"_emdash_migrations\" limit ?": 1, "select * from \"_emdash_redirects\" where \"enabled\" = ?": 1, - "select * from \"_emdash_taxonomy_defs\" where \"name\" = ? order by \"locale\" asc": 2, + "select * from \"_emdash_taxonomy_defs\"": 1, + "select * from \"_emdash_widget_areas\"": 1, + "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC": 1, @@ -184,23 +225,25 @@ "SELECT c.*, (SELECT json_object('seo_title', s.seo_title, 'seo_description', s.seo_description, 'seo_image', s.seo_image, 'seo_canonical', s.seo_canonical, 'seo_no_index', s.seo_no_index) FROM \"_emdash_seo\" AS s WHERE s.collection = ? AND s.content_id = \"c\".id LIMIT 1) AS \"_emdash_seo\", (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"c\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"c\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"c\".id AND b.locale = \"c\".locale) AS \"_emdash_bylines\", ( SELECT json_object( 'bylinesExist', _emdash_bylines_exist, 'booleanFields', _emdash_boolean_fields ) FROM (SELECT (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\") AS metadata ) AS _emdash_entry_metadata FROM \"ec_posts\" AS c WHERE c.deleted_at IS NULL AND (c.slug = ? OR c.id = ?) LIMIT 1": 1, "select count(\"id\") as \"count\" from \"_emdash_comments\" where \"collection\" = ? and \"content_id\" = ? and \"status\" = ?": 1, "SELECT COUNT(*) as count FROM \"_emdash_migrations\"": 1, + "select distinct \"name\" from \"_emdash_menus\"": 1, "SELECT taxonomy_id, SUM(count) AS count FROM ( SELECT ct.taxonomy_id AS taxonomy_id, COUNT(DISTINCT e.translation_group) AS count FROM content_taxonomies AS ct CROSS JOIN \"ec_posts\" AS e WHERE e.translation_group = ct.entry_id AND ct.collection = ? AND ct.taxonomy_id IN (SELECT translation_group FROM taxonomies WHERE name = ?) AND \"e\".\"status\" = ? AND e.deleted_at IS NULL GROUP BY ct.taxonomy_id) AS per_collection GROUP BY taxonomy_id": 1, "UPDATE _emdash_cron_tasks SET status = 'idle', locked_at = NULL WHERE status = 'running' AND locked_at < ?": 1 }, "GET /posts/building-for-the-long-term (warm)": { - "select \"a\".\"id\" as \"a_id\", \"a\".\"name\" as \"a_name\", \"a\".\"label\" as \"a_label\", \"a\".\"description\" as \"a_description\", \"w\".\"id\" as \"w_id\", \"w\".\"type\" as \"w_type\", \"w\".\"title\" as \"w_title\", \"w\".\"content\" as \"w_content\", \"w\".\"menu_name\" as \"w_menu_name\", \"w\".\"component_id\" as \"w_component_id\", \"w\".\"component_props\" as \"w_component_props\", \"w\".\"area_id\" as \"w_area_id\", \"w\".\"sort_order\" as \"w_sort_order\", \"w\".\"created_at\" as \"w_created_at\" from \"_emdash_widget_areas\" as \"a\" left join \"_emdash_widgets\" as \"w\" on \"w\".\"area_id\" = \"a\".\"id\" where \"a\".\"name\" = ? order by \"w\".\"sort_order\" asc": 2, "select \"value\" from \"options\" where \"name\" = ?": 1, "select * from \"_emdash_collections\" where \"slug\" = ?": 1, "select * from \"_emdash_comments\" where \"collection\" = ? and \"content_id\" = ? and \"status\" = ? order by \"created_at\" asc, \"id\" asc limit ?": 1, "select * from \"_emdash_menu_items\" where \"menu_id\" = ? order by \"sort_order\" asc": 1, "select * from \"_emdash_menus\" where \"name\" = ? order by \"locale\" asc": 1, - "select * from \"_emdash_taxonomy_defs\" where \"name\" = ? order by \"locale\" asc": 2, + "select * from \"_emdash_widget_areas\"": 1, + "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC LIMIT ?": 1, "SELECT c.*, (SELECT json_object('seo_title', s.seo_title, 'seo_description', s.seo_description, 'seo_image', s.seo_image, 'seo_canonical', s.seo_canonical, 'seo_no_index', s.seo_no_index) FROM \"_emdash_seo\" AS s WHERE s.collection = ? AND s.content_id = \"c\".id LIMIT 1) AS \"_emdash_seo\", (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"c\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"c\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"c\".id AND b.locale = \"c\".locale) AS \"_emdash_bylines\", ( SELECT json_object( 'bylinesExist', _emdash_bylines_exist, 'booleanFields', _emdash_boolean_fields ) FROM (SELECT (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\") AS metadata ) AS _emdash_entry_metadata FROM \"ec_posts\" AS c WHERE c.deleted_at IS NULL AND (c.slug = ? OR c.id = ?) LIMIT 1": 1, "select count(\"id\") as \"count\" from \"_emdash_comments\" where \"collection\" = ? and \"content_id\" = ? and \"status\" = ?": 1, + "select distinct \"name\" from \"_emdash_menus\"": 1, "SELECT taxonomy_id, SUM(count) AS count FROM ( SELECT ct.taxonomy_id AS taxonomy_id, COUNT(DISTINCT e.translation_group) AS count FROM content_taxonomies AS ct CROSS JOIN \"ec_posts\" AS e WHERE e.translation_group = ct.entry_id AND ct.collection = ? AND ct.taxonomy_id IN (SELECT translation_group FROM taxonomies WHERE name = ?) AND \"e\".\"status\" = ? AND e.deleted_at IS NULL GROUP BY ct.taxonomy_id) AS per_collection GROUP BY taxonomy_id": 1 }, "GET /rss.xml (cold)": { @@ -220,7 +263,6 @@ "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC LIMIT ?": 1 }, "GET /search (cold)": { - "select \"a\".\"id\" as \"a_id\", \"a\".\"name\" as \"a_name\", \"a\".\"label\" as \"a_label\", \"a\".\"description\" as \"a_description\", \"w\".\"id\" as \"w_id\", \"w\".\"type\" as \"w_type\", \"w\".\"title\" as \"w_title\", \"w\".\"content\" as \"w_content\", \"w\".\"menu_name\" as \"w_menu_name\", \"w\".\"component_id\" as \"w_component_id\", \"w\".\"component_props\" as \"w_component_props\", \"w\".\"area_id\" as \"w_area_id\", \"w\".\"sort_order\" as \"w_sort_order\", \"w\".\"created_at\" as \"w_created_at\" from \"_emdash_widget_areas\" as \"a\" left join \"_emdash_widgets\" as \"w\" on \"w\".\"area_id\" = \"a\".\"id\" where \"a\".\"name\" = ? order by \"w\".\"sort_order\" asc": 1, "select \"c\".\"slug\" as \"collection_slug\" from \"_emdash_fields\" as \"f\" inner join \"_emdash_collections\" as \"c\" on \"c\".\"id\" = \"f\".\"collection_id\" where \"f\".\"slug\" = ?": 1, "select \"id\" from \"_emdash_collections\" where \"slug\" = ?": 1, "select \"name\", \"value\" from \"options\" where \"name\" in (...)": 2, @@ -235,14 +277,18 @@ "select * from \"_emdash_menus\" where \"name\" = ? order by \"locale\" asc": 1, "select * from \"_emdash_migrations\" limit ?": 1, "select * from \"_emdash_redirects\" where \"enabled\" = ?": 1, + "select * from \"_emdash_taxonomy_defs\"": 1, + "select * from \"_emdash_widget_areas\"": 1, + "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, + "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT c.id, c.slug, c.locale, c.title as title, snippet(\"_emdash_fts_posts\", 2, '', '', '...', 32) as snippet, bm25(\"_emdash_fts_posts\") as score FROM \"_emdash_fts_posts\" f JOIN \"ec_posts\" c ON f.id = c.id WHERE \"_emdash_fts_posts\" MATCH ? AND c.status = ? AND c.deleted_at IS NULL ORDER BY score LIMIT ?": 1, "SELECT COUNT(*) as count FROM \"_emdash_migrations\"": 1, + "select distinct \"name\" from \"_emdash_menus\"": 1, "SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?": 1, "UPDATE _emdash_cron_tasks SET status = 'idle', locked_at = NULL WHERE status = 'running' AND locked_at < ?": 1 }, "GET /search (warm)": { - "select \"a\".\"id\" as \"a_id\", \"a\".\"name\" as \"a_name\", \"a\".\"label\" as \"a_label\", \"a\".\"description\" as \"a_description\", \"w\".\"id\" as \"w_id\", \"w\".\"type\" as \"w_type\", \"w\".\"title\" as \"w_title\", \"w\".\"content\" as \"w_content\", \"w\".\"menu_name\" as \"w_menu_name\", \"w\".\"component_id\" as \"w_component_id\", \"w\".\"component_props\" as \"w_component_props\", \"w\".\"area_id\" as \"w_area_id\", \"w\".\"sort_order\" as \"w_sort_order\", \"w\".\"created_at\" as \"w_created_at\" from \"_emdash_widget_areas\" as \"a\" left join \"_emdash_widgets\" as \"w\" on \"w\".\"area_id\" = \"a\".\"id\" where \"a\".\"name\" = ? order by \"w\".\"sort_order\" asc": 1, "select \"c\".\"slug\" as \"collection_slug\" from \"_emdash_fields\" as \"f\" inner join \"_emdash_collections\" as \"c\" on \"c\".\"id\" = \"f\".\"collection_id\" where \"f\".\"slug\" = ?": 1, "select \"id\" from \"_emdash_collections\" where \"slug\" = ?": 1, "select \"search_config\", \"title_field\" from \"_emdash_collections\" where \"slug\" = ?": 1, @@ -250,12 +296,15 @@ "select \"value\" from \"options\" where \"name\" = ?": 1, "select * from \"_emdash_menu_items\" where \"menu_id\" = ? order by \"sort_order\" asc": 1, "select * from \"_emdash_menus\" where \"name\" = ? order by \"locale\" asc": 1, + "select * from \"_emdash_widget_areas\"": 1, + "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, + "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT c.id, c.slug, c.locale, c.title as title, snippet(\"_emdash_fts_posts\", 2, '', '', '...', 32) as snippet, bm25(\"_emdash_fts_posts\") as score FROM \"_emdash_fts_posts\" f JOIN \"ec_posts\" c ON f.id = c.id WHERE \"_emdash_fts_posts\" MATCH ? AND c.status = ? AND c.deleted_at IS NULL ORDER BY score LIMIT ?": 1, + "select distinct \"name\" from \"_emdash_menus\"": 1, "SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?": 1 }, "GET /tag/webdev (cold)": { - "select \"a\".\"id\" as \"a_id\", \"a\".\"name\" as \"a_name\", \"a\".\"label\" as \"a_label\", \"a\".\"description\" as \"a_description\", \"w\".\"id\" as \"w_id\", \"w\".\"type\" as \"w_type\", \"w\".\"title\" as \"w_title\", \"w\".\"content\" as \"w_content\", \"w\".\"menu_name\" as \"w_menu_name\", \"w\".\"component_id\" as \"w_component_id\", \"w\".\"component_props\" as \"w_component_props\", \"w\".\"area_id\" as \"w_area_id\", \"w\".\"sort_order\" as \"w_sort_order\", \"w\".\"created_at\" as \"w_created_at\" from \"_emdash_widget_areas\" as \"a\" left join \"_emdash_widgets\" as \"w\" on \"w\".\"area_id\" = \"a\".\"id\" where \"a\".\"name\" = ? order by \"w\".\"sort_order\" asc": 1, "select \"name\", \"collections\" from \"_emdash_taxonomy_defs\"": 1, "select \"name\", \"value\" from \"options\" where \"name\" in (...)": 2, "select \"name\", \"value\" from \"options\" where name LIKE ? ESCAPE '\\'": 1, @@ -267,25 +316,31 @@ "select * from \"_emdash_menus\" where \"name\" = ? order by \"locale\" asc": 1, "select * from \"_emdash_migrations\" limit ?": 1, "select * from \"_emdash_redirects\" where \"enabled\" = ?": 1, - "select * from \"_emdash_taxonomy_defs\" where \"name\" = ? order by \"locale\" asc": 1, + "select * from \"_emdash_taxonomy_defs\"": 1, + "select * from \"_emdash_widget_areas\"": 1, + "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, "select * from \"taxonomies\" where \"name\" = ? and \"slug\" = ? order by \"locale\" asc": 1, + "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "select * from \"taxonomies\" where \"parent_id\" = ? and \"locale\" = ? order by \"sort_order\" asc, \"label\" asc": 1, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT COUNT(*) as count FROM \"_emdash_migrations\"": 1, + "select distinct \"name\" from \"_emdash_menus\"": 1, "select distinct \"translation_group\" from \"taxonomies\" where \"name\" = ? and \"slug\" in (...)": 1, "SELECT taxonomy_id, SUM(count) AS count FROM ( SELECT ct.taxonomy_id AS taxonomy_id, COUNT(DISTINCT e.translation_group) AS count FROM content_taxonomies AS ct CROSS JOIN \"ec_posts\" AS e WHERE e.translation_group = ct.entry_id AND ct.collection = ? AND ct.taxonomy_id IN (SELECT translation_group FROM taxonomies WHERE name = ?) AND e.locale = ? AND \"e\".\"status\" = ? AND e.deleted_at IS NULL GROUP BY ct.taxonomy_id) AS per_collection GROUP BY taxonomy_id": 1, "UPDATE _emdash_cron_tasks SET status = 'idle', locked_at = NULL WHERE status = 'running' AND locked_at < ?": 1, "WITH picked AS ( SELECT r.id AS entry_id, \"r\".\"published_at\" AS sortval FROM content_taxonomies ct CROSS JOIN \"ec_posts\" AS r ON r.translation_group = ct.entry_id WHERE ct.collection = ? AND \"ct\".\"taxonomy_id\" = ? AND r.deleted_at IS NULL AND \"r\".\"status\" = ? ORDER BY sortval DESC, r.id DESC ) SELECT r.*, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"r\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"r\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"r\".id AND b.locale = \"r\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM picked JOIN \"ec_posts\" AS r ON r.id = picked.entry_id WHERE r.deleted_at IS NULL AND \"r\".\"status\" = ? ORDER BY picked.sortval DESC, picked.entry_id DESC": 1 }, "GET /tag/webdev (warm)": { - "select \"a\".\"id\" as \"a_id\", \"a\".\"name\" as \"a_name\", \"a\".\"label\" as \"a_label\", \"a\".\"description\" as \"a_description\", \"w\".\"id\" as \"w_id\", \"w\".\"type\" as \"w_type\", \"w\".\"title\" as \"w_title\", \"w\".\"content\" as \"w_content\", \"w\".\"menu_name\" as \"w_menu_name\", \"w\".\"component_id\" as \"w_component_id\", \"w\".\"component_props\" as \"w_component_props\", \"w\".\"area_id\" as \"w_area_id\", \"w\".\"sort_order\" as \"w_sort_order\", \"w\".\"created_at\" as \"w_created_at\" from \"_emdash_widget_areas\" as \"a\" left join \"_emdash_widgets\" as \"w\" on \"w\".\"area_id\" = \"a\".\"id\" where \"a\".\"name\" = ? order by \"w\".\"sort_order\" asc": 1, "select \"value\" from \"options\" where \"name\" = ?": 1, "select * from \"_emdash_menu_items\" where \"menu_id\" = ? order by \"sort_order\" asc": 1, "select * from \"_emdash_menus\" where \"name\" = ? order by \"locale\" asc": 1, - "select * from \"_emdash_taxonomy_defs\" where \"name\" = ? order by \"locale\" asc": 1, + "select * from \"_emdash_widget_areas\"": 1, + "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, "select * from \"taxonomies\" where \"name\" = ? and \"slug\" = ? order by \"locale\" asc": 1, + "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "select * from \"taxonomies\" where \"parent_id\" = ? and \"locale\" = ? order by \"sort_order\" asc, \"label\" asc": 1, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, + "select distinct \"name\" from \"_emdash_menus\"": 1, "select distinct \"translation_group\" from \"taxonomies\" where \"name\" = ? and \"slug\" in (...)": 1, "SELECT taxonomy_id, SUM(count) AS count FROM ( SELECT ct.taxonomy_id AS taxonomy_id, COUNT(DISTINCT e.translation_group) AS count FROM content_taxonomies AS ct CROSS JOIN \"ec_posts\" AS e WHERE e.translation_group = ct.entry_id AND ct.collection = ? AND ct.taxonomy_id IN (SELECT translation_group FROM taxonomies WHERE name = ?) AND e.locale = ? AND \"e\".\"status\" = ? AND e.deleted_at IS NULL GROUP BY ct.taxonomy_id) AS per_collection GROUP BY taxonomy_id": 1, "WITH picked AS ( SELECT r.id AS entry_id, \"r\".\"published_at\" AS sortval FROM content_taxonomies ct CROSS JOIN \"ec_posts\" AS r ON r.translation_group = ct.entry_id WHERE ct.collection = ? AND \"ct\".\"taxonomy_id\" = ? AND r.deleted_at IS NULL AND \"r\".\"status\" = ? ORDER BY sortval DESC, r.id DESC ) SELECT r.*, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"r\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"r\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"r\".id AND b.locale = \"r\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM picked JOIN \"ec_posts\" AS r ON r.id = picked.entry_id WHERE r.deleted_at IS NULL AND \"r\".\"status\" = ? ORDER BY picked.sortval DESC, picked.entry_id DESC": 1 diff --git a/scripts/query-counts.snapshot.d1.json b/scripts/query-counts.snapshot.d1.json index 65e95e43ee..e648c4323b 100644 --- a/scripts/query-counts.snapshot.d1.json +++ b/scripts/query-counts.snapshot.d1.json @@ -1,22 +1,22 @@ { - "GET / (cold)": 17, - "GET / (warm)": 6, - "GET /category/development (cold)": 23, - "GET /category/development (warm)": 11, - "GET /contributors (cold)": 17, - "GET /contributors (warm)": 6, - "GET /contributors-naive (cold)": 24, - "GET /contributors-naive (warm)": 13, - "GET /pages/about (cold)": 17, - "GET /pages/about (warm)": 6, - "GET /posts (cold)": 17, - "GET /posts (warm)": 6, + "GET / (cold)": 22, + "GET / (warm)": 10, + "GET /category/development (cold)": 27, + "GET /category/development (warm)": 14, + "GET /contributors (cold)": 22, + "GET /contributors (warm)": 10, + "GET /contributors-naive (cold)": 29, + "GET /contributors-naive (warm)": 17, + "GET /pages/about (cold)": 22, + "GET /pages/about (warm)": 10, + "GET /posts (cold)": 22, + "GET /posts (warm)": 10, "GET /posts/building-for-the-long-term (cold)": 28, - "GET /posts/building-for-the-long-term (warm)": 17, + "GET /posts/building-for-the-long-term (warm)": 16, "GET /rss.xml (cold)": 12, "GET /rss.xml (warm)": 2, - "GET /search (cold)": 22, - "GET /search (warm)": 11, - "GET /tag/webdev (cold)": 23, - "GET /tag/webdev (warm)": 11 + "GET /search (cold)": 27, + "GET /search (warm)": 15, + "GET /tag/webdev (cold)": 27, + "GET /tag/webdev (warm)": 14 } From bdafeeeea6cc2f70c1bc7033488ca7d41f386754 Mon Sep 17 00:00:00 2001 From: logelog <194732487+logelog@users.noreply.github.com> Date: Fri, 11 Sep 2026 18:52:38 +0200 Subject: [PATCH 2/2] perf(widgets): load only publication dates for archives --- .changeset/archive-month-labels.md | 2 +- .../src/components/widgets/Archives.astro | 11 +- packages/core/src/loader.ts | 14 + packages/core/src/query.ts | 56 ++- .../core/tests/unit/published-dates.test.ts | 324 ++++++++++++++++++ scripts/query-counts.queries.d1.json | 4 +- scripts/query-counts.queries.sqlite.json | 4 +- 7 files changed, 404 insertions(+), 11 deletions(-) create mode 100644 packages/core/tests/unit/published-dates.test.ts diff --git a/.changeset/archive-month-labels.md b/.changeset/archive-month-labels.md index 701a5eecae..e1989ed163 100644 --- a/.changeset/archive-month-labels.md +++ b/.changeset/archive-month-labels.md @@ -2,4 +2,4 @@ "emdash": patch --- -Reduces Archives widget rendering work on sites with many posts by formatting each displayed month label once. Archive links, ordering, and post counts stay the same. +Reduces the CPU work needed to render the Archives widget on sites with many posts. Archive links, ordering, and post counts stay the same. diff --git a/packages/core/src/components/widgets/Archives.astro b/packages/core/src/components/widgets/Archives.astro index 4d1c3b3d6d..df244b6a1e 100644 --- a/packages/core/src/components/widgets/Archives.astro +++ b/packages/core/src/components/widgets/Archives.astro @@ -1,5 +1,5 @@ --- -import { getEmDashCollection } from "../../query.js"; +import { getPublishedDates } from "../../query.js"; import { groupEntriesByPublishedAt } from "../../widgets/archives.js"; interface Props { @@ -9,11 +9,12 @@ interface Props { const { type = "monthly", limit = 12 } = Astro.props; -const { entries: posts } = await getEmDashCollection("posts", { - orderBy: { published_at: "desc" }, -}); +const { dates } = await getPublishedDates("posts"); -const archiveList = groupEntriesByPublishedAt(posts, { type, limit }); +const archiveList = groupEntriesByPublishedAt( + dates.map((publishedAt) => ({ data: { publishedAt } })), + { type, limit }, +); ---
    diff --git a/packages/core/src/loader.ts b/packages/core/src/loader.ts index 0289d20db8..8d9e97627c 100644 --- a/packages/core/src/loader.ts +++ b/packages/core/src/loader.ts @@ -1168,6 +1168,20 @@ export async function getDb(): Promise> { return dbInstance; } +/** @internal Date projection for published archive entries. */ +export async function loadPublishedDates(type: string, locale?: string) { + const tableName = getTableName(type); + const db = await getDb(); + const result = await sql<{ published_at: string | null; updated_at: string | null }>` + SELECT published_at, updated_at FROM ${sql.ref(tableName)} + WHERE deleted_at IS NULL + AND ${buildStatusCondition(db, "published")} + ${locale ? sql`AND locale = ${locale}` : sql``} + ORDER BY published_at DESC, id DESC + `.execute(db); + return result.rows; +} + /** * Create an EmDash Live Collections loader * diff --git a/packages/core/src/query.ts b/packages/core/src/query.ts index a73b178c74..7645b67eb0 100644 --- a/packages/core/src/query.ts +++ b/packages/core/src/query.ts @@ -32,11 +32,13 @@ import { FOLDED_BYLINES, FOLDED_BYLINES_EXIST, FOLDED_TERMS, + loadPublishedDates, type WhereRange, type WhereValue, } from "./loader.js"; import { cachedQuery, + contentCacheNamespaces, contentNamespaces, invalidateSchemaObjectCache, } from "./object-cache/index.js"; @@ -46,7 +48,7 @@ import { getRequestContext } from "./request-context.js"; import { resetRegisteredCollectionsCache } from "./schema/collection-slugs-cache.js"; import { compileUrlPattern } from "./schema/url-pattern.js"; import type { TaxonomyTerm } from "./taxonomies/types.js"; -import { isMissingTableError } from "./utils/db-errors.js"; +import { isMissingColumnError, isMissingTableError } from "./utils/db-errors.js"; import { createEditable, createNoop, @@ -210,6 +212,58 @@ export interface CacheHint { lastModified?: Date; } +interface PublishedDatesResult { + dates: Date[]; + cacheHint: CacheHint; + error?: Error; +} + +/** @internal Publication dates for the Archives widget. */ +export async function getPublishedDates( + type: string, + options?: { locale?: string }, +): Promise { + const locale = effectiveLocaleKey(options) || undefined; + const key = `publishedDates:${JSON.stringify([type, locale])}`; + try { + return await requestCached(key, () => + cachedQuery({ + namespace: contentCacheNamespaces(type), + key, + load: async () => { + const rows = await loadPublishedDates(type, locale); + const dates: Date[] = []; + let lastModified: Date | undefined; + for (const row of rows) { + if (row.published_at) { + const date = new Date(row.published_at); + if (!Number.isNaN(date.getTime())) dates.push(date); + } + if (row.updated_at) { + const modified = new Date(row.updated_at); + if (!Number.isNaN(modified.getTime()) && (!lastModified || modified > lastModified)) { + lastModified = modified; + } + } + } + return { dates, cacheHint: { tags: [type], lastModified } }; + }, + }), + ); + } catch (error) { + return { + dates: [], + cacheHint: {}, + error: + isMissingTableError(error) || isMissingColumnError(error) + ? undefined + : error instanceof Error + ? error + : new Error("Failed to load publication dates"), + }; + } +} + /** * Result from getEmDashCollection */ diff --git a/packages/core/tests/unit/published-dates.test.ts b/packages/core/tests/unit/published-dates.test.ts new file mode 100644 index 0000000000..d2a15d5f0e --- /dev/null +++ b/packages/core/tests/unit/published-dates.test.ts @@ -0,0 +1,324 @@ +import { sql, type Kysely, type KyselyPlugin, type QueryId } from "kysely"; +import { afterAll, afterEach, beforeEach, expect, it, vi } from "vitest"; + +vi.mock("astro:content", async () => { + const { emdashLoader } = await import("../../src/loader.js"); + return { + getLiveCollection: vi.fn( + (_collection: string, filter: import("../../src/loader.js").CollectionFilter) => + emdashLoader().loadCollection!({ filter }), + ), + getLiveEntry: vi.fn(), + }; +}); + +import { ContentRepository } from "../../src/database/repositories/content.js"; +import type { Database } from "../../src/database/types.js"; +import { waitForDeferredTasks } from "../../src/deferred-tasks.js"; +import { setI18nConfig } from "../../src/i18n/config.js"; +import { + __setObjectCacheBackendForTests, + invalidateCollectionCache, + invalidateObjectCache, + type ObjectCacheBackend, +} from "../../src/object-cache/index.js"; +import { getEmDashCollection, getPublishedDates } from "../../src/query.js"; +import { runWithContext, type EmDashRequestContext } from "../../src/request-context.js"; +import { groupEntriesByPublishedAt } from "../../src/widgets/archives.js"; +import { createPostFixture } from "../utils/fixtures.js"; +import { + describeEachDialect, + destroySharedPool, + setupForDialectWithCollections, + teardownForDialect, + type DialectTestContext, +} from "../utils/test-db.js"; + +const march = "2026-03-15T12:00:00.000Z"; +const april = "2026-04-15T12:00:00.000Z"; +const may = "2026-05-15T12:00:00.000Z"; + +function memoryBackend(): ObjectCacheBackend { + const store = new Map(); + return { + get: (key) => Promise.resolve(store.get(key) ?? null), + set: (key, value) => { + store.set(key, value); + return Promise.resolve(); + }, + delete: (key) => { + store.delete(key); + return Promise.resolve(); + }, + }; +} + +afterAll(destroySharedPool); + +describeEachDialect("published dates", (dialect) => { + let ctx: DialectTestContext; + let db: Kysely; + let queries: Array<{ sql: string; fields?: string[] }>; + let failNextRead: boolean; + + beforeEach(async () => { + ctx = await setupForDialectWithCollections(dialect); + __setObjectCacheBackendForTests(null); + setI18nConfig(null); + queries = []; + failNextRead = false; + const reads = new Map(); + const plugin: KyselyPlugin = { + transformQuery(args) { + const compiled = ctx.db.getExecutor().compileQuery(args.node, args.queryId); + if (/^\s*(SELECT|WITH)\b/i.test(compiled.sql)) { + const query = { sql: compiled.sql }; + queries.push(query); + reads.set(args.queryId, query); + } + return args.node; + }, + async transformResult(args) { + const query = reads.get(args.queryId); + if (query) { + query.fields = Object.keys(args.result.rows[0] ?? {}).toSorted(); + if (failNextRead && query.sql.includes("ec_post")) { + failNextRead = false; + throw new Error("Content read failed"); + } + } + return args.result; + }, + }; + db = ctx.db.withPlugin(plugin); + }); + + afterEach(async () => { + await teardownForDialect(ctx); + __setObjectCacheBackendForTests(null); + setI18nConfig(null); + vi.clearAllMocks(); + }); + + async function seed( + slug: string, + publishedAt: string | null, + options: { locale?: string; status?: string; deletedAt?: string; updatedAt?: string } = {}, + ) { + const item = await new ContentRepository(ctx.db).create( + createPostFixture({ slug, status: "published", locale: options.locale ?? "en" }), + ); + await sql` + UPDATE ec_post SET published_at = ${publishedAt}, + updated_at = ${options.updatedAt ?? march}, status = ${options.status ?? "published"}, + deleted_at = ${options.deletedAt ?? null} + WHERE id = ${item.id} + `.execute(ctx.db); + return item.id; + } + + function read(options?: { locale?: string }, context: Partial = {}) { + return runWithContext({ editMode: false, db, ...context }, () => + getPublishedDates("post", options), + ); + } + + async function enableCache() { + await waitForDeferredTasks(); + __setObjectCacheBackendForTests(memoryBackend(), { revalidate: 60_000, defaultTtl: 3600 }); + } + + const contentReads = () => queries.filter((query) => query.sql.includes("ec_post")); + const timestamps = (dates: Date[]) => dates.map((date) => date.toISOString()); + + it("projects only dates while preserving visible groups and their full counts", async () => { + await seed("march-first", march); + await seed("april", april); + await seed("march-second", "2026-03-20T12:00:00.000Z"); + await seed("previous-year", "2025-12-15T12:00:00.000Z"); + await seed("draft", may, { status: "draft", updatedAt: "2030-01-01T12:00:00.000Z" }); + await seed("archived", may, { status: "archived" }); + await seed("deleted", may, { deletedAt: march }); + const past = await seed("scheduled-past", may, { status: "scheduled" }); + const future = await seed("scheduled-future", may, { status: "scheduled" }); + await sql`UPDATE ec_post SET scheduled_at = '2000-01-01T00:00:00.000Z' WHERE id = ${past}`.execute( + ctx.db, + ); + await sql`UPDATE ec_post SET scheduled_at = '2100-01-01T00:00:00.000Z' WHERE id = ${future}`.execute( + ctx.db, + ); + + const result = await read(); + expect(result.error).toBeUndefined(); + expect(timestamps(result.dates)).toEqual([ + april, + "2026-03-20T12:00:00.000Z", + march, + "2025-12-15T12:00:00.000Z", + ]); + expect(result.cacheHint).toEqual({ tags: ["post"], lastModified: new Date(march) }); + const entries = result.dates.map((publishedAt) => ({ data: { publishedAt } })); + expect(groupEntriesByPublishedAt(entries, { limit: 2 })).toEqual([ + { label: "April 2026", count: 1, url: "/archives/2026/04" }, + { label: "March 2026", count: 2, url: "/archives/2026/03" }, + ]); + expect(groupEntriesByPublishedAt(entries, { type: "yearly" })).toEqual([ + { label: "2026", count: 3, url: "/archives/2026" }, + { label: "2025", count: 1, url: "/archives/2025" }, + ]); + expect(queries).toHaveLength(1); + expect(queries[0]?.fields).toEqual(["published_at", "updated_at"]); + }); + + it("ignores invalid publication dates and retains visible last-modified hints through L2", async () => { + await seed("valid", march); + await seed("missing-date", null, { updatedAt: may }); + await seed("empty-date", ""); + await seed("invalid-date", "not-a-date"); + await seed("invalid-update", april, { updatedAt: "not-a-date" }); + await enableCache(); + const first = await read(); + await waitForDeferredTasks(); + const second = await read(); + expect(first.error).toBeUndefined(); + expect(second).toEqual(first); + expect(timestamps(second.dates)).toEqual([april, march]); + expect(second.cacheHint.lastModified).toEqual(new Date(may)); + expect(contentReads()).toHaveLength(1); + }); + + it("resolves explicit, request and configured locales without mixing cached dates", async () => { + await seed("english", march, { locale: "en" }); + await seed("french", april, { locale: "fr" }); + setI18nConfig({ defaultLocale: "fr", locales: ["en", "fr"] }); + await enableCache(); + expect(timestamps((await read({ locale: "en" }, { locale: "fr" })).dates)).toEqual([march]); + expect(timestamps((await read(undefined, { locale: "en" })).dates)).toEqual([march]); + expect(timestamps((await read()).dates)).toEqual([april]); + await waitForDeferredTasks(); + setI18nConfig(null); + expect(timestamps((await read()).dates)).toEqual([april, march]); + expect(timestamps((await read({ locale: "fr" })).dates)).toEqual([april]); + await waitForDeferredTasks(); + const before = contentReads().length; + expect(timestamps((await read({ locale: "fr" })).dates)).toEqual([april]); + expect(contentReads()).toHaveLength(before); + }); + + it("preserves collection results when content localization is disabled", async () => { + await seed("english", march, { locale: "en" }); + await seed("french", april, { locale: "fr" }); + for (const config of [null, { defaultLocale: "fr", locales: ["fr"] }]) { + setI18nConfig(config); + const expected = await runWithContext({ editMode: false, db }, () => + getEmDashCollection("post", { + orderBy: { published_at: "desc" }, + }), + ); + expect(timestamps((await read()).dates)).toEqual( + expected.entries.map((entry) => entry.data.publishedAt.toISOString()), + ); + } + }); + + it("shares concurrent reads within one request without reusing them in the next request", async () => { + await seed("published", march); + await runWithContext({ editMode: false, db }, async () => { + const results = await Promise.all([getPublishedDates("post"), getPublishedDates("post")]); + expect(results[0]).toEqual(results[1]); + expect(contentReads()).toHaveLength(1); + }); + await read(); + expect(contentReads()).toHaveLength(2); + }); + + it("rejects invalid collection identifiers and binds locale values", async () => { + await seed("published", march); + const invalid = await runWithContext({ editMode: false, db }, () => + getPublishedDates("post; DROP TABLE ec_post"), + ); + expect(invalid.error).toBeInstanceOf(Error); + expect(invalid.dates).toEqual([]); + expect(queries).toHaveLength(0); + expect((await read({ locale: "en' OR 1=1 --" })).dates).toEqual([]); + expect(timestamps((await read({ locale: "en" })).dates)).toEqual([march]); + }); + + it("reloads cached dates after current and legacy collection invalidation", async () => { + const id = await seed("published", march); + await enableCache(); + await read(); + await waitForDeferredTasks(); + expect(timestamps((await read()).dates)).toEqual([march]); + expect(contentReads()).toHaveLength(1); + await sql`UPDATE ec_post SET published_at = ${april} WHERE id = ${id}`.execute(ctx.db); + invalidateCollectionCache("post"); + await waitForDeferredTasks(); + expect(timestamps((await read()).dates)).toEqual([april]); + await waitForDeferredTasks(); + await sql`UPDATE ec_post SET published_at = ${may} WHERE id = ${id}`.execute(ctx.db); + invalidateObjectCache("content:post"); + await waitForDeferredTasks(); + expect(timestamps((await read()).dates)).toEqual([may]); + expect(contentReads()).toHaveLength(3); + }); + + it.each(["edit", "preview", "isolated"])( + "bypasses L2 reads and writes for %s requests", + async (mode) => { + const id = await seed("published", march); + await seed("draft", may, { status: "draft" }); + await enableCache(); + await read(); + await waitForDeferredTasks(); + await sql`UPDATE ec_post SET published_at = ${april} WHERE id = ${id}`.execute(ctx.db); + const context: Partial = + mode === "edit" + ? { editMode: true } + : mode === "preview" + ? { preview: { collection: "post", id } } + : { dbIsIsolated: true }; + expect(timestamps((await read(undefined, context)).dates)).toEqual([april]); + await waitForDeferredTasks(); + expect(timestamps((await read(undefined, context)).dates)).toEqual([april]); + await waitForDeferredTasks(); + expect(timestamps((await read()).dates)).toEqual([march]); + expect(contentReads()).toHaveLength(3); + }, + ); + + it("retries a failed read within the request without retaining its error in either cache", async () => { + await seed("published", march); + await enableCache(); + failNextRead = true; + await runWithContext({ editMode: false, db }, async () => { + const failed = await getPublishedDates("post"); + expect(failed.error).toBeInstanceOf(Error); + expect(failed.dates).toEqual([]); + await waitForDeferredTasks(); + const retried = await getPublishedDates("post"); + expect(retried.error).toBeUndefined(); + expect(timestamps(retried.dates)).toEqual([march]); + }); + await waitForDeferredTasks(); + expect(timestamps((await read()).dates)).toEqual([march]); + expect(contentReads()).toHaveLength(2); + }); + + it("does not cache a missing table as an empty collection", async () => { + await enableCache(); + const load = () => runWithContext({ editMode: false, db }, () => getPublishedDates("missing")); + const missing = await load(); + expect(missing.dates).toEqual([]); + expect(missing.error).toBeUndefined(); + await waitForDeferredTasks(); + await sql`CREATE TABLE ec_missing ( + id TEXT PRIMARY KEY, published_at TEXT, updated_at TEXT, + status TEXT, deleted_at TEXT, locale TEXT + )`.execute(ctx.db); + await sql`INSERT INTO ec_missing VALUES ('entry', ${march}, ${march}, 'published', NULL, 'en')`.execute( + ctx.db, + ); + expect(timestamps((await load()).dates)).toEqual([march]); + }); +}); diff --git a/scripts/query-counts.queries.d1.json b/scripts/query-counts.queries.d1.json index 985924b47d..5b9030550c 100644 --- a/scripts/query-counts.queries.d1.json +++ b/scripts/query-counts.queries.d1.json @@ -220,12 +220,12 @@ "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, - "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC LIMIT ?": 1, "SELECT c.*, (SELECT json_object('seo_title', s.seo_title, 'seo_description', s.seo_description, 'seo_image', s.seo_image, 'seo_canonical', s.seo_canonical, 'seo_no_index', s.seo_no_index) FROM \"_emdash_seo\" AS s WHERE s.collection = ? AND s.content_id = \"c\".id LIMIT 1) AS \"_emdash_seo\", (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"c\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"c\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"c\".id AND b.locale = \"c\".locale) AS \"_emdash_bylines\", ( SELECT json_object( 'bylinesExist', _emdash_bylines_exist, 'booleanFields', _emdash_boolean_fields ) FROM (SELECT (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\") AS metadata ) AS _emdash_entry_metadata FROM \"ec_posts\" AS c WHERE c.deleted_at IS NULL AND (c.slug = ? OR c.id = ?) LIMIT 1": 1, "select count(\"id\") as \"count\" from \"_emdash_comments\" where \"collection\" = ? and \"content_id\" = ? and \"status\" = ?": 1, "SELECT COUNT(*) as count FROM \"_emdash_migrations\"": 1, "select distinct \"name\" from \"_emdash_menus\"": 1, + "SELECT published_at, updated_at FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY published_at DESC, id DESC": 1, "SELECT taxonomy_id, SUM(count) AS count FROM ( SELECT ct.taxonomy_id AS taxonomy_id, COUNT(DISTINCT e.translation_group) AS count FROM content_taxonomies AS ct CROSS JOIN \"ec_posts\" AS e WHERE e.translation_group = ct.entry_id AND ct.collection = ? AND ct.taxonomy_id IN (SELECT translation_group FROM taxonomies WHERE name = ?) AND \"e\".\"status\" = ? AND e.deleted_at IS NULL GROUP BY ct.taxonomy_id) AS per_collection GROUP BY taxonomy_id": 1, "UPDATE _emdash_cron_tasks SET status = 'idle', locked_at = NULL WHERE status = 'running' AND locked_at < ?": 1 }, @@ -239,11 +239,11 @@ "select * from \"_emdash_widgets\" order by \"sort_order\" asc": 1, "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, - "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC LIMIT ?": 1, "SELECT c.*, (SELECT json_object('seo_title', s.seo_title, 'seo_description', s.seo_description, 'seo_image', s.seo_image, 'seo_canonical', s.seo_canonical, 'seo_no_index', s.seo_no_index) FROM \"_emdash_seo\" AS s WHERE s.collection = ? AND s.content_id = \"c\".id LIMIT 1) AS \"_emdash_seo\", (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"c\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"c\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"c\".id AND b.locale = \"c\".locale) AS \"_emdash_bylines\", ( SELECT json_object( 'bylinesExist', _emdash_bylines_exist, 'booleanFields', _emdash_boolean_fields ) FROM (SELECT (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\") AS metadata ) AS _emdash_entry_metadata FROM \"ec_posts\" AS c WHERE c.deleted_at IS NULL AND (c.slug = ? OR c.id = ?) LIMIT 1": 1, "select count(\"id\") as \"count\" from \"_emdash_comments\" where \"collection\" = ? and \"content_id\" = ? and \"status\" = ?": 1, "select distinct \"name\" from \"_emdash_menus\"": 1, + "SELECT published_at, updated_at FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY published_at DESC, id DESC": 1, "SELECT taxonomy_id, SUM(count) AS count FROM ( SELECT ct.taxonomy_id AS taxonomy_id, COUNT(DISTINCT e.translation_group) AS count FROM content_taxonomies AS ct CROSS JOIN \"ec_posts\" AS e WHERE e.translation_group = ct.entry_id AND ct.collection = ? AND ct.taxonomy_id IN (SELECT translation_group FROM taxonomies WHERE name = ?) AND \"e\".\"status\" = ? AND e.deleted_at IS NULL GROUP BY ct.taxonomy_id) AS per_collection GROUP BY taxonomy_id": 1 }, "GET /rss.xml (cold)": { diff --git a/scripts/query-counts.queries.sqlite.json b/scripts/query-counts.queries.sqlite.json index 30584e02ba..2977c55353 100644 --- a/scripts/query-counts.queries.sqlite.json +++ b/scripts/query-counts.queries.sqlite.json @@ -118,10 +118,10 @@ "select * from \"_emdash_taxonomy_defs\" where \"name\" = ? order by \"locale\" asc": 2, "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, - "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC LIMIT ?": 1, "SELECT c.*, (SELECT json_object('seo_title', s.seo_title, 'seo_description', s.seo_description, 'seo_image', s.seo_image, 'seo_canonical', s.seo_canonical, 'seo_no_index', s.seo_no_index) FROM \"_emdash_seo\" AS s WHERE s.collection = ? AND s.content_id = \"c\".id LIMIT 1) AS \"_emdash_seo\", (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"c\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"c\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"c\".id AND b.locale = \"c\".locale) AS \"_emdash_bylines\", ( SELECT json_object( 'bylinesExist', _emdash_bylines_exist, 'booleanFields', _emdash_boolean_fields ) FROM (SELECT (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\") AS metadata ) AS _emdash_entry_metadata FROM \"ec_posts\" AS c WHERE c.deleted_at IS NULL AND (c.slug = ? OR c.id = ?) LIMIT 1": 1, "select count(\"id\") as \"count\" from \"_emdash_comments\" where \"collection\" = ? and \"content_id\" = ? and \"status\" = ?": 1, + "SELECT published_at, updated_at FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY published_at DESC, id DESC": 1, "SELECT taxonomy_id, SUM(count) AS count FROM ( SELECT ct.taxonomy_id AS taxonomy_id, COUNT(DISTINCT e.translation_group) AS count FROM content_taxonomies AS ct CROSS JOIN \"ec_posts\" AS e WHERE e.translation_group = ct.entry_id AND ct.collection = ? AND ct.taxonomy_id IN (SELECT translation_group FROM taxonomies WHERE name = ?) AND \"e\".\"status\" = ? AND e.deleted_at IS NULL GROUP BY ct.taxonomy_id) AS per_collection GROUP BY taxonomy_id": 1 }, "GET /posts/building-for-the-long-term (warm)": { @@ -134,10 +134,10 @@ "select * from \"_emdash_taxonomy_defs\" where \"name\" = ? order by \"locale\" asc": 2, "select * from \"taxonomies\" where \"name\" = ? order by \"sort_order\" asc, \"label\" asc": 2, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_pages\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_pages\".id AND b.locale = \"ec_pages\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"created_at\" DESC, \"id\" DESC": 1, - "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "SELECT *, (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"ec_posts\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"ec_posts\".id AND b.locale = \"ec_posts\".locale) AS \"_emdash_bylines\", (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY \"published_at\" DESC, \"id\" DESC LIMIT ?": 1, "SELECT c.*, (SELECT json_object('seo_title', s.seo_title, 'seo_description', s.seo_description, 'seo_image', s.seo_image, 'seo_canonical', s.seo_canonical, 'seo_no_index', s.seo_no_index) FROM \"_emdash_seo\" AS s WHERE s.collection = ? AND s.content_id = \"c\".id LIMIT 1) AS \"_emdash_seo\", (SELECT json_group_array(json_object('id', coalesce(exact_term.id, default_term.id), 'name', coalesce(exact_term.name, default_term.name), 'slug', coalesce(exact_term.slug, default_term.slug), 'label', coalesce(exact_term.label, default_term.label), 'parent_id', coalesce(exact_term.parent_id, default_term.parent_id), 'locale', coalesce(exact_term.locale, default_term.locale), 'translation_group', coalesce(exact_term.translation_group, default_term.translation_group))) FILTER (WHERE coalesce(exact_term.id, default_term.id) IS NOT NULL) FROM \"content_taxonomies\" AS ct LEFT JOIN \"taxonomies\" AS exact_term ON exact_term.translation_group = ct.taxonomy_id AND exact_term.locale = \"c\".locale LEFT JOIN \"taxonomies\" AS default_term ON default_term.translation_group = ct.taxonomy_id AND default_term.locale = ? WHERE ct.collection = ? AND ct.entry_id = \"c\".translation_group) AS \"_emdash_terms\", (SELECT json_group_array(json_object('roleLabel', cb.role_label, 'sortOrder', cb.sort_order, 'byline', json_object('id', b.id, 'slug', b.slug, 'displayName', b.display_name, 'bio', b.bio, 'avatarMediaId', b.avatar_media_id, 'avatarStorageKey', m.storage_key, 'avatarAlt', m.alt, 'avatarBlurhash', m.blurhash, 'avatarDominantColor', m.dominant_color, 'websiteUrl', b.website_url, 'userId', b.user_id, 'isGuest', b.is_guest, 'createdAt', b.created_at, 'updatedAt', b.updated_at, 'locale', b.locale, 'translationGroup', b.translation_group))) FROM \"_emdash_content_bylines\" AS cb CROSS JOIN \"_emdash_bylines\" AS b ON b.translation_group = cb.byline_id LEFT JOIN \"media\" AS m ON m.id = b.avatar_media_id WHERE cb.collection_slug = ? AND cb.content_id = \"c\".id AND b.locale = \"c\".locale) AS \"_emdash_bylines\", ( SELECT json_object( 'bylinesExist', _emdash_bylines_exist, 'booleanFields', _emdash_boolean_fields ) FROM (SELECT (SELECT 1 FROM \"_emdash_bylines\" LIMIT 1) AS \"_emdash_bylines_exist\", ( SELECT json_group_array(f.slug) FROM \"_emdash_fields\" AS f INNER JOIN \"_emdash_collections\" AS c ON c.id = f.collection_id WHERE c.slug = ? AND f.type = ? ) AS \"_emdash_boolean_fields\") AS metadata ) AS _emdash_entry_metadata FROM \"ec_posts\" AS c WHERE c.deleted_at IS NULL AND (c.slug = ? OR c.id = ?) LIMIT 1": 1, "select count(\"id\") as \"count\" from \"_emdash_comments\" where \"collection\" = ? and \"content_id\" = ? and \"status\" = ?": 1, + "SELECT published_at, updated_at FROM \"ec_posts\" WHERE deleted_at IS NULL AND \"status\" = ? ORDER BY published_at DESC, id DESC": 1, "SELECT taxonomy_id, SUM(count) AS count FROM ( SELECT ct.taxonomy_id AS taxonomy_id, COUNT(DISTINCT e.translation_group) AS count FROM content_taxonomies AS ct CROSS JOIN \"ec_posts\" AS e WHERE e.translation_group = ct.entry_id AND ct.collection = ? AND ct.taxonomy_id IN (SELECT translation_group FROM taxonomies WHERE name = ?) AND \"e\".\"status\" = ? AND e.deleted_at IS NULL GROUP BY ct.taxonomy_id) AS per_collection GROUP BY taxonomy_id": 1 }, "GET /rss.xml (cold)": {