diff --git a/packages/event-repository-sqlite/__test__/event-repository-sqlite.spec.ts b/packages/event-repository-sqlite/__test__/event-repository-sqlite.spec.ts index 1d6af23b..94db67cf 100644 --- a/packages/event-repository-sqlite/__test__/event-repository-sqlite.spec.ts +++ b/packages/event-repository-sqlite/__test__/event-repository-sqlite.spec.ts @@ -307,10 +307,16 @@ describe('EventRepositorySqlite', () => { describe('filter by generic tags', () => { it('should filter by tags', async () => { - const result = await eventRepository.find({ + const result1 = await eventRepository.find({ '#t': ['test'], }); - expect(result).toEqual([LONG_FORM_CONTENT_EVENT, TEXT_NOTE_EVENT]); + expect(result1).toEqual([LONG_FORM_CONTENT_EVENT, TEXT_NOTE_EVENT]); + + const result2 = await eventRepository.find({ + '#t': ['test'], + limit: 1, + }); + expect(result2).toEqual([LONG_FORM_CONTENT_EVENT]); }); it('should filter by multiple tags', async () => { diff --git a/packages/event-repository-sqlite/src/event-repository-sqlite.ts b/packages/event-repository-sqlite/src/event-repository-sqlite.ts index 4ff112dc..cb49e0cd 100644 --- a/packages/event-repository-sqlite/src/event-repository-sqlite.ts +++ b/packages/event-repository-sqlite/src/event-repository-sqlite.ts @@ -208,6 +208,7 @@ export class EventRepositorySqlite extends EventRepository { 'e.sig', 'e.created_at', ]) + .limit(limit) .execute(); return rows.map(this.toEvent); }