diff --git a/src/db/DittoTables.ts b/src/db/DittoTables.ts index b6fa93f4..46eeeab9 100644 --- a/src/db/DittoTables.ts +++ b/src/db/DittoTables.ts @@ -1,5 +1,3 @@ -import { Nullable } from 'kysely'; - import { NPostgresSchema } from '@nostrify/db'; export interface DittoTables extends NPostgresSchema { @@ -12,7 +10,7 @@ export interface DittoTables extends NPostgresSchema { } type NostrEventsRow = NPostgresSchema['nostr_events'] & { - language: Nullable; + language: string | null; }; interface AuthorStatsRow { diff --git a/src/storages/EventsDB.ts b/src/storages/EventsDB.ts index 957e996c..905883b7 100644 --- a/src/storages/EventsDB.ts +++ b/src/storages/EventsDB.ts @@ -146,16 +146,14 @@ class EventsDB extends NPostgres { } } - // @ts-ignore The type is correct, but NPostgres doesn't realize it. I don't think it's solvable without modifying NPostgres again, which I don't think is worth it for this. protected override getFilterQuery(trx: Kysely, filter: NostrFilter) { if (filter.search) { const tokens = NIP50.parseInput(filter.search); - // @ts-ignore The type is correct, but NPostgres doesn't realize it. I don't think it's solvable without modifying NPostgres again, which I don't think is worth it for this. let query = super.getFilterQuery(trx, { ...filter, search: tokens.filter((t) => typeof t === 'string').join(' '), - }) as SelectQueryBuilder>; + }) as SelectQueryBuilder; const languages = new Set(); @@ -204,7 +202,7 @@ class EventsDB extends NPostgres { } /** Parse an event row from the database. */ - protected override parseEventRow(row: Pick): DittoEvent { + protected override parseEventRow(row: DittoTables['nostr_events']): DittoEvent { return { id: row.id, kind: row.kind,