Commit graph

9 commits

Author SHA1 Message Date
alexfca 60e11f88b8
- Remove PerformQueryAllPartitions as it does not support aggreates (#24)
- Update queries to all use PartitionKeys
- Remove the _sid from queries as the PK contains the Tenant
- Fix some bugs around empty values and ordering

Co-authored-by: alexf@example.com <alexf@example.com>
2021-10-08 11:17:22 +11:00
alexfca 49f8c7fe38
- Add $$NULL$$ string to be used when a part of the DocId is known to be NULL (#23)
- Use the $$NULL$$ for the known nullable use cases

Co-authored-by: alexf@example.com <alexf@example.com>
2021-10-06 10:07:40 +11:00
alexfca db34c0950e
- Make the CosmosDocId use commas as separators instead of underscore to match Messaging (#22)
- Make the DocId for StateBlock to be bas64 and not hex

Co-authored-by: alexf@example.com <alexf@example.com>
2021-10-01 10:02:23 +10:00
alexfca 3088238419
Add UniqueId to PartitionKey for some Dendrite tables (where possible) (#19)
* - Make all PartitionKeys include the tablename
- Update specific PKs to be item specific
- Add validation to the PerformQueryXX methods
- Fix queries that fail validation

* - Revert the PK back to CollectionName as it already includes the TableName

Co-authored-by: alexf@example.com <alexf@example.com>
2021-09-23 14:48:32 +10:00
alexfca 927238a686
Use a common way to generate CollectionName and PartitionKey (#18)
* - Create CosmosDocument as a base class
- Add CT and UT
- Refactor all tables to use the CosmosDocument

* - Add UpsertDocument method to perform updates in a generic way
- Add SetUpdateTime() to update the UT for updates
- Refactor it all

* - Add Performquery method
- Refactor appservice_events_table

* - Update naffka Topics and Messages to use the common pattern

* - Update keyserver to use the common pattern for collection and PK

* - Update mediaapi to use the common pattern for collection and pk

* - Update roomserver to use the common pattern for collectionname and pk

* - Update signingkeyserver to use the common pattern for collectionname and pk

* - Update userapi touse the common pattern for collectionname and pk

* - Update partitionOffset to use the common collectionname and pk
- Remove generic GetPartitionKey() method

Co-authored-by: alexf@example.com <alexf@example.com>
2021-09-23 09:02:37 +10:00
alexfca acf63daf79
Add CT and UT to all documents and refactor (#17)
* - Create CosmosDocument as a base class
- Add CT and UT
- Refactor all tables to use the CosmosDocument

* - Add UpsertDocument method to perform updates in a generic way
- Add SetUpdateTime() to update the UT for updates
- Refactor it all

Co-authored-by: alexf@example.com <alexf@example.com>
2021-09-20 17:41:04 +10:00
jahmai-ca 199c4c3cd1
Add tenant-id to all docs and cross-tenant queries (#14)
* Add tenant-id to all docs and cross-tenant queries

* Use TenantName in doc ids too

* Space

* - Rename variables and ensure code compiles

* - Fix error handling for GroupBy query

* - Fix typo

Co-authored-by: Alex Flatow <alexf@criticalarc.com>
2021-07-27 14:10:35 +10:00
alexfca 3ca96b13b3
- Implement the SycAPI to use CosmosDB (#8)
- Update the Config to use Cosmos for the sync API
- Ensure Cosmos DocId does not contain escape chars
- Create a shared Cosmos PartitionOffet table and refactor to use it
- Hardcode the "nafka" Connstring to use the "file:naffka.db"
- Create seq documents for each of the nextXXXID methods
2021-05-27 18:45:53 +10:00
Alex Flatow 4b42a0addb storage.go 2021-05-06 14:41:27 +10:00