diff options
author | 2021-09-10 14:36:10 +0200 | |
---|---|---|
committer | 2021-09-10 14:36:10 +0200 | |
commit | e681aac5899b4a93d7c71e9a334a67c3f2b00e93 (patch) | |
tree | 748a916a058dff03e42e5aebbfa7f98f8f6288ad /internal/db/basic.go | |
parent | remove boosted statuses from public (federated timeline) (#201) (diff) | |
download | gotosocial-e681aac5899b4a93d7c71e9a334a67c3f2b00e93.tar.xz |
fixes + db changes (#204)
* fixes + db changes
* make duration more lenient
Diffstat (limited to 'internal/db/basic.go')
-rw-r--r-- | internal/db/basic.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/db/basic.go b/internal/db/basic.go index 2a1141c8d..d94c98e45 100644 --- a/internal/db/basic.go +++ b/internal/db/basic.go @@ -62,12 +62,13 @@ type Basic interface { // The given interface i will be set to the result of the query, whatever it is. Use a pointer or a slice. Put(ctx context.Context, i interface{}) Error - // UpdateByID updates i with id id. + // UpdateByPrimaryKey updates all values of i based on its primary key. // The given interface i will be set to the result of the query, whatever it is. Use a pointer or a slice. - UpdateByID(ctx context.Context, id string, i interface{}) Error + UpdateByPrimaryKey(ctx context.Context, i interface{}) Error - // UpdateOneByID updates interface i with database the given database id. It will update one field of key key and value value. - UpdateOneByID(ctx context.Context, id string, key string, value interface{}, i interface{}) Error + // UpdateOneByPrimaryKey sets one column of interface, with the given key, to the given value. + // It uses the primary key of interface i to decide which row to update. This is usually the `id`. + UpdateOneByPrimaryKey(ctx context.Context, key string, value interface{}, i interface{}) Error // UpdateWhere updates column key of interface i with the given value, where the given parameters apply. UpdateWhere(ctx context.Context, where []Where, key string, value interface{}, i interface{}) Error |