mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-26 16:23:09 -06:00
* - 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
25 lines
876 B
Go
25 lines
876 B
Go
package cosmosdb
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/matrix-org/dendrite/internal/cosmosdbutil"
|
|
)
|
|
|
|
func GetNextEventStateKeyNID(s *eventStateKeyStatements, ctx context.Context) (int64, error) {
|
|
const docId = "eventstatekeynid_seq"
|
|
//1 insert start at 2
|
|
return cosmosdbutil.GetNextSequence(ctx, s.db.connection, s.db.cosmosConfig, s.db.databaseName, s.tableName, docId, 2)
|
|
}
|
|
|
|
func GetNextEventTypeNID(s *eventTypeStatements, ctx context.Context) (int64, error) {
|
|
const docId = "eventtypenid_seq"
|
|
//7 inserts start at 8
|
|
return cosmosdbutil.GetNextSequence(ctx, s.db.connection, s.db.cosmosConfig, s.db.databaseName, s.tableName, docId, 8)
|
|
}
|
|
|
|
func GetNextEventNID(s *eventStatements, ctx context.Context) (int64, error) {
|
|
const docId = "eventnid_seq"
|
|
return cosmosdbutil.GetNextSequence(ctx, s.db.connection, s.db.cosmosConfig, s.db.databaseName, s.tableName, docId, 1)
|
|
}
|