forked from bluesky-social/atproto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Materialize post and profile aggregations on write (bluesky-social#858)
* Add migration for post & profile aggs to pds * Post/profile agg db tweaks * Post/profile aggregation queries on pds * Add facility for performing work on db commit in pds * Add background queue to pds * Perform aggregations during indexing on background queue * Tidy pds background queue, incorporate into labeler * Fix pds onCommit, remove unused indexing dep, fix zeros for aggs * Finish background tasks for view tests in pds * Update aggregations on account deletion, tidy
- Loading branch information
Showing
34 changed files
with
610 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Generated } from 'kysely' | ||
|
||
export const tableName = 'post_agg' | ||
|
||
export interface PostAgg { | ||
uri: string | ||
likeCount: Generated<number> | ||
replyCount: Generated<number> | ||
repostCount: Generated<number> | ||
} | ||
|
||
export type PartialDB = { | ||
[tableName]: PostAgg | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Generated } from 'kysely' | ||
|
||
export const tableName = 'profile_agg' | ||
|
||
export interface ProfileAgg { | ||
did: string | ||
followersCount: Generated<number> | ||
followsCount: Generated<number> | ||
postsCount: Generated<number> | ||
} | ||
|
||
export type PartialDB = { | ||
[tableName]: ProfileAgg | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.