foxhole/app/hysql.hy
SouthFox 4b4b0a0f80
All checks were successful
/ run-pytest (push) Successful in 1m8s
[fix] miss orderby created_at
2024-03-17 17:10:58 +08:00

24 lines
717 B
Hy

#!/usr/bin/env hy
(import app [models])
(import app.database [async_session])
(import sqlalchemy [select])
(import app.activitypub [VisibilityEnum])
(import pprint [pprint])
(defn/a selete_object
[db ap_type]
(.all (await (.scalars db
(.where (select models.InboxObject)
(= models.InboxObject.ap_type ap_type))))))
(defn/a get_index_status
[db]
(.all (await
(.scalars db
(.order_by
(.where (select models.OutboxObject)
(.in_ models.OutboxObject.visibility [VisibilityEnum.PUBLIC VisibilityEnum.UNLISTED])
(.is_ models.OutboxObject.is_deleted False))
(.desc models.OutboxObject.created_at))))))