Exemple #1
0
        public IAsyncEnumerable <SiteUpdateView> GetUniqueSiteUpdates(SiteUpdateQueryOpts opts)
        {
            var q = new SqlKata.Query("site_updates_unique")
                    .Select("hash", "path", "timestamp", "size")
                    .ApplySorting(opts, "timestamp", "hash")
                    .ApplyBounds(opts, "timestamp");

            return(_db.QueryKataAsync <SiteUpdateView>(q));
        }
Exemple #2
0
        public IAsyncEnumerable <EntityUpdateView> ExportAllUpdatesRaw(UpdateType type, EntityVersionQuery opts)
        {
            var q = new SqlKata.Query("updates")
                    .ApplyBounds(opts, "timestamp")
                    .ApplySorting(opts, "timestamp", "update_id")
                    .Join("objects", "objects.hash", "updates.hash")
                    .Where("type", type);

            if (opts.Ids != null)
            {
                q.WhereIn("entity_id", opts.Ids);
            }

            return(_db.QueryKataAsync <EntityUpdateView>(q));
        }