foxhole/app/hysql.hy
SouthFox e82c1ab94e
All checks were successful
/ run-pytest (push) Successful in 47s
[fix] compatible with hy 1.0.0
2024-09-30 00:46:49 +08:00

24 lines
727 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 :async selete_object
[db ap_type]
(.all (await (.scalars db
(.where (select models.InboxObject)
(= models.InboxObject.ap_type ap_type))))))
(defn :async 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))))))