Skip to content

Update user_collection meta information on transformative updates #790

Open
@jrconlin

Description

@jrconlin

Blocks on #789

After an operation that potentially modifies the stored bso data, the meta data information should be updated after the status is returned to the client.

An example SQL function may be:

UPDATE user_collections SET count=(
  SELECT COUNT(*) FROM BSOS WHERE 
  FXA_UID="000148c5a52fda4e413625bd0287b6aec7f509f48717bc8de9f8df58308accfc" and 
  FXA_KID="31008d7c3f916aaf744dbe4121dc5d0e" 
  and collection_id=7
), total_bytes = (
  SELECT sum(byte_length(payload)) from BSOS WHERE
  FXA_UID="000148c5a52fda4e413625bd0287b6aec7f509f48717bc8de9f8df58308accfc" and 
  FXA_KID="31008d7c3f916aaf744dbe4121dc5d0e" 
  and collection_id=7 
)
where 
  FXA_UID="000148c5a52fda4e413625bd0287b6aec7f509f48717bc8de9f8df58308accfc" and 
  FXA_KID="31008d7c3f916aaf744dbe4121dc5d0e" 
  and collection_id=7

(Example is illustrative. Some optimization may be required.)

Metadata

Metadata

Assignees

Labels

5Estimate - l - Moderately complex, will require some effort but clearly defined.cleanup

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions