From c08b0a5d2bac2bf83caecc3d0f12f143271613ef Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 11 Jun 2021 15:30:33 +0200 Subject: [PATCH] feat(realtime): collection for concurrent connections --- app/config/collections.php | 33 ++++++++++++++++++++++++++++++ src/Appwrite/Database/Database.php | 3 +++ 2 files changed, 36 insertions(+) diff --git a/app/config/collections.php b/app/config/collections.php index 6789237c9c..d1d6230798 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -1698,6 +1698,39 @@ $collections = [ ], ], ], + Database::SYSTEM_COLLECTION_REALTIME_CONNECTIONS => [ + '$collection' => Database::SYSTEM_COLLECTION_COLLECTIONS, + '$id' => Database::SYSTEM_COLLECTION_REALTIME_CONNECTIONS, + '$permissions' => ['read' => ['*']], + 'name' => 'Realtime Connections', + 'structure' => true, + 'rules' => [ + [ + '$collection' => Database::SYSTEM_COLLECTION_REALTIME_CONNECTIONS, + 'label' => 'Container', + 'key' => 'container', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'required' => true, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_REALTIME_CONNECTIONS, + 'label' => 'Timestamp', + 'key' => 'timestamp', + 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, + 'required' => true, + 'array' => false, + ], + [ + '$collection' => Database::SYSTEM_COLLECTION_REALTIME_CONNECTIONS, + 'label' => 'Data', + 'key' => 'data', + 'type' => Database::SYSTEM_VAR_TYPE_TEXT, + 'required' => true, + 'array' => false, + ], + ], + ], Database::SYSTEM_COLLECTION_RESERVED => [ '$collection' => Database::SYSTEM_COLLECTION_COLLECTIONS, '$id' => Database::SYSTEM_COLLECTION_RESERVED, diff --git a/src/Appwrite/Database/Database.php b/src/Appwrite/Database/Database.php index d0defdec03..f0fbfc2efd 100644 --- a/src/Appwrite/Database/Database.php +++ b/src/Appwrite/Database/Database.php @@ -41,6 +41,9 @@ class Database const SYSTEM_COLLECTION_FUNCTIONS = 'functions'; const SYSTEM_COLLECTION_TAGS = 'tags'; const SYSTEM_COLLECTION_EXECUTIONS = 'executions'; + + // Realtime + const SYSTEM_COLLECTION_REALTIME_CONNECTIONS = 'realtimeConnections'; // Var Types const SYSTEM_VAR_TYPE_TEXT = 'text';