Problem
TypeScript exposes ticker() / forceTick() public methods but discards useful SQL return values, and comments/docs are misleading.
SQL returns:
pgque.ticker(queue) → tick id or NULL if no tick was created.
pgque.ticker() → number of queues processed.
pgque.force_tick(queue) → last tick id / status value from SQL.
Current TS methods return Promise<void>. The comment above ticker() says it returns the underlying tick result count, but the method discards the row.
Why this matters
These are supposed to be thin wrappers over SQL primitives. Hiding return values makes tests and manual operation less informative, and the comment is currently wrong.
Suggested fix
- Make
ticker(queue) return bigint | null and ticker() return count, or split into ticker(queue) and tickerAll() to avoid union confusion.
- Make
forceTick(queue) return the SQL result.
- Update README/API table.
- Keep any combined force+ticker behavior test-helper-only, not public API.
Acceptance criteria
- TS method signatures match SQL primitive return values or docs explicitly justify discarding them.
- Tests assert return values for tick-created and no-tick-needed cases.
Problem
TypeScript exposes
ticker()/forceTick()public methods but discards useful SQL return values, and comments/docs are misleading.SQL returns:
pgque.ticker(queue)→ tick id or NULL if no tick was created.pgque.ticker()→ number of queues processed.pgque.force_tick(queue)→ last tick id / status value from SQL.Current TS methods return
Promise<void>. The comment aboveticker()says it returns the underlying tick result count, but the method discards the row.Why this matters
These are supposed to be thin wrappers over SQL primitives. Hiding return values makes tests and manual operation less informative, and the comment is currently wrong.
Suggested fix
ticker(queue)returnbigint | nullandticker()return count, or split intoticker(queue)andtickerAll()to avoid union confusion.forceTick(queue)return the SQL result.Acceptance criteria