Commit graph

3 commits

Author SHA1 Message Date
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 5d68daef80
Implement Cosmos DB for the RoomServer Service (#5)
* - Implement Cosmos for the devices_table
- Use the ConnectionString in the YAML to include the Tenant
- Revert all other non implemented tables back to use SQLLite3

* - Change the Config to use "test.criticicalarc.com" Container
- Add generic function GetDocumentOrNil to standardize GetDocument
- Add func to return CrossPartition queries for Aggregates
- Add func GetNextSequence() as generic seq generator for AutoIncrement
- Add cosmosdbutil.ErrNoRows to return (emulate) sql.ErrNoRows
- Add a "fake" ExclusiveWriterFake
- Add standard "getXX", "setXX" and "queryXX" to all TABLE class files
- Add specific Table SEQ for the Events table
- Add specific Table SEQ for the Rooms table
- Add specific Table SEQ for the StateSnapshot table
2021-05-20 14:42:33 +10:00