gotosocial/internal/gtsmodel
kim 84279f6a6a
[performance] cache more database calls, reduce required database calls overall (#3290)
* improvements to caching for lists and relationship to accounts / follows

* fix nil panic in AddToList()

* ensure list related caches are correctly invalidated

* ensure returned ID lists are ordered correctly

* bump go-structr to v0.8.9 (returns early if zero uncached keys to be loaded)

* remove zero checks in uncached key load functions (go-structr now handles this)

* fix issues after rebase on upstream/main

* update the expected return order of CSV exports (since list entries are now down by entry creation date)

* rename some funcs, allow deleting list entries for multiple follow IDs at a time, fix up more tests

* use returning statements on delete to get cache invalidation info

* fixes to recent database delete changes

* fix broken list entries delete sql

* remove unused db function

* update remainder of delete functions to behave in similar way, some other small tweaks

* fix delete user sql, allow returning on err no entries

* uncomment + fix list database tests

* update remaining list tests

* update envparsing test

* add comments to each specific key being invalidated

* add more cache invalidation explanatory comments

* whoops; actually delete poll votes from database in the DeletePollByID() func

* remove added but-commented-out field

* improved comment regarding paging being disabled

* make cache invalidation comments match what's actually happening

* fix up delete query comments to match what is happening

* rename function to read a bit better

* don't use ErrNoEntries on delete when not needed (it's only needed for a RETURNING call)

* update function name in test

* move list exclusivity check to AFTER eligibility check. use log.Panic() instead of panic()

* use the poll_id column in poll_votes for selecting votes in poll ID

* fix function name
2024-09-16 16:46:09 +00:00
..
account.go [feature/performance] Store account stats in separate table (#2831) 2024-04-16 13:10:13 +02:00
accountnote.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
accountsettings.go [feature/frontend] Add options to include Unlisted posts or hide all posts (#3272) 2024-09-09 18:07:25 +02:00
accountstats.go [feature/performance] Store account stats in separate table (#2831) 2024-04-16 13:10:13 +02:00
adminaction.go [feature] Implement explicit domain allows + allowlist federation mode (#2200) 2023-09-21 12:12:04 +02:00
advancedmigration.go [feature] Conversations API (#3013) 2024-07-23 20:44:31 +01:00
application.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
block.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
client.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
conversation.go [chore] add some more slice related utility functions + remove duplicated functions (#3149) 2024-07-30 11:29:32 +02:00
domainallow.go [feature] Implement explicit domain allows + allowlist federation mode (#2200) 2023-09-21 12:12:04 +02:00
domainblock.go [feature] Implement explicit domain allows + allowlist federation mode (#2200) 2023-09-21 12:12:04 +02:00
domainpermission.go [feature] Implement explicit domain allows + allowlist federation mode (#2200) 2023-09-21 12:12:04 +02:00
emaildomainblock.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
emoji.go [chore] Allow gtsmodel to depend on util (#3068) 2024-07-03 15:53:54 -07:00
emojicategory.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
filter.go [bugfix] Use better plaintext representation of status for filtering (#3301) 2024-09-16 14:00:23 +02:00
follow.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
followrequest.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
headerfilter.go [bugfix] Replace named unique constraint on header filter header with generic unique directive (#2525) 2024-01-15 15:39:10 +00:00
instance.go [feature] Parse instance descriptors as markdown, show T&C on /about (#2481) 2024-01-05 13:39:31 +01:00
interaction.go [feature] Interaction requests client api + settings panel (#3215) 2024-08-24 11:49:37 +02:00
interactionpolicy.go [chore] Add interaction filter to complement existing visibility filter (#3111) 2024-07-24 12:27:42 +01:00
list.go [performance] cache more database calls, reduce required database calls overall (#3290) 2024-09-16 16:46:09 +00:00
marker.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
mediaattachment.go [feature] Use gifv type for short soundless mp4 videos (#3182) 2024-08-08 08:12:16 +00:00
mention.go [chore] status dereferencing improvements (#3255) 2024-09-10 12:33:32 +00:00
move.go [feature/chore] Add Move database functions + cache (#2647) 2024-03-06 11:18:57 +01:00
notification.go [chore] Add interaction policy gtsmodels (#3075) 2024-07-11 15:44:29 +01:00
poll.go [bugfix] support endless polls, and misskey's' method of inferring expiry in closed polls (#2349) 2023-11-11 10:15:04 +00:00
README.md Prune unnecessary nullzeros, fixup db tags (#200) 2021-09-10 10:08:21 +02:00
report.go [feature] Instance rules (#2125) 2023-08-19 14:33:15 +02:00
routersession.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
rule.go [feature] Instance rules (#2125) 2023-08-19 14:33:15 +02:00
sinbinstatus.go [feature] Process Reject of interaction via fedi API, put rejected statuses in the "sin bin" 😈 (#3271) 2024-09-10 12:34:49 +00:00
status.go [chore] status dereferencing improvements (#3255) 2024-09-10 12:33:32 +00:00
statusbookmark.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
statusfave.go [feature] Federate interaction policies + Accepts; enforce policies (#3138) 2024-07-26 12:04:28 +02:00
statusmute.go [feature] Status thread mute/unmute functionality (#2278) 2023-10-25 15:04:53 +01:00
tag.go [feature] Implement following hashtags (#3141) 2024-07-29 19:26:31 +01:00
thread.go [feature] Status thread mute/unmute functionality (#2278) 2023-10-25 15:04:53 +01:00
threadmute.go [feature] Status thread mute/unmute functionality (#2278) 2023-10-25 15:04:53 +01:00
token.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
tombstone.go [chore] Remove go-playground/validator (#2069) 2023-08-06 12:22:40 +02:00
user.go [feature] New user sign-up via web page (#2796) 2024-04-11 11:45:53 +02:00
usermute.go [feature] User muting (#2960) 2024-06-06 16:38:02 +00:00
workertask.go [feature] persist worker queues to db (#3042) 2024-07-30 13:58:31 +02:00

A note on when we should set data structures linked to objects in the database to use the bun nullzero tag -- this should only be done if the member type is a pointer, or if the this primitive type is literally invalid with an empty value (e.g. media IDs which when empty signifies a null database value, compared to say an account note which when empty could mean either an empty note OR null database value).

Obviously it is a little more complex than this in practice, but keep it in mind!