diff --git a/apps/ingest/package.json b/apps/ingest/package.json index 152f925..cf5bb98 100644 --- a/apps/ingest/package.json +++ b/apps/ingest/package.json @@ -17,7 +17,6 @@ "devDependencies": { "@cloudflare/workers-types": "5.20260921.1", "@types/node": "^22", - "drizzle-orm": "^0.45.3", "typescript": "^5.9.0", "vitest": "^5.0.3", "wrangler": "^4.147.0" diff --git a/apps/ingest/test/pipeline.test.ts b/apps/ingest/test/pipeline.test.ts index a8c40be..f4aa137 100644 --- a/apps/ingest/test/pipeline.test.ts +++ b/apps/ingest/test/pipeline.test.ts @@ -9,7 +9,6 @@ import { } from '@copper/core' import { PgStore, schema } from '@copper/db' import { createTestDb } from '@copper/db/testing' -import { eq } from 'drizzle-orm' import { describe, expect, it } from 'vitest' import { createApp } from '../src/app' import { MemoryShardStorage, ShardCore } from '../src/shard-core' @@ -103,10 +102,9 @@ describe('one hour of traffic, end to end', () => { for (const site of SITES) { const want = expected.get(site.siteKey) as ReturnType - const [project] = await db - .select() - .from(schema.project) - .where(eq(schema.project.siteKey, site.siteKey)) + const [project] = (await db.select().from(schema.project)).filter( + (p) => p.siteKey === site.siteKey, + ) const id = (project as { id: number }).id const counters = { pageviews: want.pageviews, @@ -115,17 +113,16 @@ describe('one hour of traffic, end to end', () => { bounces: want.bounces, } expect( - await db.select().from(schema.statsHourly).where(eq(schema.statsHourly.projectId, id)), + (await db.select().from(schema.statsHourly)).filter((r) => r.projectId === id), ).toEqual([{ projectId: id, hour: new Date(T0), ...counters }]) // 03:00 UTC on Oct 5 is still Oct 4 in Los Angeles. const day = site.timezone === 'UTC' ? '2026-10-05' : '2026-10-04' - expect( - await db.select().from(schema.statsDaily).where(eq(schema.statsDaily.projectId, id)), - ).toEqual([{ projectId: id, day, ...counters }]) - const [breakdown] = await db - .select() - .from(schema.breakdownDaily) - .where(eq(schema.breakdownDaily.projectId, id)) + expect((await db.select().from(schema.statsDaily)).filter((r) => r.projectId === id)).toEqual( + [{ projectId: id, day, ...counters }], + ) + const [breakdown] = (await db.select().from(schema.breakdownDaily)).filter( + (r) => r.projectId === id, + ) expect(breakdown?.day).toBe(day) const pages = breakdown?.data.page ?? {} expect(Object.fromEntries(Object.entries(pages).map(([p, [pv]]) => [p, pv]))).toEqual( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index efd32c9..1a933e0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -197,9 +197,6 @@ importers: '@types/node': specifier: ^22 version: 22.20.5 - drizzle-orm: - specifier: ^0.45.3 - version: 0.45.3(@cloudflare/workers-types@5.20260921.1)(@electric-sql/pglite@0.5.8)(@neondatabase/serverless@1.2.0)(@types/pg@8.23.1)(kysely@0.29.6)(pg@8.23.1) typescript: specifier: ^5.9.0 version: 5.9.3