bluesky-social / indigo

Go source code for Bluesky's atproto services.
https://atproto.com
Apache License 2.0
660 stars 99 forks source link

backfill: broken for postgresql #655

Closed mrd0ll4r closed 3 months ago

mrd0ll4r commented 5 months ago

This recent change (https://github.com/bluesky-social/indigo/pull/652/files#diff-059222fb30fa15aa5784cebb59bcf6107a83f88e0d10a8277d85bfbb89c21300R79) broke the backfiller if running on a Postgres db:

SELECT repo FROM gorm_db_jobs INDEXED BY enqueued_job_idx WHERE state  = 'enqueued' LIMIT 20000
panic: loading backfill jobs: ERROR: syntax error at or near "BY" (SQLSTATE 42601)

I guess postgres doesn't have index hinting.

ericvolp12 commented 5 months ago

Yeah that's my bad, gonna ship a fix in a little bit that should distinguish between SQLite and non-SQLite

GORM has generic index hinting stuff but it doesn't actually work with SQLite lmao