diff --git a/src/storages/events-db.ts b/src/storages/events-db.ts index 75e45b4..8809648 100644 --- a/src/storages/events-db.ts +++ b/src/storages/events-db.ts @@ -200,9 +200,8 @@ class EventsDB implements NStore { ) as { key: 'domain'; value: string } | undefined)?.value; if (domain) { - query = query - .innerJoin('pubkey_domains', 'pubkey_domains.pubkey', 'events.pubkey') - .where('pubkey_domains.domain', '=', domain); + query = query.where('events.pubkey', 'in', (eb) => + eb.selectFrom('pubkey_domains').select('pubkey').where('domain', '=', domain)); } const q = tokens.filter((t) =>