From 262d5b71b6a117bf8dec5b4555aa12818137376d Mon Sep 17 00:00:00 2001 From: scottbuscemi Date: Tue, 9 Jun 2026 13:49:44 -0700 Subject: [PATCH 1/5] perf(core): cache taxonomy defs per-isolate; move runtime/db singletons to globalThis Cut per-render D1 round trips on public pages by caching taxonomy definitions across the worker isolate, and harden the runtime/DB singletons against bundler module duplication. - getTaxonomyDefs (query #12, hit on every render that hydrates entry terms) now has a two-tier cache: per-request + per-isolate via a globalThis Symbol holder keyed by locale, invalidated in-memory by every def write (handleTaxonomyCreate, seed). Isolated DBs bypass it. - runtimeInstance/dbCache/dbInitPromise moved onto globalThis behind Symbol keys so Vite SSR chunk duplication can't spawn duplicate caches that re-run cold-start migrations/bootstrap reads. No schema or public-API changes. Cold-start db.batch() batching deferred to a follow-up. --- .../perf-taxonomy-defs-isolate-cache.md | 11 ++ packages/core/src/api/handlers/taxonomies.ts | 6 +- packages/core/src/astro/middleware.ts | 43 ++++-- packages/core/src/emdash-runtime.ts | 38 ++++-- packages/core/src/loader.ts | 12 ++ packages/core/src/seed/apply.ts | 6 + packages/core/src/taxonomies/index.ts | 124 +++++++++++++++-- .../tests/unit/taxonomies/defs-cache.test.ts | 128 ++++++++++++++++++ packages/core/tests/utils/test-db.ts | 18 +++ 9 files changed, 358 insertions(+), 28 deletions(-) create mode 100644 .changeset/perf-taxonomy-defs-isolate-cache.md create mode 100644 packages/core/tests/unit/taxonomies/defs-cache.test.ts diff --git a/.changeset/perf-taxonomy-defs-isolate-cache.md b/.changeset/perf-taxonomy-defs-isolate-cache.md new file mode 100644 index 0000000000..0d1f69519e --- /dev/null +++ b/.changeset/perf-taxonomy-defs-isolate-cache.md @@ -0,0 +1,11 @@ +--- +"emdash": patch +--- + +Cut per-render D1 round trips on public pages by caching taxonomy definitions across the worker isolate, and harden the runtime/DB singletons against bundler module duplication. + +Every public render that hydrates entry terms read `SELECT * FROM _emdash_taxonomy_defs` (via `getTaxonomyDefs` → `getCollectionTaxonomyNames`), which only had per-request caching. On Cloudflare D1, where the worker colo is often far from the database primary, each query is a ~40ms cross-region round trip, so this fired on every warm request for no benefit — taxonomy *definitions* change extremely rarely (created via the admin API or a seed; there is no edit/delete-def path). They're now cached per-isolate behind a `globalThis` Symbol holder (the same two-tier pattern as `settings/index.ts` and the byline field-defs cache), keyed by resolved locale and invalidated in-memory by every def write (`handleTaxonomyCreate`, seed application). Invalidation is in-memory rather than a persisted version probe on purpose: a per-request version read would merely replace the query being removed, yielding no net saving on warm isolates. Isolated databases (playground / DO preview) bypass the cache. + +Separately, the cached runtime instance, the DB-instance cache, and the in-flight DB-init promise (`astro/middleware.ts`, `emdash-runtime.ts`) were plain module-scoped variables. Under Vite SSR chunk duplication those can become multiple independent copies, letting cold-start migrations and bootstrap reads re-run on requests that should have hit the warm cache. They now live on `globalThis` behind Symbol keys, matching the existing `SETUP_VERIFIED_KEY` / request-context / request-cache singletons. + +No schema changes, no public API changes, fully backwards compatible. diff --git a/packages/core/src/api/handlers/taxonomies.ts b/packages/core/src/api/handlers/taxonomies.ts index 9bce9398c5..51fafa69ae 100644 --- a/packages/core/src/api/handlers/taxonomies.ts +++ b/packages/core/src/api/handlers/taxonomies.ts @@ -12,7 +12,7 @@ import { ulid } from "ulidx"; import { TaxonomyRepository } from "../../database/repositories/taxonomy.js"; import type { Database, TaxonomyDefTable } from "../../database/types.js"; -import { invalidateTermCache } from "../../taxonomies/index.js"; +import { invalidateTaxonomyDefsCache, invalidateTermCache } from "../../taxonomies/index.js"; import type { ApiResult } from "../types.js"; const NAME_PATTERN = /^[a-z][a-z0-9_]*$/; @@ -281,6 +281,10 @@ export async function handleTaxonomyCreate( }) .execute(); + // A new def changes which taxonomies exist — drop the isolate-wide + // defs/names caches so this isolate reflects it immediately. + invalidateTaxonomyDefsCache(); + const row = await db .selectFrom("_emdash_taxonomy_defs") .selectAll() diff --git a/packages/core/src/astro/middleware.ts b/packages/core/src/astro/middleware.ts index 1c5c780987..425a427356 100644 --- a/packages/core/src/astro/middleware.ts +++ b/packages/core/src/astro/middleware.ts @@ -55,10 +55,33 @@ import type { EmDashConfig } from "./integration/runtime.js"; import { createPublicPluginApiRouteHandler } from "./public-plugin-api-routes.js"; import type { EmDashHandlers } from "./types.js"; -// Cached runtime instance (persists across requests within worker) -let runtimeInstance: EmDashRuntime | null = null; -// Whether initialization is in progress (prevents concurrent init attempts) -let runtimeInitializing = false; +/** + * Cached runtime instance + in-progress flag, persisted across requests + * within a worker isolate. + * + * Stored on globalThis behind a Symbol key (same pattern as + * `SETUP_VERIFIED_KEY` below and `settings/index.ts`) so the bundler + * duplicating this module across SSR chunks can't produce two independent + * runtime singletons. A plain module-scoped `let` becomes multiple variables + * under Vite SSR chunking, which would let the cold-start init (and its ~8 + * bootstrap D1 queries) re-run far more often than once-per-isolate. + */ +interface RuntimeHolder { + instance: EmDashRuntime | null; + /** Whether initialization is in progress (prevents concurrent init attempts). */ + initializing: boolean; +} + +const RUNTIME_HOLDER_KEY = Symbol.for("emdash:runtime-holder"); +const runtimeStore = globalThis as Record; +const runtimeHolder: RuntimeHolder = + // eslint-disable-next-line typescript/no-unsafe-type-assertion -- globalThis singleton pattern (see settings/index.ts) + (runtimeStore[RUNTIME_HOLDER_KEY] as RuntimeHolder | undefined) ?? + (() => { + const h: RuntimeHolder = { instance: null, initializing: false }; + runtimeStore[RUNTIME_HOLDER_KEY] = h; + return h; + })(); /** Whether i18n config has been initialized from the virtual module */ let i18nInitialized = false; @@ -177,27 +200,27 @@ async function getRuntime( initTimings?: Array<{ name: string; dur: number; desc?: string }>, ): Promise { // Return cached instance if available - if (runtimeInstance) { - return runtimeInstance; + if (runtimeHolder.instance) { + return runtimeHolder.instance; } // If another request is already initializing, wait and retry. // We don't share the promise across requests because workerd flags // cross-request promise resolution (causes warnings + potential hangs). - if (runtimeInitializing) { + if (runtimeHolder.initializing) { // Poll until the initializing request finishes await new Promise((resolve) => setTimeout(resolve, 50)); return getRuntime(config, initTimings); } - runtimeInitializing = true; + runtimeHolder.initializing = true; try { const deps = buildDependencies(config); const runtime = await EmDashRuntime.create(deps, initTimings); - runtimeInstance = runtime; + runtimeHolder.instance = runtime; return runtime; } finally { - runtimeInitializing = false; + runtimeHolder.initializing = false; } } diff --git a/packages/core/src/emdash-runtime.ts b/packages/core/src/emdash-runtime.ts index b32bb52538..9be96be82a 100644 --- a/packages/core/src/emdash-runtime.ts +++ b/packages/core/src/emdash-runtime.ts @@ -311,8 +311,28 @@ function contentItemToRecord(item: ContentItemInternal): Record } // Module-level caches (persist across requests within worker) -const dbCache = new Map>(); -let dbInitPromise: Promise> | null = null; +// +// The DB instance cache + in-flight init promise live on globalThis behind a +// Symbol key (same pattern as request-cache.ts / settings/index.ts) so that +// bundler duplication of this module across SSR chunks can't produce two +// independent caches. A plain module-scoped `const`/`let` becomes multiple +// variables under Vite SSR chunking, which would let cold-start migrations + +// bootstrap reads re-run on requests that should have hit the warm cache. +interface DbInitHolder { + cache: Map>; + initPromise: Promise> | null; +} + +const DB_INIT_HOLDER_KEY = Symbol.for("emdash:db-init-holder"); +const dbInitStore = globalThis as Record; +const dbInitHolder: DbInitHolder = + // eslint-disable-next-line typescript/no-unsafe-type-assertion -- globalThis singleton pattern (see settings/index.ts) + (dbInitStore[DB_INIT_HOLDER_KEY] as DbInitHolder | undefined) ?? + (() => { + const h: DbInitHolder = { cache: new Map>(), initPromise: null }; + dbInitStore[DB_INIT_HOLDER_KEY] = h; + return h; + })(); const storageCache = new Map(); const sandboxedPluginCache = new Map(); /** @@ -1271,7 +1291,7 @@ export class EmDashRuntime { const cacheKey = dbConfig.entrypoint; // Return cached instance if available - const cached = dbCache.get(cacheKey); + const cached = dbInitHolder.cache.get(cacheKey); if (cached) { return cached; } @@ -1280,11 +1300,11 @@ export class EmDashRuntime { // Sharing this promise across requests is safe because the Kysely instance // doesn't hold a request-scoped resource — the DO dialect uses a getStub() // factory that creates a fresh stub per query execution. - if (dbInitPromise) { - return dbInitPromise; + if (dbInitHolder.initPromise) { + return dbInitHolder.initPromise; } - dbInitPromise = (async () => { + dbInitHolder.initPromise = (async () => { const dialect = deps.createDialect(dbConfig.config); const db = new Kysely({ dialect, log: kyselyLogOption() }); @@ -1338,14 +1358,14 @@ export class EmDashRuntime { // Tables may not exist yet. Non-fatal. } - dbCache.set(cacheKey, db); + dbInitHolder.cache.set(cacheKey, db); return db; })(); try { - return await dbInitPromise; + return await dbInitHolder.initPromise; } finally { - dbInitPromise = null; + dbInitHolder.initPromise = null; } } diff --git a/packages/core/src/loader.ts b/packages/core/src/loader.ts index 127bcb9dbb..1f4b954246 100644 --- a/packages/core/src/loader.ts +++ b/packages/core/src/loader.ts @@ -152,6 +152,18 @@ async function getTaxonomyNames(db: Kysely): Promise> { } } +/** + * Reset the module-scoped taxonomy-names cache. + * + * Called from `invalidateTaxonomyDefsCache()` so that creating or seeding a + * taxonomy definition is reflected within the current isolate instead of + * waiting for the isolate to recycle. Keeps this cache consistent with the + * isolate-wide taxonomy-defs cache in `taxonomies/index.ts`. + */ +export function resetTaxonomyNamesCache(): void { + taxonomyNames = null; +} + /** * System columns to include in data (mapped to camelCase where needed) */ diff --git a/packages/core/src/seed/apply.ts b/packages/core/src/seed/apply.ts index accbd0d8e8..1f8275b348 100644 --- a/packages/core/src/seed/apply.ts +++ b/packages/core/src/seed/apply.ts @@ -339,6 +339,12 @@ export async function applySeed( } } } + + // Seeded/updated defs change which taxonomies exist — clear the + // isolate-wide defs + names caches so later reads in this isolate + // (e.g. an auto-seed triggered mid-request) reflect them immediately. + const { invalidateTaxonomyDefsCache } = await import("../taxonomies/index.js"); + invalidateTaxonomyDefsCache(); } // 6. Bylines diff --git a/packages/core/src/taxonomies/index.ts b/packages/core/src/taxonomies/index.ts index 0571045f39..e88efbdde8 100644 --- a/packages/core/src/taxonomies/index.ts +++ b/packages/core/src/taxonomies/index.ts @@ -12,8 +12,9 @@ */ import { resolveLocale, resolveLocaleChain } from "../i18n/resolve.js"; -import { getDb } from "../loader.js"; +import { getDb, resetTaxonomyNamesCache } from "../loader.js"; import { peekRequestCache, requestCached, setRequestCacheEntry } from "../request-cache.js"; +import { getRequestContext } from "../request-context.js"; import { chunks, SQL_BATCH_SIZE } from "../utils/chunks.js"; import { isMissingTableError } from "../utils/db-errors.js"; import type { TaxonomyDef, TaxonomyTerm, TaxonomyTermRow } from "./types.js"; @@ -29,20 +30,127 @@ export function invalidateTermCache(): void { // Intentionally empty. } +/** + * Worker-isolate cache for taxonomy definitions, keyed by resolved locale. + * + * Taxonomy *definitions* (the "category"/"tag" taxonomies themselves, not + * their terms) are read on every public render that hydrates entry terms — + * `getAllTermsForEntries` → `getCollectionTaxonomyNames` → `getTaxonomyDefs` — + * but change extremely rarely: they're created via the admin API or applied + * from a seed, and there is no edit/delete-def path. Caching them across the + * isolate lifetime drops the per-render `SELECT * FROM _emdash_taxonomy_defs` + * to once-per-isolate. + * + * Stored on globalThis behind a Symbol key (same pattern as + * `settings/index.ts`) so the bundler duplicating this module across SSR + * chunks can't produce two independent caches. + * + * **Invalidation is in-memory, not a persisted version probe.** A persisted + * `taxonomy_defs_version` row (the byline-field-defs approach) would force a + * cheap version read on every request — which would merely *replace* the + * query we're removing, yielding no net round-trip saving on warm isolates. + * Instead every def write calls `invalidateTaxonomyDefsCache()`, bumping an + * in-memory version within the writing isolate. Other isolates keep serving + * their cached copy until they recycle — staleness bounded by isolate + * lifetime, matching the long-standing `loader.ts` taxonomy-names cache and + * `settings/index.ts`. + * + * **Isolated databases bypass the cache.** Playground / DO preview requests + * set `requestContext.dbIsIsolated`; they point at a divergent schema, so we + * skip both reading and writing the global holder and fall back to the + * per-request cache (same precedent as `getTaxonomyNames` / byline field defs). + */ +interface TaxonomyDefsHolder { + version: number; + /** locale key ("*" for "all locales") → { version it was fetched at, promise }. */ + cache: Map }>; +} + +const TAXONOMY_DEFS_CACHE_KEY = Symbol.for("emdash:taxonomy-defs"); +const taxonomyDefsStore = globalThis as Record; +const defsHolder: TaxonomyDefsHolder = + // eslint-disable-next-line typescript/no-unsafe-type-assertion -- globalThis singleton pattern (see settings/index.ts) + (taxonomyDefsStore[TAXONOMY_DEFS_CACHE_KEY] as TaxonomyDefsHolder | undefined) ?? + (() => { + const h: TaxonomyDefsHolder = { version: 0, cache: new Map() }; + taxonomyDefsStore[TAXONOMY_DEFS_CACHE_KEY] = h; + return h; + })(); + +/** + * Invalidate the isolate-wide taxonomy-definitions cache (and the related + * loader taxonomy-names cache). Called from every taxonomy-def write path + * (`handleTaxonomyCreate`, seed application). Other isolates refresh on their + * next recycle — staleness bounded by isolate lifetime. + */ +export function invalidateTaxonomyDefsCache(): void { + defsHolder.version++; + defsHolder.cache.clear(); + resetTaxonomyNamesCache(); +} + +/** + * Test/internal helper: clear the per-isolate taxonomy-defs cache. Useful for + * unit tests that insert defs directly and need to force a refetch without + * going through a write path. Production code should rely on + * `invalidateTaxonomyDefsCache()`. + */ +export function resetTaxonomyDefsCacheForTests(): void { + defsHolder.version++; + defsHolder.cache.clear(); +} + +/** + * Fetch taxonomy definitions straight from the database (no caching). + */ +async function fetchTaxonomyDefs(locale: string | undefined): Promise { + const db = await getDb(); + let query = db.selectFrom("_emdash_taxonomy_defs").selectAll(); + if (locale !== undefined) query = query.where("locale", "=", locale); + const rows = await query.execute(); + return rows.map(rowToTaxonomyDef); +} + +/** + * Resolve taxonomy defs through the isolate cache, bypassing it for isolated + * databases. The returned promise is cached (not the resolved value) so + * concurrent cold-isolate readers share one in-flight query; a rejection + * evicts the entry so the next caller retries. + */ +function loadTaxonomyDefs(localeKey: string, locale: string | undefined): Promise { + if (getRequestContext()?.dbIsIsolated === true) { + return fetchTaxonomyDefs(locale); + } + const existing = defsHolder.cache.get(localeKey); + if (existing && existing.version === defsHolder.version) { + return existing.promise; + } + const version = defsHolder.version; + const promise = fetchTaxonomyDefs(locale).catch((error: unknown) => { + const current = defsHolder.cache.get(localeKey); + if (current && current.promise === promise) { + defsHolder.cache.delete(localeKey); + } + throw error; + }); + defsHolder.cache.set(localeKey, { version, promise }); + return promise; +} + /** * Get every taxonomy definition. Definitions are per-locale (one row per * locale inside the same translation_group) — by default we resolve to the * active locale. + * + * Two-tier cache: per-request via `requestCached` (so a single render that + * hydrates terms for several collections pays at most one call), then + * per-isolate via the global holder (so warm renders issue zero queries). + * The `requestCached` key is unchanged so `getTaxonomyDef`'s peek still hits. */ export async function getTaxonomyDefs(options: TaxonomyQueryOptions = {}): Promise { const locale = resolveLocale(options.locale); - return requestCached(`taxonomy-defs:${locale ?? "*"}`, async () => { - const db = await getDb(); - let query = db.selectFrom("_emdash_taxonomy_defs").selectAll(); - if (locale !== undefined) query = query.where("locale", "=", locale); - const rows = await query.execute(); - return rows.map(rowToTaxonomyDef); - }); + const localeKey = locale ?? "*"; + return requestCached(`taxonomy-defs:${localeKey}`, () => loadTaxonomyDefs(localeKey, locale)); } /** diff --git a/packages/core/tests/unit/taxonomies/defs-cache.test.ts b/packages/core/tests/unit/taxonomies/defs-cache.test.ts new file mode 100644 index 0000000000..2bc4116733 --- /dev/null +++ b/packages/core/tests/unit/taxonomies/defs-cache.test.ts @@ -0,0 +1,128 @@ +/** + * Isolate-wide taxonomy-definitions cache (perf: removes the per-render + * `SELECT * FROM _emdash_taxonomy_defs` on warm isolates). + * + * The cache lives on globalThis and is keyed by resolved locale. Because + * `requestCached` dedupes within a single request scope, we exercise the + * isolate cache by running each `getTaxonomyDefs()` call inside its own + * `runWithContext` scope (a fresh context object => a fresh per-request + * cache bucket), so a second call only avoids the DB if the *isolate* + * cache served it. + */ + +import Database from "better-sqlite3"; +import { Kysely, SqliteDialect } from "kysely"; +import { ulid } from "ulidx"; +import { afterEach, beforeEach, describe, expect, it } from "vitest"; + +import { runMigrations } from "../../../src/database/migrations/runner.js"; +import type { Database as EmDashDatabase } from "../../../src/database/types.js"; +import { runWithContext } from "../../../src/request-context.js"; +import { + getTaxonomyDefs, + invalidateTaxonomyDefsCache, + resetTaxonomyDefsCacheForTests, +} from "../../../src/taxonomies/index.js"; + +let queryCount = 0; + +function makeDb(): { db: Kysely; sqlite: Database.Database } { + const sqlite = new Database(":memory:"); + const db = new Kysely({ + dialect: new SqliteDialect({ database: sqlite }), + log(event) { + if (event.level === "query" && event.query.sql.includes("_emdash_taxonomy_defs")) { + queryCount += 1; + } + }, + }); + return { db, sqlite }; +} + +async function insertDef(db: Kysely, name: string): Promise { + await db + .insertInto("_emdash_taxonomy_defs") + .values({ + id: ulid(), + name, + label: name, + label_singular: null, + hierarchical: 0, + collections: JSON.stringify(["posts"]), + }) + .execute(); +} + +/** Run a getter in a fresh per-request scope with the test db as the ALS db. */ +function inScope( + db: Kysely, + fn: () => Promise, + opts?: { dbIsIsolated?: boolean }, +): Promise { + return runWithContext({ editMode: false, db, ...opts }, fn); +} + +describe("getTaxonomyDefs — isolate cache", () => { + let db: Kysely; + let sqlite: Database.Database; + + beforeEach(async () => { + ({ db, sqlite } = makeDb()); + await runMigrations(db); + // Holder lives on globalThis; reset so sibling tests don't leak the + // previous test's db/promise into this one. + resetTaxonomyDefsCacheForTests(); + await insertDef(db, "genre"); + queryCount = 0; + }); + + afterEach(async () => { + await db.destroy(); + sqlite.close(); + }); + + it("queries once per isolate, serving later requests from cache", async () => { + const first = await inScope(db, () => getTaxonomyDefs()); + expect(queryCount).toBe(1); + expect(first.map((d) => d.name)).toContain("genre"); + + // A separate request scope: per-request cache can't help, so a second + // query would fire unless the isolate cache served it. + const second = await inScope(db, () => getTaxonomyDefs()); + expect(queryCount).toBe(1); + expect(second.map((d) => d.name).toSorted()).toEqual(first.map((d) => d.name).toSorted()); + }); + + it("re-queries after invalidateTaxonomyDefsCache()", async () => { + await inScope(db, () => getTaxonomyDefs()); + expect(queryCount).toBe(1); + + invalidateTaxonomyDefsCache(); + + await inScope(db, () => getTaxonomyDefs()); + expect(queryCount).toBe(2); + }); + + it("reflects a newly inserted def only after invalidation (in-memory invalidation semantics)", async () => { + const before = await inScope(db, () => getTaxonomyDefs()); + expect(before.map((d) => d.name)).not.toContain("topic"); + + await insertDef(db, "topic"); + + // Still cached — stale read is expected without an explicit bump. + const stale = await inScope(db, () => getTaxonomyDefs()); + expect(stale.map((d) => d.name)).not.toContain("topic"); + + invalidateTaxonomyDefsCache(); + + const fresh = await inScope(db, () => getTaxonomyDefs()); + expect(fresh.map((d) => d.name)).toContain("topic"); + }); + + it("bypasses the isolate cache for isolated databases (playground / DO preview)", async () => { + await inScope(db, () => getTaxonomyDefs(), { dbIsIsolated: true }); + await inScope(db, () => getTaxonomyDefs(), { dbIsIsolated: true }); + // Never cached across requests => one query each. + expect(queryCount).toBe(2); + }); +}); diff --git a/packages/core/tests/utils/test-db.ts b/packages/core/tests/utils/test-db.ts index 0fe7c69806..8fed1ca3f7 100644 --- a/packages/core/tests/utils/test-db.ts +++ b/packages/core/tests/utils/test-db.ts @@ -9,6 +9,22 @@ import { getMigrationStatus, runMigrations } from "../../src/database/migrations import type { MigrationStatus } from "../../src/database/migrations/runner.js"; import type { Database as DatabaseSchema } from "../../src/database/types.js"; import { SchemaRegistry } from "../../src/schema/registry.js"; +import { resetTaxonomyDefsCacheForTests } from "../../src/taxonomies/index.js"; + +/** + * Clear the isolate-wide, schema-derived caches that live on globalThis and + * therefore persist across tests within a vitest worker. A freshly created + * test database must never be served another database's cached taxonomy + * definitions, so we reset every time a new test DB is created. + * + * Note: we deliberately don't import from `../../src/loader.js` here — several + * test files `vi.mock` that module to stub `getDb`, and pulling another export + * through this shared util would blow up under those mocks. The loader's own + * taxonomy-names cache predates this util and is reset via its public path. + */ +function resetSchemaCachesForTests(): void { + resetTaxonomyDefsCacheForTests(); +} // --------------------------------------------------------------------------- // Environment @@ -33,6 +49,7 @@ export const hasPgTestDatabase = PG_CONNECTION_STRING.length > 0; * Create an in-memory SQLite database for testing */ export function createTestDatabase(): Kysely { + resetSchemaCachesForTests(); const sqlite = new Database(":memory:"); return new Kysely({ @@ -246,6 +263,7 @@ export interface PgTestContext { * Call `teardownTestPostgresDatabase()` in afterEach to drop the schema. */ export async function createTestPostgresDatabase(): Promise { + resetSchemaCachesForTests(); const connectionString = await getWorkerConnectionString(); const pool = await getSharedPool(); const schemaName = uniqueSchemaName(); From 38e2a992fc4a789e20a0c15a96727f72d498bf8b Mon Sep 17 00:00:00 2001 From: scottbuscemi Date: Wed, 10 Jun 2026 00:39:55 -0700 Subject: [PATCH 2/5] chore: format changeset --- .changeset/perf-taxonomy-defs-isolate-cache.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/perf-taxonomy-defs-isolate-cache.md b/.changeset/perf-taxonomy-defs-isolate-cache.md index 0d1f69519e..f212d27f22 100644 --- a/.changeset/perf-taxonomy-defs-isolate-cache.md +++ b/.changeset/perf-taxonomy-defs-isolate-cache.md @@ -4,7 +4,7 @@ Cut per-render D1 round trips on public pages by caching taxonomy definitions across the worker isolate, and harden the runtime/DB singletons against bundler module duplication. -Every public render that hydrates entry terms read `SELECT * FROM _emdash_taxonomy_defs` (via `getTaxonomyDefs` → `getCollectionTaxonomyNames`), which only had per-request caching. On Cloudflare D1, where the worker colo is often far from the database primary, each query is a ~40ms cross-region round trip, so this fired on every warm request for no benefit — taxonomy *definitions* change extremely rarely (created via the admin API or a seed; there is no edit/delete-def path). They're now cached per-isolate behind a `globalThis` Symbol holder (the same two-tier pattern as `settings/index.ts` and the byline field-defs cache), keyed by resolved locale and invalidated in-memory by every def write (`handleTaxonomyCreate`, seed application). Invalidation is in-memory rather than a persisted version probe on purpose: a per-request version read would merely replace the query being removed, yielding no net saving on warm isolates. Isolated databases (playground / DO preview) bypass the cache. +Every public render that hydrates entry terms read `SELECT * FROM _emdash_taxonomy_defs` (via `getTaxonomyDefs` → `getCollectionTaxonomyNames`), which only had per-request caching. On Cloudflare D1, where the worker colo is often far from the database primary, each query is a ~40ms cross-region round trip, so this fired on every warm request for no benefit — taxonomy _definitions_ change extremely rarely (created via the admin API or a seed; there is no edit/delete-def path). They're now cached per-isolate behind a `globalThis` Symbol holder (the same two-tier pattern as `settings/index.ts` and the byline field-defs cache), keyed by resolved locale and invalidated in-memory by every def write (`handleTaxonomyCreate`, seed application). Invalidation is in-memory rather than a persisted version probe on purpose: a per-request version read would merely replace the query being removed, yielding no net saving on warm isolates. Isolated databases (playground / DO preview) bypass the cache. Separately, the cached runtime instance, the DB-instance cache, and the in-flight DB-init promise (`astro/middleware.ts`, `emdash-runtime.ts`) were plain module-scoped variables. Under Vite SSR chunk duplication those can become multiple independent copies, letting cold-start migrations and bootstrap reads re-run on requests that should have hit the warm cache. They now live on `globalThis` behind Symbol keys, matching the existing `SETUP_VERIFIED_KEY` / request-context / request-cache singletons. From 91b71439970d523ff299fca6975304503b362971 Mon Sep 17 00:00:00 2001 From: "emdashbot[bot]" Date: Wed, 10 Jun 2026 07:45:56 +0000 Subject: [PATCH 3/5] ci: update query-count snapshots --- scripts/query-counts.snapshot.d1.json | 18 ++++++------ scripts/query-counts.snapshot.sqlite.json | 36 +++++++++++------------ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/scripts/query-counts.snapshot.d1.json b/scripts/query-counts.snapshot.d1.json index 9753041a97..1b7dc8380e 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 / (warm)": 5, "GET /category/development (cold)": 20, - "GET /category/development (warm)": 9, + "GET /category/development (warm)": 8, "GET /contributors (cold)": 15, - "GET /contributors (warm)": 5, + "GET /contributors (warm)": 4, "GET /contributors-naive (cold)": 22, - "GET /contributors-naive (warm)": 12, + "GET /contributors-naive (warm)": 11, "GET /pages/about (cold)": 13, - "GET /pages/about (warm)": 4, + "GET /pages/about (warm)": 3, "GET /posts (cold)": 16, - "GET /posts (warm)": 6, + "GET /posts (warm)": 5, "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)": 15, - "GET /rss.xml (warm)": 5, + "GET /rss.xml (warm)": 4, "GET /search (cold)": 14, "GET /search (warm)": 5, "GET /tag/webdev (cold)": 20, - "GET /tag/webdev (warm)": 9 + "GET /tag/webdev (warm)": 8 } diff --git a/scripts/query-counts.snapshot.sqlite.json b/scripts/query-counts.snapshot.sqlite.json index ef4072d240..e01c5a2791 100644 --- a/scripts/query-counts.snapshot.sqlite.json +++ b/scripts/query-counts.snapshot.sqlite.json @@ -1,22 +1,22 @@ { - "GET / (cold)": 7, - "GET / (warm)": 7, - "GET /category/development (cold)": 11, - "GET /category/development (warm)": 10, - "GET /contributors (cold)": 6, - "GET /contributors (warm)": 6, - "GET /contributors-naive (cold)": 13, - "GET /contributors-naive (warm)": 13, - "GET /pages/about (cold)": 5, - "GET /pages/about (warm)": 5, - "GET /posts (cold)": 7, - "GET /posts (warm)": 7, - "GET /posts/building-for-the-long-term (cold)": 18, - "GET /posts/building-for-the-long-term (warm)": 18, - "GET /rss.xml (cold)": 5, - "GET /rss.xml (warm)": 5, + "GET / (cold)": 6, + "GET / (warm)": 6, + "GET /category/development (cold)": 10, + "GET /category/development (warm)": 9, + "GET /contributors (cold)": 5, + "GET /contributors (warm)": 5, + "GET /contributors-naive (cold)": 12, + "GET /contributors-naive (warm)": 12, + "GET /pages/about (cold)": 4, + "GET /pages/about (warm)": 4, + "GET /posts (cold)": 6, + "GET /posts (warm)": 6, + "GET /posts/building-for-the-long-term (cold)": 17, + "GET /posts/building-for-the-long-term (warm)": 17, + "GET /rss.xml (cold)": 4, + "GET /rss.xml (warm)": 4, "GET /search (cold)": 6, "GET /search (warm)": 6, - "GET /tag/webdev (cold)": 10, - "GET /tag/webdev (warm)": 10 + "GET /tag/webdev (cold)": 9, + "GET /tag/webdev (warm)": 9 } From 42b31835de17c1b18c69032ed4703bfce27bda51 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Mon, 22 Jun 2026 17:49:30 +0100 Subject: [PATCH 4/5] chore: regenerate query-count snapshots with taxonomy-defs cache on fixed harness The pre-merge snapshots were measured with the old query-counts harness that missed queries issued during streaming (fixed in #1580). Regenerated against the fixed harness so the numbers reflect reality: the per-isolate taxonomy-defs cache removes the repeated _emdash_taxonomy_defs read on every public render (-1 query per route). --- scripts/query-counts.queries.d1.json | 10 ------ scripts/query-counts.queries.sqlite.json | 20 ------------ scripts/query-counts.snapshot.d1.json | 20 ++++++------ scripts/query-counts.snapshot.sqlite.json | 40 +++++++++++------------ 4 files changed, 30 insertions(+), 60 deletions(-) diff --git a/scripts/query-counts.queries.d1.json b/scripts/query-counts.queries.d1.json index 8ce03cc03d..0112b94dfb 100644 --- a/scripts/query-counts.queries.d1.json +++ b/scripts/query-counts.queries.d1.json @@ -26,7 +26,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC LIMIT ?": 1 }, @@ -61,7 +60,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.id = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "select * from \"taxonomies\" where \"name\" = ? and \"slug\" = ? order by \"locale\" asc": 1, @@ -95,7 +93,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC": 1 }, @@ -127,7 +124,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "select * from \"media\" where \"id\" = ?": 7 @@ -157,7 +153,6 @@ "select \"content_taxonomies\".\"entry_id\", \"taxonomies\".\"id\", \"taxonomies\".\"name\", \"taxonomies\".\"slug\", \"taxonomies\".\"label\", \"taxonomies\".\"parent_id\", \"taxonomies\".\"locale\", \"taxonomies\".\"translation_group\" from \"content_taxonomies\" inner join \"taxonomies\" on \"taxonomies\".\"translation_group\" = \"content_taxonomies\".\"taxonomy_id\" where \"content_taxonomies\".\"collection\" = ? and \"content_taxonomies\".\"entry_id\" in (...) order by \"taxonomies\".\"label\" asc": 2, "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT c.*, \"s\".\"seo_title\" AS \"_emdash_seo_title\", \"s\".\"seo_description\" AS \"_emdash_seo_description\", \"s\".\"seo_image\" AS \"_emdash_seo_image\", \"s\".\"seo_canonical\" AS \"_emdash_seo_canonical\", \"s\".\"seo_no_index\" AS \"_emdash_seo_no_index\" FROM \"ec_pages\" AS c LEFT JOIN \"_emdash_seo\" AS s ON s.collection = ? AND s.content_id = c.id WHERE c.deleted_at IS NULL AND (c.slug = ? OR c.id = ?) LIMIT 1": 1 }, @@ -188,7 +183,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC": 1 }, @@ -229,7 +223,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC LIMIT ?": 1, @@ -256,7 +249,6 @@ "select \"cb\".\"content_id\" as \"content_id\", \"cb\".\"sort_order\" as \"sort_order\", \"cb\".\"role_label\" as \"role_label\", \"b\".\"id\" as \"id\", \"b\".\"slug\" as \"slug\", \"b\".\"display_name\" as \"display_name\", \"b\".\"bio\" as \"bio\", \"b\".\"avatar_media_id\" as \"avatar_media_id\", \"m\".\"storage_key\" as \"avatar_storage_key\", \"m\".\"alt\" as \"avatar_alt\", \"b\".\"website_url\" as \"website_url\", \"b\".\"user_id\" as \"user_id\", \"b\".\"is_guest\" as \"is_guest\", \"b\".\"created_at\" as \"created_at\", \"b\".\"updated_at\" as \"updated_at\", \"b\".\"locale\" as \"locale\", \"b\".\"translation_group\" as \"translation_group\" from \"_emdash_content_bylines\" as \"cb\" inner 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\" in (...) and \"b\".\"locale\" = ? order by \"cb\".\"sort_order\" asc": 1, "select \"content_taxonomies\".\"entry_id\", \"taxonomies\".\"id\", \"taxonomies\".\"name\", \"taxonomies\".\"slug\", \"taxonomies\".\"label\", \"taxonomies\".\"parent_id\", \"taxonomies\".\"locale\", \"taxonomies\".\"translation_group\" from \"content_taxonomies\" inner join \"taxonomies\" on \"taxonomies\".\"translation_group\" = \"content_taxonomies\".\"taxonomy_id\" where \"content_taxonomies\".\"collection\" = ? and \"content_taxonomies\".\"entry_id\" in (...) order by \"taxonomies\".\"label\" asc": 1, "select \"value\" from \"options\" where \"name\" = ?": 1, - "select * from \"_emdash_taxonomy_defs\"": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC LIMIT ?": 1 }, "GET /search (cold)": { @@ -291,7 +283,6 @@ "select \"slug\" from \"_emdash_fields\" where \"collection_id\" = ? and \"searchable\" = ?": 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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT c.id, c.slug, c.locale, c.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 name FROM sqlite_master WHERE type = 'table' AND name = ?": 1 @@ -327,7 +318,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.id = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "select * from \"taxonomies\" where \"name\" = ? and \"slug\" = ? order by \"locale\" asc": 1, diff --git a/scripts/query-counts.queries.sqlite.json b/scripts/query-counts.queries.sqlite.json index f51ae981af..fca31bd7ad 100644 --- a/scripts/query-counts.queries.sqlite.json +++ b/scripts/query-counts.queries.sqlite.json @@ -6,7 +6,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC LIMIT ?": 1 }, @@ -17,7 +16,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC LIMIT ?": 1 }, @@ -29,7 +27,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.id = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "select * from \"taxonomies\" where \"name\" = ? and \"slug\" = ? order by \"locale\" asc": 1, @@ -43,7 +40,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.id = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "select * from \"taxonomies\" where \"name\" = ? and \"slug\" = ? order by \"locale\" asc": 1, @@ -57,7 +53,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC": 1 }, @@ -68,7 +63,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC": 1 }, @@ -79,7 +73,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "select * from \"media\" where \"id\" = ?": 7 @@ -91,7 +84,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "select * from \"media\" where \"id\" = ?": 7 @@ -102,7 +94,6 @@ "select \"content_taxonomies\".\"entry_id\", \"taxonomies\".\"id\", \"taxonomies\".\"name\", \"taxonomies\".\"slug\", \"taxonomies\".\"label\", \"taxonomies\".\"parent_id\", \"taxonomies\".\"locale\", \"taxonomies\".\"translation_group\" from \"content_taxonomies\" inner join \"taxonomies\" on \"taxonomies\".\"translation_group\" = \"content_taxonomies\".\"taxonomy_id\" where \"content_taxonomies\".\"collection\" = ? and \"content_taxonomies\".\"entry_id\" in (...) order by \"taxonomies\".\"label\" asc": 2, "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT c.*, \"s\".\"seo_title\" AS \"_emdash_seo_title\", \"s\".\"seo_description\" AS \"_emdash_seo_description\", \"s\".\"seo_image\" AS \"_emdash_seo_image\", \"s\".\"seo_canonical\" AS \"_emdash_seo_canonical\", \"s\".\"seo_no_index\" AS \"_emdash_seo_no_index\" FROM \"ec_pages\" AS c LEFT JOIN \"_emdash_seo\" AS s ON s.collection = ? AND s.content_id = c.id WHERE c.deleted_at IS NULL AND (c.slug = ? OR c.id = ?) LIMIT 1": 1 }, @@ -112,7 +103,6 @@ "select \"content_taxonomies\".\"entry_id\", \"taxonomies\".\"id\", \"taxonomies\".\"name\", \"taxonomies\".\"slug\", \"taxonomies\".\"label\", \"taxonomies\".\"parent_id\", \"taxonomies\".\"locale\", \"taxonomies\".\"translation_group\" from \"content_taxonomies\" inner join \"taxonomies\" on \"taxonomies\".\"translation_group\" = \"content_taxonomies\".\"taxonomy_id\" where \"content_taxonomies\".\"collection\" = ? and \"content_taxonomies\".\"entry_id\" in (...) order by \"taxonomies\".\"label\" asc": 2, "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT c.*, \"s\".\"seo_title\" AS \"_emdash_seo_title\", \"s\".\"seo_description\" AS \"_emdash_seo_description\", \"s\".\"seo_image\" AS \"_emdash_seo_image\", \"s\".\"seo_canonical\" AS \"_emdash_seo_canonical\", \"s\".\"seo_no_index\" AS \"_emdash_seo_no_index\" FROM \"ec_pages\" AS c LEFT JOIN \"_emdash_seo\" AS s ON s.collection = ? AND s.content_id = c.id WHERE c.deleted_at IS NULL AND (c.slug = ? OR c.id = ?) LIMIT 1": 1 }, @@ -123,7 +113,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC": 1 }, @@ -134,7 +123,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC": 1 }, @@ -148,7 +136,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC LIMIT ?": 1, @@ -166,7 +153,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC LIMIT ?": 1, @@ -178,14 +164,12 @@ "select \"cb\".\"content_id\" as \"content_id\", \"cb\".\"sort_order\" as \"sort_order\", \"cb\".\"role_label\" as \"role_label\", \"b\".\"id\" as \"id\", \"b\".\"slug\" as \"slug\", \"b\".\"display_name\" as \"display_name\", \"b\".\"bio\" as \"bio\", \"b\".\"avatar_media_id\" as \"avatar_media_id\", \"m\".\"storage_key\" as \"avatar_storage_key\", \"m\".\"alt\" as \"avatar_alt\", \"b\".\"website_url\" as \"website_url\", \"b\".\"user_id\" as \"user_id\", \"b\".\"is_guest\" as \"is_guest\", \"b\".\"created_at\" as \"created_at\", \"b\".\"updated_at\" as \"updated_at\", \"b\".\"locale\" as \"locale\", \"b\".\"translation_group\" as \"translation_group\" from \"_emdash_content_bylines\" as \"cb\" inner 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\" in (...) and \"b\".\"locale\" = ? order by \"cb\".\"sort_order\" asc": 1, "select \"content_taxonomies\".\"entry_id\", \"taxonomies\".\"id\", \"taxonomies\".\"name\", \"taxonomies\".\"slug\", \"taxonomies\".\"label\", \"taxonomies\".\"parent_id\", \"taxonomies\".\"locale\", \"taxonomies\".\"translation_group\" from \"content_taxonomies\" inner join \"taxonomies\" on \"taxonomies\".\"translation_group\" = \"content_taxonomies\".\"taxonomy_id\" where \"content_taxonomies\".\"collection\" = ? and \"content_taxonomies\".\"entry_id\" in (...) order by \"taxonomies\".\"label\" asc": 1, "select \"value\" from \"options\" where \"name\" = ?": 1, - "select * from \"_emdash_taxonomy_defs\"": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC LIMIT ?": 1 }, "GET /rss.xml (warm)": { "select \"cb\".\"content_id\" as \"content_id\", \"cb\".\"sort_order\" as \"sort_order\", \"cb\".\"role_label\" as \"role_label\", \"b\".\"id\" as \"id\", \"b\".\"slug\" as \"slug\", \"b\".\"display_name\" as \"display_name\", \"b\".\"bio\" as \"bio\", \"b\".\"avatar_media_id\" as \"avatar_media_id\", \"m\".\"storage_key\" as \"avatar_storage_key\", \"m\".\"alt\" as \"avatar_alt\", \"b\".\"website_url\" as \"website_url\", \"b\".\"user_id\" as \"user_id\", \"b\".\"is_guest\" as \"is_guest\", \"b\".\"created_at\" as \"created_at\", \"b\".\"updated_at\" as \"updated_at\", \"b\".\"locale\" as \"locale\", \"b\".\"translation_group\" as \"translation_group\" from \"_emdash_content_bylines\" as \"cb\" inner 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\" in (...) and \"b\".\"locale\" = ? order by \"cb\".\"sort_order\" asc": 1, "select \"content_taxonomies\".\"entry_id\", \"taxonomies\".\"id\", \"taxonomies\".\"name\", \"taxonomies\".\"slug\", \"taxonomies\".\"label\", \"taxonomies\".\"parent_id\", \"taxonomies\".\"locale\", \"taxonomies\".\"translation_group\" from \"content_taxonomies\" inner join \"taxonomies\" on \"taxonomies\".\"translation_group\" = \"content_taxonomies\".\"taxonomy_id\" where \"content_taxonomies\".\"collection\" = ? and \"content_taxonomies\".\"entry_id\" in (...) order by \"taxonomies\".\"label\" asc": 1, "select \"value\" from \"options\" where \"name\" = ?": 1, - "select * from \"_emdash_taxonomy_defs\"": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"published_at\" DESC, \"id\" DESC LIMIT ?": 1 }, "GET /search (cold)": { @@ -197,7 +181,6 @@ "select \"slug\" from \"_emdash_fields\" where \"collection_id\" = ? and \"searchable\" = ?": 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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT c.id, c.slug, c.locale, c.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 name FROM sqlite_master WHERE type = 'table' AND name = ?": 1 @@ -211,7 +194,6 @@ "select \"slug\" from \"_emdash_fields\" where \"collection_id\" = ? and \"searchable\" = ?": 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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT c.id, c.slug, c.locale, c.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 name FROM sqlite_master WHERE type = 'table' AND name = ?": 1 @@ -223,7 +205,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.id = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "select * from \"taxonomies\" where \"name\" = ? and \"slug\" = ? order by \"locale\" asc": 1, @@ -237,7 +218,6 @@ "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\"": 1, "SELECT * FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, "SELECT * FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.id = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "select * from \"taxonomies\" where \"name\" = ? and \"slug\" = ? order by \"locale\" asc": 1, diff --git a/scripts/query-counts.snapshot.d1.json b/scripts/query-counts.snapshot.d1.json index 54c209475c..0a688e64d2 100644 --- a/scripts/query-counts.snapshot.d1.json +++ b/scripts/query-counts.snapshot.d1.json @@ -1,22 +1,22 @@ { "GET / (cold)": 22, - "GET / (warm)": 11, + "GET / (warm)": 10, "GET /category/development (cold)": 26, - "GET /category/development (warm)": 14, + "GET /category/development (warm)": 13, "GET /contributors (cold)": 22, - "GET /contributors (warm)": 11, + "GET /contributors (warm)": 10, "GET /contributors-naive (cold)": 29, - "GET /contributors-naive (warm)": 18, + "GET /contributors-naive (warm)": 17, "GET /pages/about (cold)": 20, - "GET /pages/about (warm)": 10, + "GET /pages/about (warm)": 9, "GET /posts (cold)": 22, - "GET /posts (warm)": 11, + "GET /posts (warm)": 10, "GET /posts/building-for-the-long-term (cold)": 35, - "GET /posts/building-for-the-long-term (warm)": 24, + "GET /posts/building-for-the-long-term (warm)": 23, "GET /rss.xml (cold)": 15, - "GET /rss.xml (warm)": 5, + "GET /rss.xml (warm)": 4, "GET /search (cold)": 22, - "GET /search (warm)": 12, + "GET /search (warm)": 11, "GET /tag/webdev (cold)": 26, - "GET /tag/webdev (warm)": 14 + "GET /tag/webdev (warm)": 13 } diff --git a/scripts/query-counts.snapshot.sqlite.json b/scripts/query-counts.snapshot.sqlite.json index ca15235c46..3f584307ac 100644 --- a/scripts/query-counts.snapshot.sqlite.json +++ b/scripts/query-counts.snapshot.sqlite.json @@ -1,22 +1,22 @@ { - "GET / (cold)": 11, - "GET / (warm)": 11, - "GET /category/development (cold)": 15, - "GET /category/development (warm)": 14, - "GET /contributors (cold)": 11, - "GET /contributors (warm)": 11, - "GET /contributors-naive (cold)": 18, - "GET /contributors-naive (warm)": 18, - "GET /pages/about (cold)": 10, - "GET /pages/about (warm)": 10, - "GET /posts (cold)": 11, - "GET /posts (warm)": 11, - "GET /posts/building-for-the-long-term (cold)": 24, - "GET /posts/building-for-the-long-term (warm)": 24, - "GET /rss.xml (cold)": 5, - "GET /rss.xml (warm)": 5, - "GET /search (cold)": 12, - "GET /search (warm)": 12, - "GET /tag/webdev (cold)": 14, - "GET /tag/webdev (warm)": 14 + "GET / (cold)": 10, + "GET / (warm)": 10, + "GET /category/development (cold)": 14, + "GET /category/development (warm)": 13, + "GET /contributors (cold)": 10, + "GET /contributors (warm)": 10, + "GET /contributors-naive (cold)": 17, + "GET /contributors-naive (warm)": 17, + "GET /pages/about (cold)": 9, + "GET /pages/about (warm)": 9, + "GET /posts (cold)": 10, + "GET /posts (warm)": 10, + "GET /posts/building-for-the-long-term (cold)": 23, + "GET /posts/building-for-the-long-term (warm)": 23, + "GET /rss.xml (cold)": 4, + "GET /rss.xml (warm)": 4, + "GET /search (cold)": 11, + "GET /search (warm)": 11, + "GET /tag/webdev (cold)": 13, + "GET /tag/webdev (warm)": 13 } From 9b1ba4224286cc620073fef80f2afdc2299db6cb Mon Sep 17 00:00:00 2001 From: "emdashbot[bot]" Date: Wed, 1 Jul 2026 15:03:00 +0000 Subject: [PATCH 5/5] ci: update query-count snapshots --- scripts/query-counts.queries.d1.json | 8 ++++---- scripts/query-counts.queries.sqlite.json | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/query-counts.queries.d1.json b/scripts/query-counts.queries.d1.json index e0fd40c6fd..51a7c53d38 100644 --- a/scripts/query-counts.queries.d1.json +++ b/scripts/query-counts.queries.d1.json @@ -39,7 +39,7 @@ "select * from \"taxonomies\" where \"name\" = ? and \"slug\" = ? order by \"locale\" asc": 1, "select * from \"taxonomies\" where \"parent_id\" = ? and \"locale\" = ? order by \"label\" asc": 1, "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".id AND t.locale = \"ec_pages\".locale) 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 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\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, - "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.locale = \"ec_posts\".locale) 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 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\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.id = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, + "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.locale = \"ec_posts\".locale) 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 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\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "select count(\"entry_id\") as \"count\" from \"content_taxonomies\" where \"taxonomy_id\" = ?": 1, "select count(*) as \"count\" from \"_emdash_collections\"": 1, "SELECT COUNT(*) as count FROM \"_emdash_migrations\"": 1, @@ -53,7 +53,7 @@ "select * from \"taxonomies\" where \"name\" = ? and \"slug\" = ? order by \"locale\" asc": 1, "select * from \"taxonomies\" where \"parent_id\" = ? and \"locale\" = ? order by \"label\" asc": 1, "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".id AND t.locale = \"ec_pages\".locale) 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 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\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, - "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.locale = \"ec_posts\".locale) 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 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\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.id = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, + "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.locale = \"ec_posts\".locale) 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 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\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "select count(\"entry_id\") as \"count\" from \"content_taxonomies\" where \"taxonomy_id\" = ?": 1 }, "GET /contributors (cold)": { @@ -263,7 +263,7 @@ "select * from \"taxonomies\" where \"name\" = ? and \"slug\" = ? order by \"locale\" asc": 1, "select * from \"taxonomies\" where \"parent_id\" = ? and \"locale\" = ? order by \"label\" asc": 1, "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".id AND t.locale = \"ec_pages\".locale) 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 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\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, - "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.locale = \"ec_posts\".locale) 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 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\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.id = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, + "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.locale = \"ec_posts\".locale) 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 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\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "select count(\"entry_id\") as \"count\" from \"content_taxonomies\" where \"taxonomy_id\" = ?": 1, "select count(*) as \"count\" from \"_emdash_collections\"": 1, "SELECT COUNT(*) as count FROM \"_emdash_migrations\"": 1, @@ -277,7 +277,7 @@ "select * from \"taxonomies\" where \"name\" = ? and \"slug\" = ? order by \"locale\" asc": 1, "select * from \"taxonomies\" where \"parent_id\" = ? and \"locale\" = ? order by \"label\" asc": 1, "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".id AND t.locale = \"ec_pages\".locale) 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 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\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, - "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.locale = \"ec_posts\".locale) 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 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\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.id = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, + "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.locale = \"ec_posts\".locale) 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 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\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "select count(\"entry_id\") as \"count\" from \"content_taxonomies\" where \"taxonomy_id\" = ?": 1 } } diff --git a/scripts/query-counts.queries.sqlite.json b/scripts/query-counts.queries.sqlite.json index 875a298a10..85601ab7b6 100644 --- a/scripts/query-counts.queries.sqlite.json +++ b/scripts/query-counts.queries.sqlite.json @@ -24,7 +24,7 @@ "select * from \"taxonomies\" where \"name\" = ? and \"slug\" = ? order by \"locale\" asc": 1, "select * from \"taxonomies\" where \"parent_id\" = ? and \"locale\" = ? order by \"label\" asc": 1, "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".id AND t.locale = \"ec_pages\".locale) 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 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\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, - "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.locale = \"ec_posts\".locale) 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 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\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.id = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, + "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.locale = \"ec_posts\".locale) 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 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\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "select count(\"entry_id\") as \"count\" from \"content_taxonomies\" where \"taxonomy_id\" = ?": 1 }, "GET /category/development (warm)": { @@ -35,7 +35,7 @@ "select * from \"taxonomies\" where \"name\" = ? and \"slug\" = ? order by \"locale\" asc": 1, "select * from \"taxonomies\" where \"parent_id\" = ? and \"locale\" = ? order by \"label\" asc": 1, "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".id AND t.locale = \"ec_pages\".locale) 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 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\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, - "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.locale = \"ec_posts\".locale) 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 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\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.id = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, + "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.locale = \"ec_posts\".locale) 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 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\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "select count(\"entry_id\") as \"count\" from \"content_taxonomies\" where \"taxonomy_id\" = ?": 1 }, "GET /contributors (cold)": { @@ -176,7 +176,7 @@ "select * from \"taxonomies\" where \"name\" = ? and \"slug\" = ? order by \"locale\" asc": 1, "select * from \"taxonomies\" where \"parent_id\" = ? and \"locale\" = ? order by \"label\" asc": 1, "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".id AND t.locale = \"ec_pages\".locale) 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 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\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, - "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.locale = \"ec_posts\".locale) 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 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\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.id = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, + "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.locale = \"ec_posts\".locale) 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 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\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "select count(\"entry_id\") as \"count\" from \"content_taxonomies\" where \"taxonomy_id\" = ?": 1 }, "GET /tag/webdev (warm)": { @@ -187,7 +187,7 @@ "select * from \"taxonomies\" where \"name\" = ? and \"slug\" = ? order by \"locale\" asc": 1, "select * from \"taxonomies\" where \"parent_id\" = ? and \"locale\" = ? order by \"label\" asc": 1, "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_pages\".id AND t.locale = \"ec_pages\".locale) 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 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\" FROM \"ec_pages\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) ORDER BY \"created_at\" DESC, \"id\" DESC": 1, - "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.locale = \"ec_posts\".locale) 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 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\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.id = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, + "SELECT *, (SELECT json_group_array(json_object('id', t.id, 'name', t.name, 'slug', t.slug, 'label', t.label, 'parent_id', t.parent_id, 'locale', t.locale, 'translation_group', t.translation_group)) FROM \"content_taxonomies\" AS ct JOIN \"taxonomies\" AS t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.locale = \"ec_posts\".locale) 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 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\" FROM \"ec_posts\" WHERE deleted_at IS NULL AND (\"status\" = 'published' OR (\"status\" = 'scheduled' AND \"scheduled_at\" <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))) AND EXISTS ( SELECT 1 FROM content_taxonomies ct INNER JOIN taxonomies t ON t.translation_group = ct.taxonomy_id WHERE ct.collection = ? AND ct.entry_id = \"ec_posts\".id AND t.name = ? AND t.slug in (...) ) ORDER BY \"published_at\" DESC, \"id\" DESC": 1, "select count(\"entry_id\") as \"count\" from \"content_taxonomies\" where \"taxonomy_id\" = ?": 1 } }