From 5bd47e15e8aacff50923c72460a07179e6d01a87 Mon Sep 17 00:00:00 2001 From: Stefano Scafiti Date: Wed, 22 May 2024 23:47:30 +0200 Subject: [PATCH] Update schema.proto --- .github/workflows/ci.yml | 2 +- immudb/client.py | 22 +- immudb/datatypesv2.py | 147 +- immudb/grpc/proto/schema.proto | 2314 +++++++++++++------- immudb/grpc/schema_pb2.py | 422 ++-- immudb/grpc/schema_pb2_grpc.py | 112 +- immudb/handler/sqlquery.py | 137 +- immudb/handler/transaction.py | 11 +- tests/immu/test_create_load_database_v2.py | 8 +- tests/immu/test_session.py | 132 +- tests/immu/test_sql_verify.py | 149 +- tests/immu/test_user_operations.py | 17 +- tests/starttestcontainers.sh | 8 +- 13 files changed, 2282 insertions(+), 1199 deletions(-) mode change 100644 => 100755 tests/starttestcontainers.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c43c5f4..2b70e49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: make dev - name: Start immudb container run: | - docker run -d --health-cmd "immuadmin status" --health-interval 10s --health-timeout 5s --health-retries 5 -v ${{ github.workspace }}/tests/certs/my.key.pem:/key.pem -p 3322:3322 codenotary/immudb:1.9DOM --signingKey=/key.pem + docker run -d --health-cmd "immuadmin status" --health-interval 10s --health-timeout 5s --health-retries 5 -v ${{ github.workspace }}/tests/certs/my.key.pem:/key.pem -p 3322:3322 codenotary/immudb:1.9.3 --signingKey=/key.pem docker run -d --health-cmd "immuadmin status" --health-interval 10s --health-timeout 5s --health-retries 5 -v ${{ github.workspace }}/tests/certs/my.key.pem:/key.pem -p 3333:3322 codenotary/immudb:1.5.0 --signingKey=/key.pem docker run -d --health-cmd "immuadmin status" --health-interval 10s --health-timeout 5s --health-retries 5 -v ${{ github.workspace }}/tests/certs/my.key.pem:/key.pem -p 3344:3322 codenotary/immudb:1.4.1 --signingKey=/key.pem docker run -d --health-cmd "immuadmin status" --health-interval 10s --health-timeout 5s --health-retries 5 -v ${{ github.workspace }}/tests/certs/my.key.pem:/key.pem -p 3355:3322 codenotary/immudb:1.4.0 --signingKey=/key.pem diff --git a/immudb/client.py b/immudb/client.py index f12eb8c..4fbcecb 100644 --- a/immudb/client.py +++ b/immudb/client.py @@ -326,7 +326,7 @@ def openSession(self, username, password, database=b"defaultdb"): session_response = self._stub.OpenSession( req) self._stub = self._set_session_id_interceptor(session_response) - return transaction.Tx(self._stub, session_response, self.channel) + return transaction.Tx(self._stub, database, session_response, self.channel) def closeSession(self): """Closes unmanaged session @@ -1613,7 +1613,7 @@ def sqlExec(self, stmt, params={}, noWait=False): return sqlexec.call(self._stub, self._rs, stmt, params, noWait) - def sqlQuery(self, query, params={}, columnNameMode=constants.COLUMN_NAME_MODE_NONE): + def sqlQuery(self, query, params={}, columnNameMode=constants.COLUMN_NAME_MODE_NONE, acceptStream=False): """Queries the database using SQL Args: query: a query in immudb SQL dialect. @@ -1624,17 +1624,12 @@ def sqlQuery(self, query, params={}, columnNameMode=constants.COLUMN_NAME_MODE_N ['table1', 'table2'] """ - ret = sqlquery.call(self._stub, self._rs, query, - params, columnNameMode) - if columnNameMode in [constants.COLUMN_NAME_MODE_DATABASE, constants.COLUMN_NAME_MODE_FULL]: - # newer DB version don't insert database name anymore, we need to - # process it manually - for i, t in enumerate(ret): - newkeys = [ - x.replace("[@DB]", self._currentdb.decode("utf-8")) for x in t.keys()] - k = dict(zip(newkeys, list(t.values()))) - ret[i] = k - return ret + it = sqlquery.call(self._stub, self._rs, query, + params, columnNameMode, self._currentdb) + if acceptStream: + return it + + return list(it) def listTables(self): """List all tables in the current database @@ -1710,6 +1705,7 @@ def verifiableSQLGet(self, table: str, primaryKeys: List[datatypesv2.PrimaryKey] # immudb-py only + def getAllValues(self, keys: list): # immudb-py only resp = batchGet.call(self._stub, self._rs, keys) return resp diff --git a/immudb/datatypesv2.py b/immudb/datatypesv2.py index c09064f..d2112a3 100644 --- a/immudb/datatypesv2.py +++ b/immudb/datatypesv2.py @@ -401,6 +401,10 @@ class ServerInfoRequest(GRPCTransformable): @dataclass class ServerInfoResponse(GRPCTransformable): version: str = None + startedAt: int = None + numTransactions: int = None + numDatabases: int = None + databasesDiskSize: int = None @dataclass @@ -737,28 +741,74 @@ class DatabaseNullableSettings(GRPCTransformable): syncFrequency: NullableMilliseconds = None writeBufferSize: NullableUint32 = None ahtSettings: AHTNullableSettings = None + maxActiveTransactions: NullableUint32 = None + mvccReadSetLimit: NullableUint32 = None + vLogCacheSize: NullableUint32 = None + truncationSettings: TruncationNullableSettings = None + embeddedValues: NullableBool = None + preallocFiles: NullableBool = None def _getHumanDataClass(self): return grpcHumanizator(self, DatabaseSettingsV2) +@dataclass +class TruncationNullableSettings(GRPCTransformable): + retentionPeriod: NullableMilliseconds = None + truncationFrequency: NullableMilliseconds = None + + def _getHumanDataClass(self): + return grpcHumanizator(self, TruncationSettings) + + @dataclass class ReplicationSettings(GRPCTransformable): replica: Optional[bool] = None - masterDatabase: Optional[str] = None - masterAddress: Optional[str] = None - masterPort: Optional[int] = None - followerUsername: Optional[str] = None - followerPassword: Optional[str] = None + primaryDatabase: Optional[str] = None + primaryHost: Optional[str] = None + primaryPort: Optional[int] = None + primaryUsername: Optional[str] = None + primaryPassword: Optional[str] = None + syncReplication: Optional[bool] = None + syncAcks: Optional[int] = None + prefetchTxBufferSize: Optional[int] = None + replicationCommitConcurrency: Optional[int] = None + allowTxDiscarding: Optional[bool] = None + skipIntegrityCheck: Optional[bool] = None + waitForIndexing: Optional[bool] = None def _getGRPC(self): return schema.ReplicationNullableSettings( replica=NullableBool(self.replica)._getGRPC(), - masterDatabase=NullableString(self.masterDatabase)._getGRPC(), - masterAddress=NullableString(self.masterAddress)._getGRPC(), - masterPort=NullableUint32(self.masterPort)._getGRPC(), - followerUsername=NullableString(self.followerUsername)._getGRPC(), - followerPassword=NullableString(self.followerPassword)._getGRPC() + primaryDatabase=NullableString(self.primaryDatabase)._getGRPC(), + primaryHost=NullableString(self.primaryHost)._getGRPC(), + primaryPort=NullableUint32(self.primaryPort)._getGRPC(), + primaryUsername=NullableString(self.primaryUsername)._getGRPC(), + primaryPassword=NullableString(self.primaryUsername)._getGRPC(), + syncReplication=NullableBool(self.syncReplication)._getGRPC(), + syncAcks=NullableUint32(self.syncAcks)._getGRPC(), + prefetchTxBufferSize=NullableUint32( + self.prefetchTxBufferSize)._getGRPC(), + replicationCommitConcurrency=NullableUint32( + self.replicationCommitConcurrency)._getGRPC(), + allowTxDiscarding=NullableBool(self.allowTxDiscarding)._getGRPC(), + skipIntegrityCheck=NullableBool( + self.skipIntegrityCheck)._getGRPC(), + waitForIndexing=NullableBool(self.waitForIndexing)._getGRPC(), + ) + + +@dataclass +class TruncationSettings(GRPCTransformable): + retentionPeriod: Optional[int] + truncationFrequency: Optional[int] + + def _getGRPC(self): + return schema.TruncationNullableSettings( + retentionPeriod=NullableMilliseconds( + self.retentionPeriod)._getGRPC(), + truncationFrequency=NullableMilliseconds( + self.truncationFrequency)._getGRPC(), ) @@ -777,6 +827,8 @@ class IndexSettings(GRPCTransformable): commitLogMaxOpenedFiles: Optional[int] = None flushBufferSize: Optional[int] = None cleanupPercentage: Optional[float] = None + maxBulkSize: Optional[int] = None + bulkPreparationTimeout: Optional[int] = None def _getGRPC(self): return schema.IndexNullableSettings( @@ -798,7 +850,10 @@ def _getGRPC(self): commitLogMaxOpenedFiles=NullableUint32( self.commitLogMaxOpenedFiles)._getGRPC(), flushBufferSize=NullableUint32(self.flushBufferSize)._getGRPC(), - cleanupPercentage=NullableFloat(self.cleanupPercentage)._getGRPC() + cleanupPercentage=NullableFloat(self.cleanupPercentage)._getGRPC(), + maxBulkSize=NullableUint32(self.maxBulkSize)._getGRPC(), + bulkPreparationTimeout=NullableMilliseconds( + self.bulkPreparationTimeout)._getGRPC(), ) @@ -817,36 +872,48 @@ def _getGRPC(self): @dataclass class DatabaseSettingsV2(GRPCTransformable): replicationSettings: ReplicationSettings = None - fileSize: Optional[int] = None - maxKeyLen: Optional[int] = None - maxValueLen: Optional[int] = None - maxTxEntries: Optional[int] = None - excludeCommitTime: Optional[bool] = None + fileSize: Optional[int] = None + maxKeyLen: Optional[int] = None + maxValueLen: Optional[int] = None + maxTxEntries: Optional[int] = None + excludeCommitTime: Optional[bool] = None maxConcurrency: Optional[int] = None maxIOConcurrency: Optional[int] = None txLogCacheSize: Optional[int] = None - vLogMaxOpenedFiles: Optional[int] = None - txLogMaxOpenedFiles: Optional[int] = None - commitLogMaxOpenedFiles: Optional[int] = None - indexSettings: IndexSettings = None + vLogMaxOpenedFiles: Optional[int] = None + txLogMaxOpenedFiles: Optional[int] = None + commitLogMaxOpenedFiles: Optional[int] = None + indexSettings: IndexSettings = None writeTxHeaderVersion: Optional[int] = None - autoload: Optional[bool] = None - readTxPoolSize: Optional[int] = None + autoload: Optional[bool] = None + readTxPoolSize: Optional[int] = None syncFrequency: NullableMilliseconds = None writeBufferSize: Optional[int] = None ahtSettings: AHTSettings = None + maxActiveTransactions: Optional[int] = None + mvccReadSetLimit: Optional[int] = None + vLogCacheSize: Optional[int] = None + truncationSettings: TruncationSettings = None + embeddedValues: Optional[bool] = None + preallocFiles: Optional[bool] = None def _getGRPC(self): indexSettings = None if self.indexSettings != None: indexSettings = self.indexSettings._getGRPC() + replicationSettings = None if self.replicationSettings != None: replicationSettings = self.replicationSettings._getGRPC() + ahtSettings = None if self.ahtSettings != None: ahtSettings = self.ahtSettings._getGRPC() + truncSettings = None + if self.truncationSettings != None: + truncSettings = self.truncationSettings._getGRPC() + return schema.DatabaseNullableSettings( replicationSettings=replicationSettings, fileSize=NullableUint32(self.fileSize)._getGRPC(), @@ -870,18 +937,32 @@ def _getGRPC(self): readTxPoolSize=NullableUint32(self.readTxPoolSize)._getGRPC(), syncFrequency=NullableMilliseconds(self.syncFrequency)._getGRPC(), writeBufferSize=NullableUint32(self.writeBufferSize)._getGRPC(), - ahtSettings=ahtSettings + ahtSettings=ahtSettings, + maxActiveTransactions=NullableUint32( + self.maxActiveTransactions)._getGRPC(), + mvccReadSetLimit=NullableUint32(self.mvccReadSetLimit)._getGRPC(), + vLogCacheSize=NullableUint32(self.vLogCacheSize)._getGRPC(), + truncationSettings=truncSettings, + embeddedValues=NullableBool(self.embeddedValues)._getGRPC(), + preallocFiles=NullableBool(self.preallocFiles)._getGRPC(), ) @dataclass class ReplicationNullableSettings(GRPCTransformable): replica: NullableBool = None - masterDatabase: NullableString = None - masterAddress: NullableString = None - masterPort: NullableUint32 = None - followerUsername: NullableString = None - followerPassword: NullableString = None + primaryDatabase: NullableString = None + primaryHost: NullableString = None + primaryPort: NullableUint32 = None + primaryUsername: NullableString = None + primaryPassword: NullableString = None + syncReplication: NullableBool = None + syncAcks: NullableUint32 = None + prefetchTxBufferSize: NullableUint32 = None, + replicationCommitConcurrency: NullableUint32 = None, + allowTxDiscarding: NullableBool = None, + skipIntegrityCheck: NullableBool = None, + waitForIndexing: NullableBool = None, def _getHumanDataClass(self): return grpcHumanizator(self, ReplicationSettings) @@ -902,6 +983,8 @@ class IndexNullableSettings(GRPCTransformable): commitLogMaxOpenedFiles: NullableUint32 = None flushBufferSize: NullableUint32 = None cleanupPercentage: NullableFloat = None + maxBulkSize: NullableUint32 = None + bulkPreparationTimeout: NullableMilliseconds = None def _getHumanDataClass(self): return grpcHumanizator(self, IndexSettings) @@ -1035,7 +1118,7 @@ class DatabaseListRequestV2(GRPCTransformable): @dataclass class DatabaseListResponseV2(GRPCTransformable): - databases: List[Union[DatabaseWithSettings, DatabaseWithSettingsV2]] = None + databases: List[Union[DatabaseWithSettings, DatabaseInfo]] = None def _getHumanDataClass(self): return DatabaseListResponseV2(databases=[toConvert._getHumanDataClass() for toConvert in self.databases]) @@ -1048,14 +1131,16 @@ class DatabaseWithSettings(GRPCTransformable): loaded: bool = None def _getHumanDataClass(self): - return grpcHumanizator(self, DatabaseWithSettingsV2) + return grpcHumanizator(self, DatabaseInfo) @dataclass -class DatabaseWithSettingsV2(GRPCTransformable): +class DatabaseInfo(GRPCTransformable): name: str = None settings: DatabaseSettingsV2 = None loaded: bool = None + diskSize: int = None + numTransactions: int = None @dataclass diff --git a/immudb/grpc/proto/schema.proto b/immudb/grpc/proto/schema.proto index 6da6a9e..d1c2069 100644 --- a/immudb/grpc/proto/schema.proto +++ b/immudb/grpc/proto/schema.proto @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -16,308 +16,562 @@ limitations under the License. syntax = "proto3"; +package immudb.schema; + import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/struct.proto"; -package immudb.schema; - option go_package = "github.com/codenotary/immudb/pkg/api/schema"; message Key { - bytes key = 1; + bytes key = 1; } message Permission { - string database = 1; - uint32 permission = 2; + // Database name + string database = 1; + + // Permission, 1 - read permission, 2 - read+write permission, 254 - admin, 255 - sysadmin + uint32 permission = 2; } message User { - bytes user = 1; - repeated Permission permissions = 3; - string createdby = 4; - string createdat = 5; - bool active = 6; + // Username + bytes user = 1; + + // List of permissions for the user + repeated Permission permissions = 3; + + // Name of the creator user + string createdby = 4; + + // Time when the user was created + string createdat = 5; + + // Flag indicating whether the user is active or not + bool active = 6; } message UserList { - repeated User users = 1; + // List of users + repeated User users = 1; } message CreateUserRequest { - bytes user = 1; - bytes password = 2; - uint32 permission = 3; - string database = 4; + // Username + bytes user = 1; + + // Login password + bytes password = 2; + + // Permission, 1 - read permission, 2 - read+write permission, 254 - admin + uint32 permission = 3; + + // Database name + string database = 4; } message UserRequest { - bytes user = 1; + // Username + bytes user = 1; } message ChangePasswordRequest { - bytes user = 1; - bytes oldPassword = 2; - bytes newPassword = 3; + // Username + bytes user = 1; + + // Old password + bytes oldPassword = 2; + + // New password + bytes newPassword = 3; } message LoginRequest { - bytes user = 1; - bytes password = 2; + // Username + bytes user = 1; + + // User's password + bytes password = 2; } message LoginResponse { - string token = 1; - bytes warning = 2; + // Deprecated: use session-based authentication + string token = 1; + + // Optional: additional warning message sent to the user (e.g. request to change the password) + bytes warning = 2; } +// DEPRECATED message AuthConfig { - uint32 kind = 1; + uint32 kind = 1; } +// DEPRECATED message MTLSConfig { - bool enabled = 1; + bool enabled = 1; } message OpenSessionRequest { - bytes username = 1; - bytes password = 2; - string databaseName = 3; + // Username + bytes username = 1; + + // Password + bytes password = 2; + + // Database name + string databaseName = 3; } message OpenSessionResponse { - string sessionID = 1; - string serverUUID = 2; + // Id of the new session + string sessionID = 1; + + // UUID of the server + string serverUUID = 2; } //////////////////////////////////////////////////////// message Precondition { - - message KeyMustExistPrecondition { - bytes key = 1; - } - - message KeyMustNotExistPrecondition { - bytes key = 1; - } - - message KeyNotModifiedAfterTXPrecondition { - bytes key = 1; - uint64 txID = 2; - } - - oneof precondition { - KeyMustExistPrecondition keyMustExist = 1; - KeyMustNotExistPrecondition keyMustNotExist = 2; - KeyNotModifiedAfterTXPrecondition keyNotModifiedAfterTX = 3; - } + // Only succeed if given key exists + message KeyMustExistPrecondition { + // key to check + bytes key = 1; + } + + // Only succeed if given key does not exists + message KeyMustNotExistPrecondition { + // key to check + bytes key = 1; + } + + // Only succeed if given key was not modified after given transaction + message KeyNotModifiedAfterTXPrecondition { + // key to check + bytes key = 1; + + // transaction id to check against + uint64 txID = 2; + } + + oneof precondition { + KeyMustExistPrecondition keyMustExist = 1; + KeyMustNotExistPrecondition keyMustNotExist = 2; + KeyNotModifiedAfterTXPrecondition keyNotModifiedAfterTX = 3; + } } message KeyValue { - bytes key = 1; - bytes value = 2; - KVMetadata metadata = 3; + bytes key = 1; + bytes value = 2; + KVMetadata metadata = 3; } message Entry { - uint64 tx = 1; - bytes key = 2; - bytes value = 3; - Reference referencedBy = 4; - KVMetadata metadata = 5; - bool expired = 6; - uint64 revision = 7; + // Transaction id at which the target value was set (i.e. not the reference transaction id) + uint64 tx = 1; + + // Key of the target value (i.e. not the reference entry) + bytes key = 2; + + // Value + bytes value = 3; + + // If the request was for a reference, this field will keep information about the reference entry + Reference referencedBy = 4; + + // Metadata of the target entry (i.e. not the reference entry) + KVMetadata metadata = 5; + + // If set to true, this entry has expired and the value is not retrieved + bool expired = 6; + + // Key's revision, in case of GetAt it will be 0 + uint64 revision = 7; } message Reference { - uint64 tx = 1; - bytes key = 2; - uint64 atTx = 3; - KVMetadata metadata = 4; - uint64 revision = 5; + // Transaction if when the reference key was set + uint64 tx = 1; + + // Reference key + bytes key = 2; + + // At which transaction the key is bound, 0 if reference is not bound and should read the most recent reference + uint64 atTx = 3; + + // Metadata of the reference entry + KVMetadata metadata = 4; + + // Revision of the reference entry + uint64 revision = 5; } message Op { - oneof operation { - KeyValue kv = 1; - ZAddRequest zAdd = 2; - ReferenceRequest ref = 3; - } + oneof operation { + // Modify / add simple KV value + KeyValue kv = 1; + + // Modify / add sorted set entry + ZAddRequest zAdd = 2; + + // Modify / add reference + ReferenceRequest ref = 3; + } } message ExecAllRequest { - repeated Op Operations = 1; - bool noWait = 2; - repeated Precondition preconditions = 3; + // List of operations to perform + repeated Op Operations = 1; + + // If set to true, do not wait for indexing to process this transaction + bool noWait = 2; + + // Preconditions to check + repeated Precondition preconditions = 3; } message Entries { - repeated Entry entries = 1; + // List of entries + repeated Entry entries = 1; } message ZEntry { - bytes set = 1; - bytes key = 2; - Entry entry = 3; - double score = 4; - uint64 atTx = 5; + // Name of the sorted set + bytes set = 1; + + // Referenced key + bytes key = 2; + + // Referenced entry + Entry entry = 3; + + // Sorted set element's score + double score = 4; + + // At which transaction the key is bound, + // 0 if reference is not bound and should read the most recent reference + uint64 atTx = 5; } message ZEntries { - repeated ZEntry entries = 1; + repeated ZEntry entries = 1; } message ScanRequest { - bytes seekKey = 1; - bytes endKey = 7; - bytes prefix = 2; - bool desc = 3; - uint64 limit = 4; - uint64 sinceTx = 5; - bool noWait = 6; - bool inclusiveSeek = 8; // If set to true, results will include seekKey - bool inclusiveEnd = 9; // If set to true, results will include endKey if needed - uint64 offset = 10; // Specify the initial entry to be returned by excluding the initial set of entries + // If not empty, continue scan at (when inclusiveSeek == true) + // or after (when inclusiveSeek == false) that key + bytes seekKey = 1; + + // stop at (when inclusiveEnd == true) + // or before (when inclusiveEnd == false) that key + bytes endKey = 7; + + // search for entries with this prefix only + bytes prefix = 2; + + // If set to true, sort items in descending order + bool desc = 3; + + // maximum number of entries to get, if not specified, the default value is used + uint64 limit = 4; + + // If non-zero, only require transactions up to this transaction to be + // indexed, newer transaction may still be pending + uint64 sinceTx = 5; + + // Deprecated: If set to true, do not wait for indexing to be done before finishing this call + bool noWait = 6; + + // If set to true, results will include seekKey + bool inclusiveSeek = 8; + + // If set to true, results will include endKey if needed + bool inclusiveEnd = 9; + + // Specify the initial entry to be returned by excluding the initial set of entries + uint64 offset = 10; } message KeyPrefix { - bytes prefix = 1; + bytes prefix = 1; } message EntryCount { - uint64 count = 1; + uint64 count = 1; } /////////////// message Signature { - bytes publicKey = 1; - bytes signature = 2; + bytes publicKey = 1; + bytes signature = 2; } message TxHeader { - uint64 id = 1; - bytes prevAlh = 2; - int64 ts = 3; - int32 nentries = 4; - bytes eH = 5; - uint64 blTxId = 6; - bytes blRoot = 7; - int32 version = 8; - TxMetadata metadata = 9; + // Transaction ID + uint64 id = 1; + + // State value (Accumulative Hash - Alh) of the previous transaction + bytes prevAlh = 2; + + // Unix timestamp of the transaction (in seconds) + int64 ts = 3; + + // Number of entries in a transaction + int32 nentries = 4; + + // Entries Hash - cumulative hash of all entries in the transaction + bytes eH = 5; + + // Binary linking tree transaction ID + // (ID of last transaction already in the main Merkle Tree) + uint64 blTxId = 6; + + // Binary linking tree root (Root hash of the Merkle Tree) + bytes blRoot = 7; + + // Header version + int32 version = 8; + + // Transaction metadata + TxMetadata metadata = 9; } +// TxMetadata contains metadata set to whole transaction message TxMetadata { + // Entry expiration information + uint64 truncatedTxID = 1; + // Extra data + bytes extra = 2; } +// LinearProof contains the linear part of the proof (outside the main Merkle Tree) message LinearProof { - uint64 sourceTxId = 1; - uint64 TargetTxId = 2; - repeated bytes terms = 3; + // Starting transaction of the proof + uint64 sourceTxId = 1; + + // End transaction of the proof + uint64 TargetTxId = 2; + + // List of terms (inner hashes of transaction entries) + repeated bytes terms = 3; } +// LinearAdvanceProof contains the proof of consistency between the consumed part of the older linear chain +// and the new Merkle Tree +message LinearAdvanceProof { + // terms for the linear chain + repeated bytes linearProofTerms = 1; + + // inclusion proofs for steps on the linear chain + repeated InclusionProof inclusionProofs = 2; +} + +// DualProof contains inclusion and consistency proofs for dual Merkle-Tree + Linear proofs message DualProof { - TxHeader sourceTxHeader = 1; - TxHeader targetTxHeader = 2; + // Header of the source (earlier) transaction + TxHeader sourceTxHeader = 1; + + // Header of the target (latter) transaction + TxHeader targetTxHeader = 2; + + // Inclusion proof of the source transaction hash in the main Merkle Tree + repeated bytes inclusionProof = 3; + + // Consistency proof between Merkle Trees in the source and target transactions + repeated bytes consistencyProof = 4; + + // Accumulative hash (Alh) of the last transaction that's part of the target Merkle Tree + bytes targetBlTxAlh = 5; + + // Inclusion proof of the targetBlTxAlh in the target Merkle Tree + repeated bytes lastInclusionProof = 6; - repeated bytes inclusionProof = 3; - repeated bytes consistencyProof = 4; + // Linear proof starting from targetBlTxAlh to the final state value + LinearProof linearProof = 7; - bytes targetBlTxAlh = 5; - repeated bytes lastInclusionProof = 6; + // Proof of consistency between some part of older linear chain and newer Merkle Tree + LinearAdvanceProof LinearAdvanceProof = 8; +} + +// DualProofV2 contains inclusion and consistency proofs +message DualProofV2 { + // Header of the source (earlier) transaction + TxHeader sourceTxHeader = 1; + + // Header of the target (latter) transaction + TxHeader targetTxHeader = 2; - LinearProof linearProof = 7; + // Inclusion proof of the source transaction hash in the main Merkle Tree + repeated bytes inclusionProof = 3; + + // Consistency proof between Merkle Trees in the source and target transactions + repeated bytes consistencyProof = 4; } message Tx { - TxHeader header = 1; - repeated TxEntry entries = 2; - repeated Entry kvEntries = 3; - repeated ZEntry zEntries = 4; + // Transaction header + TxHeader header = 1; + + // Raw entry values + repeated TxEntry entries = 2; + + // KV entries in the transaction (parsed) + repeated Entry kvEntries = 3; + + // Sorted Set entries in the transaction (parsed) + repeated ZEntry zEntries = 4; } message TxEntry { - bytes key = 1; - bytes hValue = 2; - int32 vLen = 3; - KVMetadata metadata = 4; - bytes value = 5; // value must be ignored when len(value) == 0 and vLen > 0. Otherwise, sha256(value) must be equal to hValue + // Raw key value (contains 1-byte prefix for kind of the key) + bytes key = 1; + + // Value hash + bytes hValue = 2; + + // Value length + int32 vLen = 3; + + // Entry metadata + KVMetadata metadata = 4; + + // value, must be ignored when len(value) == 0 and vLen > 0. + // Otherwise sha256(value) must be equal to hValue. + bytes value = 5; } message KVMetadata { - bool deleted = 1; - Expiration expiration = 2; - bool nonIndexable = 3; + // True if this entry denotes a logical deletion + bool deleted = 1; + + // Entry expiration information + Expiration expiration = 2; + + // If set to true, this entry will not be indexed and will only be accessed through GetAt calls + bool nonIndexable = 3; } message Expiration { - int64 expiresAt = 1; + // Entry expiration time (unix timestamp in seconds) + int64 expiresAt = 1; } message VerifiableTx { - Tx tx = 1; - DualProof dualProof = 2; - Signature signature = 3; + // Transaction to verify + Tx tx = 1; + + // Proof for the transaction + DualProof dualProof = 2; + + // Signature for the new state value + Signature signature = 3; +} + +message VerifiableTxV2 { + // Transaction to verify + Tx tx = 1; + + // Proof for the transaction + DualProofV2 dualProof = 2; + + // Signature for the new state value + Signature signature = 3; } ////////////////// message VerifiableEntry { - Entry entry = 1; - VerifiableTx verifiableTx = 2; - InclusionProof inclusionProof = 3; + // Entry to verify + Entry entry = 1; + + // Transaction to verify + VerifiableTx verifiableTx = 2; + + // Proof for inclusion of the entry within the transaction + InclusionProof inclusionProof = 3; } message InclusionProof { - int32 leaf = 1; - int32 width = 2; - repeated bytes terms = 3; + // Index of the leaf for which the proof is generated + int32 leaf = 1; + + // Width of the tree at the leaf level + int32 width = 2; + + // Proof terms (selected hashes from the tree) + repeated bytes terms = 3; } message SetRequest { - repeated KeyValue KVs = 1; - bool noWait = 2; - repeated Precondition preconditions = 3; + // List of KV entries to set + repeated KeyValue KVs = 1; + + // If set to true, do not wait for indexer to index ne entries + bool noWait = 2; + + // Preconditions to be met to perform the write + repeated Precondition preconditions = 3; } message KeyRequest { - bytes key = 1; - uint64 atTx = 2; // if > 0, query for the value exactly at given transaction - + // Key to query for + bytes key = 1; - // if 0 (and nowait=false), wait for the index to be up=to-date - uint64 sinceTx = 3; + // If > 0, query for the value exactly at given transaction + uint64 atTx = 2; - // if set to true - do not wait for any indexing update considering only the currently indexed state - bool noWait = 4; + // If 0 (and noWait=false), wait for the index to be up-to-date, + // If > 0 (and noWait=false), wait for at lest the sinceTx transaction to be indexed + uint64 sinceTx = 3; - // if > 0, get the nth version of the value, 1 being the first version, 2 being the second and so on - // if < 0, get the historical nth value of the key, -1 being the previous version, -2 being the one before and so on - int64 atRevision = 5; + // If set to true - do not wait for any indexing update considering only the currently indexed state + bool noWait = 4; + // If > 0, get the nth version of the value, 1 being the first version, 2 being the second and so on + // If < 0, get the historical nth value of the key, -1 being the previous version, -2 being the one before and so on + int64 atRevision = 5; } message KeyListRequest { - repeated bytes keys = 1; - uint64 sinceTx = 2; + // List of keys to query for + repeated bytes keys = 1; + + // If 0, wait for index to be up-to-date, + // If > 0, wait for at least sinceTx transaction to be indexed + uint64 sinceTx = 2; } message DeleteKeysRequest { - repeated bytes keys = 1; - uint64 sinceTx = 2; - bool noWait = 3; + // List of keys to delete logically + repeated bytes keys = 1; + + // If 0, wait for index to be up-to-date, + // If > 0, wait for at least sinceTx transaction to be indexed + uint64 sinceTx = 2; + + // If set to true, do not wait for the indexer to index this operation + bool noWait = 3; } message VerifiableSetRequest { - SetRequest setRequest = 1; - uint64 proveSinceTx = 2; + // Keys to set + SetRequest setRequest = 1; + + // When generating the proof, generate consistency proof with state from this transaction + uint64 proveSinceTx = 2; } message VerifiableGetRequest { - KeyRequest keyRequest = 1; - uint64 proveSinceTx = 2; + // Key to read + KeyRequest keyRequest = 1; + + // When generating the proof, generate consistency proof with state from this transaction + uint64 proveSinceTx = 2; } // ServerInfoRequest exists to provide extensibility for rpc ServerInfo. @@ -325,860 +579,1358 @@ message ServerInfoRequest {} // ServerInfoResponse contains information about the server instance. message ServerInfoResponse { - // The version of the server instance. - string version = 1; + // The version of the server instance. + string version = 1; + + // Unix timestamp (seconds) indicating when the server process has been started. + int64 startedAt = 2; + + // Total number of transactions across all databases. + int64 numTransactions = 3; + + // Total number of databases present. + int32 numDatabases = 4; + + // Total disk size used by all databases. + int64 databasesDiskSize = 5; } message HealthResponse { - bool status = 1; - string version = 2; + // If true, server considers itself to be healthy + bool status = 1; + + // The version of the server instance + string version = 2; } message DatabaseHealthResponse { - uint32 pendingRequests = 1; - int64 lastRequestCompletedAt = 2; + // Number of requests currently being executed + uint32 pendingRequests = 1; + + // Timestamp at which the last request was completed + int64 lastRequestCompletedAt = 2; } message ImmutableState { - string db = 1; - uint64 txId = 2; - bytes txHash = 3; - Signature signature = 4; + // The db name + string db = 1; + + // Id of the most recent transaction + uint64 txId = 2; + + // State of the most recent transaction + bytes txHash = 3; + + // Signature of the hash + Signature signature = 4; + + // following fields are not part of the signature + + // Id of the most recent precommitted transaction + uint64 precommittedTxId = 5; + + // State of the most recent precommitted transaction + bytes precommittedTxHash = 6; } message ReferenceRequest { - bytes key = 1; - bytes referencedKey = 2; - uint64 atTx = 3; - bool boundRef = 4; - bool noWait = 5; - repeated Precondition preconditions = 6; + // Key for the reference + bytes key = 1; + + // Key to be referenced + bytes referencedKey = 2; + + // If boundRef == true, id of transaction to bind with the reference + uint64 atTx = 3; + + // If true, bind the reference to particular transaction, + // if false, use the most recent value of the key + bool boundRef = 4; + + // If true, do not wait for the indexer to index this write operation + bool noWait = 5; + + // Preconditions to be met to perform the write + repeated Precondition preconditions = 6; } message VerifiableReferenceRequest { - ReferenceRequest referenceRequest = 1; - uint64 proveSinceTx = 2; + // Reference data + ReferenceRequest referenceRequest = 1; + + // When generating the proof, generate consistency proof with state from this + // transaction + uint64 proveSinceTx = 2; } message ZAddRequest { - bytes set = 1; - double score = 2; - bytes key = 3; - uint64 atTx = 4; - bool boundRef = 5; - bool noWait = 6; + // Name of the sorted set + bytes set = 1; + + // Score of the new entry + double score = 2; + + // Referenced key + bytes key = 3; + + // If boundRef == true, id of the transaction to bind with the reference + uint64 atTx = 4; + + // If true, bind the reference to particular transaction, if false, use the + // most recent value of the key + bool boundRef = 5; + + // If true, do not wait for the indexer to index this write operation + bool noWait = 6; } message Score { - double score = 1; + // Entry's score value + double score = 1; } message ZScanRequest { - bytes set = 1; - bytes seekKey = 2; - double seekScore = 3; - uint64 seekAtTx = 4; - bool inclusiveSeek = 5; - uint64 limit = 6; - bool desc = 7; - Score minScore = 8; - Score maxScore = 9; - uint64 sinceTx = 10; - bool noWait = 11; - uint64 offset = 12; // Specify the initial entry to be returned by excluding the initial set of entries + // Name of the sorted set + bytes set = 1; + + // Key to continue the search at + bytes seekKey = 2; + + // Score of the entry to continue the search at + double seekScore = 3; + + // AtTx of the entry to continue the search at + uint64 seekAtTx = 4; + + // If true, include the entry given with the `seekXXX` attributes, if false, + // skip the entry and start after that one + bool inclusiveSeek = 5; + + // Maximum number of entries to return, if 0, the default limit will be used + uint64 limit = 6; + + // If true, scan entries in descending order + bool desc = 7; + + // Minimum score of entries to scan + Score minScore = 8; + + // Maximum score of entries to scan + Score maxScore = 9; + + // If > 0, do not wait for the indexer to index all entries, only require + // entries up to sinceTx to be indexed + uint64 sinceTx = 10; + + // Deprecated: If set to true, do not wait for the indexer to be up to date + bool noWait = 11; + + // Specify the index of initial entry to be returned by excluding the initial + // set of entries (alternative to seekXXX attributes) + uint64 offset = 12; } message HistoryRequest { - bytes key = 1; - uint64 offset = 2; // Specify the initial entry to be returned by excluding the initial set of entries - int32 limit = 3; - bool desc = 4; - uint64 sinceTx = 5; + // Name of the key to query for the history + bytes key = 1; + // Specify the initial entry to be returned by excluding the initial set of + // entries + uint64 offset = 2; + + // Maximum number of entries to return + int32 limit = 3; + + // If true, search in descending order + bool desc = 4; + + // If > 0, do not wait for the indexer to index all entries, only require + // entries up to sinceTx to be indexed + uint64 sinceTx = 5; } message VerifiableZAddRequest { - ZAddRequest zAddRequest = 1; - uint64 proveSinceTx = 2; + // Data for new sorted set entry + ZAddRequest zAddRequest = 1; + + // When generating the proof, generate consistency proof with state from this transaction + uint64 proveSinceTx = 2; } message TxRequest { - uint64 tx = 1; - EntriesSpec entriesSpec = 2; - uint64 sinceTx = 3; - bool noWait = 4; - bool keepReferencesUnresolved = 5; + // Transaction id to query for + uint64 tx = 1; + + // Specification for parsing entries, if empty, entries are returned in raw form + EntriesSpec entriesSpec = 2; + + // If > 0, do not wait for the indexer to index all entries, only require + // entries up to sinceTx to be indexed, will affect resolving references + uint64 sinceTx = 3; + + // Deprecated: If set to true, do not wait for the indexer to be up to date + bool noWait = 4; + + // If set to true, do not resolve references (avoid looking up final values if not needed) + bool keepReferencesUnresolved = 5; } message EntriesSpec { - EntryTypeSpec kvEntriesSpec = 1; - EntryTypeSpec zEntriesSpec = 2; - EntryTypeSpec sqlEntriesSpec = 3; + // Specification for parsing KV entries + EntryTypeSpec kvEntriesSpec = 1; + + // Specification for parsing sorted set entries + EntryTypeSpec zEntriesSpec = 2; + + // Specification for parsing SQL entries + EntryTypeSpec sqlEntriesSpec = 3; } message EntryTypeSpec { - EntryTypeAction action = 1; + // Action to perform on entries + EntryTypeAction action = 1; } enum EntryTypeAction { - EXCLUDE = 0; - ONLY_DIGEST = 1; - RAW_VALUE = 2; - RESOLVE = 3; + // Exclude entries from the result + EXCLUDE = 0; + + // Provide keys in raw (unparsed) form and only the digest of the value + ONLY_DIGEST = 1; + + // Provide keys and values in raw form + RAW_VALUE = 2; + + // Provide parsed keys and values and resolve values if needed + RESOLVE = 3; } message VerifiableTxRequest { - uint64 tx = 1; - uint64 proveSinceTx = 2; - EntriesSpec entriesSpec = 3; - uint64 sinceTx = 4; - bool noWait = 5; - bool keepReferencesUnresolved = 6; + // Transaction ID + uint64 tx = 1; + + // When generating the proof, generate consistency proof with state from this + // transaction + uint64 proveSinceTx = 2; + + // Specification of how to parse entries + EntriesSpec entriesSpec = 3; + + // If > 0, do not wait for the indexer to index all entries, only require + // entries up to sinceTx to be indexed, will affect resolving references + uint64 sinceTx = 4; + + // Deprecated: If set to true, do not wait for the indexer to be up to date + bool noWait = 5; + + // If set to true, do not resolve references (avoid looking up final values if not needed) + bool keepReferencesUnresolved = 6; } message TxScanRequest { - uint64 initialTx = 1; - uint32 limit = 2; - bool desc = 3; - EntriesSpec entriesSpec = 4; - uint64 sinceTx = 5; - bool noWait = 6; + // ID of the transaction where scanning should start + uint64 initialTx = 1; + + // Maximum number of transactions to scan, when not specified the default limit is used + uint32 limit = 2; + + // If set to true, scan transactions in descending order + bool desc = 3; + + // Specification of how to parse entries + EntriesSpec entriesSpec = 4; + + // If > 0, do not wait for the indexer to index all entries, only require + // entries up to sinceTx to be indexed, will affect resolving references + uint64 sinceTx = 5; + + // Deprecated: If set to true, do not wait for the indexer to be up to date + bool noWait = 6; } message TxList { - repeated Tx txs = 1; + // List of transactions + repeated Tx txs = 1; } message ExportTxRequest { - uint64 tx = 1; + // Id of transaction to export + uint64 tx = 1; + // If set to true, non-committed transactions can be exported + bool allowPreCommitted = 2; + // Used on synchronous replication to notify the primary about replica state + ReplicaState replicaState = 3; + // If set to true, integrity checks are skipped when reading data + bool skipIntegrityCheck = 4; +} + +message ReplicaState { + string UUID = 1; + uint64 committedTxID = 2; + bytes committedAlh = 3; + uint64 precommittedTxID = 4; + bytes precommittedAlh = 5; } message Database { - string databaseName = 1; + // Name of the database + string databaseName = 1; } message DatabaseSettings { - string databaseName = 1; + // Name of the database + string databaseName = 1; + + // If set to true, this database is replicating another database + bool replica = 2; + + // Name of the database to replicate + string primaryDatabase = 3; + + // Hostname of the immudb instance with database to replicate + string primaryHost = 4; + + // Port of the immudb instance with database to replicate + uint32 primaryPort = 5; - bool replica = 2; - string masterDatabase = 3; - string masterAddress = 4; - uint32 masterPort = 5; - string followerUsername = 6; - string followerPassword = 7; + // Username of the user with read access of the database to replicate + string primaryUsername = 6; - uint32 fileSize = 8; - uint32 maxKeyLen = 9; - uint32 maxValueLen = 10; - uint32 maxTxEntries = 11; + // Password of the user with read access of the database to replicate + string primaryPassword = 7; - bool excludeCommitTime = 12; + // Size of files stored on disk + uint32 fileSize = 8; + + // Maximum length of keys + uint32 maxKeyLen = 9; + + // Maximum length of values + uint32 maxValueLen = 10; + + // Maximum number of entries in a single transaction + uint32 maxTxEntries = 11; + + // If set to true, do not include commit timestamp in transaction headers + bool excludeCommitTime = 12; } message CreateDatabaseRequest { - string name = 1; - DatabaseNullableSettings settings = 2; - bool ifNotExists = 3; + // Database name + string name = 1; + + // Database settings + DatabaseNullableSettings settings = 2; + + // If set to true, do not fail if the database already exists + bool ifNotExists = 3; } message CreateDatabaseResponse { - string name = 1; - DatabaseNullableSettings settings = 2; - bool alreadyExisted = 3; + // Database name + string name = 1; + + // Current database settings + DatabaseNullableSettings settings = 2; + + // Set to true if given database already existed + bool alreadyExisted = 3; } message UpdateDatabaseRequest { - string database = 1; - DatabaseNullableSettings settings = 2; -} + // Database name + string database = 1; -message UpdateDatabaseResponse { // Reserved to reply with more advanced response later - string database = 1; - DatabaseNullableSettings settings = 2; + // Updated settings + DatabaseNullableSettings settings = 2; } -message DatabaseSettingsRequest { +// Reserved to reply with more advanced response later +message UpdateDatabaseResponse { + // Database name + string database = 1; + // Current database settings + DatabaseNullableSettings settings = 2; } +message DatabaseSettingsRequest {} + message DatabaseSettingsResponse { - string database = 1; - DatabaseNullableSettings settings = 2; + // Database name + string database = 1; + + // Database settings + DatabaseNullableSettings settings = 2; } message NullableUint32 { - uint32 value = 1; + uint32 value = 1; } message NullableUint64 { - uint64 value = 1; + uint64 value = 1; } message NullableFloat { - float value = 1; + float value = 1; } message NullableBool { - bool value = 1; + bool value = 1; } message NullableString { - string value = 1; + string value = 1; } message NullableMilliseconds { - int64 value = 1; + int64 value = 1; } message DatabaseNullableSettings { - ReplicationNullableSettings replicationSettings = 2; + // Replication settings + ReplicationNullableSettings replicationSettings = 2; + + // Max filesize on disk + NullableUint32 fileSize = 8; + + // Maximum length of keys + NullableUint32 maxKeyLen = 9; + + // Maximum length of values + NullableUint32 maxValueLen = 10; + + // Maximum number of entries in a single transaction + NullableUint32 maxTxEntries = 11; + + // If set to true, do not include commit timestamp in transaction headers + NullableBool excludeCommitTime = 12; + + // Maximum number of simultaneous commits prepared for write + NullableUint32 maxConcurrency = 13; + + // Maximum number of simultaneous IO writes + NullableUint32 maxIOConcurrency = 14; + + // Size of the cache for transaction logs + NullableUint32 txLogCacheSize = 15; + + // Maximum number of simultaneous value files opened + NullableUint32 vLogMaxOpenedFiles = 16; + + // Maximum number of simultaneous transaction log files opened + NullableUint32 txLogMaxOpenedFiles = 17; + + // Maximum number of simultaneous commit log files opened + NullableUint32 commitLogMaxOpenedFiles = 18; + + // Index settings + IndexNullableSettings indexSettings = 19; + + // Version of transaction header to use (limits available features) + NullableUint32 writeTxHeaderVersion = 20; + + // If set to true, automatically load the database when starting immudb (true by default) + NullableBool autoload = 21; - NullableUint32 fileSize = 8; - NullableUint32 maxKeyLen = 9; - NullableUint32 maxValueLen = 10; - NullableUint32 maxTxEntries = 11; + // Size of the pool of read buffers + NullableUint32 readTxPoolSize = 22; - NullableBool excludeCommitTime = 12; + // Fsync frequency during commit process + NullableMilliseconds syncFrequency = 23; - NullableUint32 maxConcurrency = 13; - NullableUint32 maxIOConcurrency = 14; + // Size of the in-memory buffer for write operations + NullableUint32 writeBufferSize = 24; - NullableUint32 txLogCacheSize = 15; - NullableUint32 vLogMaxOpenedFiles = 16; - NullableUint32 txLogMaxOpenedFiles = 17; - NullableUint32 commitLogMaxOpenedFiles = 18; + // Settings of Appendable Hash Tree + AHTNullableSettings ahtSettings = 25; - IndexNullableSettings indexSettings = 19; + // Maximum number of pre-committed transactions + NullableUint32 maxActiveTransactions = 26; - NullableUint32 writeTxHeaderVersion = 20; + // Limit the number of read entries per transaction + NullableUint32 mvccReadSetLimit = 27; - NullableBool autoload = 21; + // Size of the cache for value logs + NullableUint32 vLogCacheSize = 28; - NullableUint32 readTxPoolSize = 22; - - NullableMilliseconds syncFrequency = 23; - - NullableUint32 writeBufferSize = 24; + // Truncation settings + TruncationNullableSettings truncationSettings = 29; - AHTNullableSettings ahtSettings = 25; + // If set to true, values are stored together with the transaction header (true by default) + NullableBool embeddedValues = 30; + + // Enable file preallocation + NullableBool preallocFiles = 31; } message ReplicationNullableSettings { - NullableBool replica = 1; - NullableString masterDatabase = 2; - NullableString masterAddress = 3; - NullableUint32 masterPort = 4; - NullableString followerUsername = 5; - NullableString followerPassword = 6; + // If set to true, this database is replicating another database + NullableBool replica = 1; + + // Name of the database to replicate + NullableString primaryDatabase = 2; + + // Hostname of the immudb instance with database to replicate + NullableString primaryHost = 3; + + // Port of the immudb instance with database to replicate + NullableUint32 primaryPort = 4; + + // Username of the user with read access of the database to replicate + NullableString primaryUsername = 5; + + // Password of the user with read access of the database to replicate + NullableString primaryPassword = 6; + + // Enable synchronous replication + NullableBool syncReplication = 7; + + // Number of confirmations from synchronous replicas required to commit a transaction + NullableUint32 syncAcks = 8; + + // Maximum number of prefetched transactions + NullableUint32 prefetchTxBufferSize = 9; + + // Number of concurrent replications + NullableUint32 replicationCommitConcurrency = 10; + + // Allow precommitted transactions to be discarded if the replica diverges from the primary + NullableBool allowTxDiscarding = 11; + + // Disable integrity check when reading data during replication + NullableBool skipIntegrityCheck = 12; + + // Wait for indexing to be up to date during replication + NullableBool waitForIndexing = 13; +} + +message TruncationNullableSettings { + // Retention Period for data in the database + NullableMilliseconds retentionPeriod = 1; + + // Truncation Frequency for the database + NullableMilliseconds truncationFrequency = 2; } message IndexNullableSettings { - NullableUint32 flushThreshold = 1; - NullableUint32 syncThreshold = 2; - NullableUint32 cacheSize = 3; - NullableUint32 maxNodeSize = 4; - NullableUint32 maxActiveSnapshots = 5; - NullableUint64 renewSnapRootAfter = 6; - NullableUint32 compactionThld = 7; - NullableUint32 delayDuringCompaction = 8; - NullableUint32 nodesLogMaxOpenedFiles = 9; - NullableUint32 historyLogMaxOpenedFiles = 10; - NullableUint32 commitLogMaxOpenedFiles = 11; - NullableUint32 flushBufferSize = 12; - NullableFloat cleanupPercentage = 13; + // Number of new index entries between disk flushes + NullableUint32 flushThreshold = 1; + + // Number of new index entries between disk flushes with file sync + NullableUint32 syncThreshold = 2; + + // Size of the Btree node cache + NullableUint32 cacheSize = 3; + + // Max size of a single Btree node in bytes + NullableUint32 maxNodeSize = 4; + + // Maximum number of active btree snapshots + NullableUint32 maxActiveSnapshots = 5; + + // Time in milliseconds between the most recent DB snapshot is automatically renewed + NullableUint64 renewSnapRootAfter = 6; + + // Minimum number of updates entries in the btree to allow for full compaction + NullableUint32 compactionThld = 7; + + // Additional delay added during indexing when full compaction is in progress + NullableUint32 delayDuringCompaction = 8; + + // Maximum number of simultaneously opened nodes files + NullableUint32 nodesLogMaxOpenedFiles = 9; + + // Maximum number of simultaneously opened node history files + NullableUint32 historyLogMaxOpenedFiles = 10; + + // Maximum number of simultaneously opened commit log files + NullableUint32 commitLogMaxOpenedFiles = 11; + + // Size of the in-memory flush buffer (in bytes) + NullableUint32 flushBufferSize = 12; + + // Percentage of node files cleaned up during each flush + NullableFloat cleanupPercentage = 13; + + // Maximum number of transactions indexed together + NullableUint32 maxBulkSize = 14; + + // Maximum time waiting for more transactions to be committed and included into the same bulk + NullableMilliseconds bulkPreparationTimeout = 15; } message AHTNullableSettings { - NullableUint32 syncThreshold = 1; - NullableUint32 writeBufferSize = 2; + // Number of new leaves in the tree between synchronous flush to disk + NullableUint32 syncThreshold = 1; + + // Size of the in-memory write buffer + NullableUint32 writeBufferSize = 2; } message LoadDatabaseRequest { - string database = 1; - // may add createIfNotExist + // Database name + + string database = 1; + // may add createIfNotExist } message LoadDatabaseResponse { - string database = 1; - // may add setttings + // Database name + string database = 1; + // may add settings } message UnloadDatabaseRequest { - string database = 1; + // Database name + string database = 1; } message UnloadDatabaseResponse { - string database = 1; + // Database name + string database = 1; } message DeleteDatabaseRequest { - string database = 1; + // Database name + string database = 1; } message DeleteDatabaseResponse { - string database = 1; + // Database name + string database = 1; } message FlushIndexRequest { - float cleanupPercentage = 1; - bool synced = 2; + // Percentage of nodes file to cleanup during flush + float cleanupPercentage = 1; + + // If true, do a full disk sync after the flush + bool synced = 2; } message FlushIndexResponse { - string database = 1; + // Database name + string database = 1; } message Table { - string tableName = 1; + // Table name + string tableName = 1; } message SQLGetRequest { - string table = 1; - repeated SQLValue pkValues = 2; - uint64 atTx = 3; - uint64 sinceTx = 4; + // Table name + string table = 1; + + // Values of the primary key + repeated SQLValue pkValues = 2; + + // Id of the transaction at which the row was added / modified + uint64 atTx = 3; + + // If > 0, do not wait for the indexer to index all entries, only require entries up to sinceTx to be indexed + uint64 sinceTx = 4; } message VerifiableSQLGetRequest { - SQLGetRequest sqlGetRequest = 1; - uint64 proveSinceTx = 2; + // Data of row to query + SQLGetRequest sqlGetRequest = 1; + + // When generating the proof, generate consistency proof with state from this transaction + uint64 proveSinceTx = 2; } message SQLEntry { - uint64 tx = 1; - bytes key = 2; - bytes value = 3; - KVMetadata metadata = 4; + // Id of the transaction when the row was added / modified + uint64 tx = 1; + + // Raw key of the row + bytes key = 2; + + // Raw value of the row + bytes value = 3; + + // Metadata of the raw value + KVMetadata metadata = 4; } message VerifiableSQLEntry { - reserved 6; - SQLEntry sqlEntry = 1; - VerifiableTx verifiableTx = 2; - InclusionProof inclusionProof = 3; - uint32 DatabaseId = 4; - uint32 TableId = 5; - repeated uint32 PKIDs = 16; - map ColNamesById = 8; - map ColIdsByName = 9; - map ColTypesById = 10; - map ColLenById = 11; + reserved 6; + + // Raw row entry data + SQLEntry sqlEntry = 1; + + // Verifiable transaction of the row + VerifiableTx verifiableTx = 2; + + // Inclusion proof of the row in the transaction + InclusionProof inclusionProof = 3; + + // Internal ID of the database (used to validate raw entry values) + uint32 DatabaseId = 4; + + // Internal ID of the table (used to validate raw entry values) + uint32 TableId = 5; + + // Internal IDs of columns for the primary key (used to validate raw entry values) + repeated uint32 PKIDs = 16; + + // Mapping of used column IDs to their names + map ColNamesById = 8; + + // Mapping of column names to their IDS + map ColIdsByName = 9; + + // Mapping of column IDs to their types + map ColTypesById = 10; + + // Mapping of column IDs to their length constraints + map ColLenById = 11; + + // Variable is used to assign unique ids to new columns as they are created + uint32 MaxColId = 12; } -message UseDatabaseReply{ - string token = 1; +message UseDatabaseReply { + // Deprecated: database access token + string token = 1; } enum PermissionAction { - GRANT = 0; - REVOKE = 1; + // Grant permission + GRANT = 0; + + // Revoke permission + REVOKE = 1; } message ChangePermissionRequest { - PermissionAction action = 1; - string username = 2; - string database = 3; - uint32 permission = 4; + // Action to perform + PermissionAction action = 1; + + // Name of the user to update + string username = 2; + + // Name of the database + string database = 3; + + // Permission to grant / revoke: 1 - read only, 2 - read/write, 254 - admin + uint32 permission = 4; } message SetActiveUserRequest { - bool active = 1; - string username = 2; + // If true, the user is active + bool active = 1; + + // Name of the user to activate / deactivate + string username = 2; } message DatabaseListResponse { - repeated Database databases = 1; + // Database list + repeated Database databases = 1; } -message DatabaseListRequestV2 { -} +message DatabaseListRequestV2 {} message DatabaseListResponseV2 { - repeated DatabaseWithSettings databases = 1; + // Database list with current database settings + repeated DatabaseInfo databases = 1; } -message DatabaseWithSettings { - string name = 1; - DatabaseNullableSettings settings = 2; - bool loaded = 3; +message DatabaseInfo { + // Database name + string name = 1; + + // Current database settings + DatabaseNullableSettings settings = 2; + + // If true, this database is currently loaded into memory + bool loaded = 3; + + // database disk size + uint64 diskSize = 4; + + // total number of transactions + uint64 numTransactions = 5; } message Chunk { - bytes content = 1; + bytes content = 1; + map metadata = 2; } message UseSnapshotRequest { - uint64 sinceTx = 1; - uint64 asBeforeTx = 2; + uint64 sinceTx = 1; + uint64 asBeforeTx = 2; } message SQLExecRequest { - string sql = 1; - repeated NamedParam params = 2; - bool noWait = 3; + // SQL query + string sql = 1; + + // Named query parameters + repeated NamedParam params = 2; + + // If true, do not wait for the indexer to index written changes + bool noWait = 3; } message SQLQueryRequest { - string sql = 1; - repeated NamedParam params = 2; - bool reuseSnapshot = 3; + // SQL query + string sql = 1; + + // Named query parameters + repeated NamedParam params = 2; + + // If true, reuse previously opened snapshot + bool reuseSnapshot = 3 [deprecated = true]; + + // Wheter the client accepts a streaming response + bool acceptStream = 4; } message NamedParam { - string name = 1; - SQLValue value = 2; + // Parameter name + string name = 1; + + // Parameter value + SQLValue value = 2; } message SQLExecResult { - repeated CommittedSQLTx txs = 5; - bool ongoingTx = 6; + // List of committed transactions as a result of the exec operation + repeated CommittedSQLTx txs = 5; + + // If true, there's an ongoing transaction after exec completes + bool ongoingTx = 6; } message CommittedSQLTx { - TxHeader header = 1; - uint32 updatedRows = 2; - map lastInsertedPKs = 3; - map firstInsertedPKs = 4; + // Transaction header + TxHeader header = 1; + + // Number of updated rows + uint32 updatedRows = 2; + + // The value of last inserted auto_increment primary key (mapped by table name) + map lastInsertedPKs = 3; + + // The value of first inserted auto_increment primary key (mapped by table name) + map firstInsertedPKs = 4; } message SQLQueryResult { - repeated Column columns = 2; - repeated Row rows = 1; + // Result columns description + repeated Column columns = 2; + + // Result rows + repeated Row rows = 1; } message Column { - string name = 1; - string type = 2; + // Column name + string name = 1; + + // Column type + string type = 2; } message Row { - repeated string columns = 1; - repeated SQLValue values = 2; + // Column names + repeated string columns = 1; + + // Column values + repeated SQLValue values = 2; } message SQLValue { - oneof value { - google.protobuf.NullValue null = 1; - int64 n = 2; - string s = 3; - bool b = 4; - bytes bs = 5; - int64 ts = 6; - } + oneof value { + google.protobuf.NullValue null = 1; + int64 n = 2; + string s = 3; + bool b = 4; + bytes bs = 5; + int64 ts = 6; + double f = 7; + } } enum TxMode { - ReadOnly = 0; - WriteOnly = 1; - ReadWrite = 2; + // Read-only transaction + ReadOnly = 0; + + // Write-only transaction + WriteOnly = 1; + + // Read-write transaction + ReadWrite = 2; } message NewTxRequest { - TxMode mode = 1; + // Transaction mode + TxMode mode = 1; + // An existing snapshot may be reused as long as it includes the specified transaction + // If not specified it will include up to the latest precommitted transaction + NullableUint64 snapshotMustIncludeTxID = 2; + // An existing snapshot may be reused as long as it is not older than the specified timeframe + NullableMilliseconds snapshotRenewalPeriod = 3; + // Indexing may not be up to date when doing MVCC + bool unsafeMVCC = 4; } message NewTxResponse { - string transactionID = 1; + // Internal transaction ID + string transactionID = 1; } - - message ErrorInfo { - string code = 1; - string cause = 2; + // Error code + string code = 1; + + // Error Description + string cause = 2; } message DebugInfo { - string stack = 1; + // Stack trace when the error was noticed + string stack = 1; } message RetryInfo { - int32 retry_delay = 1; + // Number of milliseconds after which the request can be retried + int32 retry_delay = 1; +} + +message TruncateDatabaseRequest { + // Database name + string database = 1; + + // Retention Period of data + int64 retentionPeriod = 2; +} + +message TruncateDatabaseResponse { + // Database name + string database = 1; } // immudb gRPC & REST service service ImmuService { - rpc ListUsers (google.protobuf.Empty) returns (UserList){ - option (google.api.http) = { - get: "/user/list" - }; - }; - - rpc CreateUser (CreateUserRequest) returns (google.protobuf.Empty){ - option (google.api.http) = { - post: "/user" - body: "*" - }; - }; - - rpc ChangePassword (ChangePasswordRequest) returns (google.protobuf.Empty){ - option (google.api.http) = { - post: "/user/password/change" - body: "*" - }; - }; - - rpc ChangePermission(ChangePermissionRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/user/changepermission" - body: "*" - }; - } - - rpc SetActiveUser (SetActiveUserRequest) returns (google.protobuf.Empty){ - option (google.api.http) = { - post: "/user/setactiveUser" - body: "*" - }; - }; - - rpc UpdateAuthConfig (AuthConfig) returns (google.protobuf.Empty){ - option deprecated = true; - } // DEPRECATED - rpc UpdateMTLSConfig (MTLSConfig) returns (google.protobuf.Empty){ - option deprecated = true; - } // DEPRECATED - - rpc OpenSession (OpenSessionRequest) returns (OpenSessionResponse){}; - rpc CloseSession (google.protobuf.Empty) returns (google.protobuf.Empty){}; - rpc KeepAlive (google.protobuf.Empty) returns (google.protobuf.Empty){}; - - rpc NewTx (NewTxRequest) returns (NewTxResponse){}; - rpc Commit (google.protobuf.Empty) returns (CommittedSQLTx){}; - rpc Rollback (google.protobuf.Empty) returns (google.protobuf.Empty){}; - - rpc TxSQLExec(SQLExecRequest) returns (google.protobuf.Empty) {}; - rpc TxSQLQuery(SQLQueryRequest) returns (SQLQueryResult) {}; - - rpc Login (LoginRequest) returns (LoginResponse){ - option deprecated = true; - option (google.api.http) = { - post: "/login" - body: "*" - }; - }; - - rpc Logout (google.protobuf.Empty) returns (google.protobuf.Empty){ - option deprecated = true; - option (google.api.http) = { - post: "/logout" - body: "*" - }; - }; - - rpc Set (SetRequest) returns (TxHeader){ - option (google.api.http) = { - post: "/db/set" - body: "*" - }; - }; - - rpc VerifiableSet (VerifiableSetRequest) returns (VerifiableTx){ - option (google.api.http) = { - post: "/db/verifiable/set" - body: "*" - }; - }; - - rpc Get (KeyRequest) returns (Entry){ - option (google.api.http) = { - get: "/db/get/{key}" - }; - }; - - rpc VerifiableGet (VerifiableGetRequest) returns (VerifiableEntry){ - option (google.api.http) = { - post: "/db/verifiable/get" - body: "*" - }; - }; - - rpc Delete(DeleteKeysRequest) returns (TxHeader) { - option (google.api.http) = { - post: "/db/delete" - body: "*" - }; - } - - rpc GetAll (KeyListRequest) returns (Entries){ - option (google.api.http) = { - post: "/db/getall" - body: "*" - }; - }; - - rpc ExecAll (ExecAllRequest) returns (TxHeader) { - option (google.api.http) = { - post: "/db/execall" - body: "*" - }; - }; - - rpc Scan(ScanRequest) returns (Entries){ - option (google.api.http) = { - post: "/db/scan" - body: "*" - }; - }; - - // NOT YET SUPPORTED - rpc Count(KeyPrefix) returns (EntryCount){ - option (google.api.http) = { - get: "/db/count/{prefix}" - }; - }; - - // NOT YET SUPPORTED - rpc CountAll(google.protobuf.Empty) returns (EntryCount){ - option (google.api.http) = { - get: "/db/countall" - }; - }; - - rpc TxById(TxRequest) returns (Tx){ - option (google.api.http) = { - get: "/db/tx/{tx}" - }; - }; - - rpc VerifiableTxById(VerifiableTxRequest) returns (VerifiableTx){ - option (google.api.http) = { - get: "/db/verifiable/tx/{tx}" - }; - }; - - rpc TxScan(TxScanRequest) returns (TxList) { - option (google.api.http) = { - post: "/db/tx" - body: "*" - }; - } - - rpc History(HistoryRequest) returns (Entries){ - option (google.api.http) = { - post: "/db/history" - body: "*" - }; - }; - - // ServerInfo returns information about the server instance. - // ServerInfoRequest is defined for future extensions. - rpc ServerInfo (ServerInfoRequest) returns (ServerInfoResponse){ - option (google.api.http) = { - get: "/serverinfo" - }; - }; - - // DEPRECATED: Use ServerInfo - rpc Health (google.protobuf.Empty) returns (HealthResponse){ - option (google.api.http) = { - get: "/health" - }; - }; - - rpc DatabaseHealth (google.protobuf.Empty) returns (DatabaseHealthResponse){ - option (google.api.http) = { - get: "/db/health" - }; - }; - - rpc CurrentState (google.protobuf.Empty) returns (ImmutableState){ - option (google.api.http) = { - get: "/db/state" - }; - }; - - rpc SetReference (ReferenceRequest) returns (TxHeader){ - option (google.api.http) = { - post: "/db/setreference" - body: "*" - }; - }; - - rpc VerifiableSetReference (VerifiableReferenceRequest) returns (VerifiableTx){ - option (google.api.http) = { - post: "/db/verifiable/setreference" - body: "*" - }; - }; - - rpc ZAdd (ZAddRequest) returns (TxHeader){ - option (google.api.http) = { - post: "/db/zadd" - body: "*" - }; - }; - - rpc VerifiableZAdd (VerifiableZAddRequest) returns (VerifiableTx){ - option (google.api.http) = { - post: "/db/verifiable/zadd" - body: "*" - }; - }; - - rpc ZScan (ZScanRequest) returns (ZEntries){ - option (google.api.http) = { - post: "/db/zscan" - body: "*" - }; - }; - - // DEPRECATED: Use CreateDatabaseV2 - rpc CreateDatabase(Database) returns (google.protobuf.Empty) { - option deprecated = true; - option (google.api.http) = { - post: "/db/create" - body: "*" - }; - } - - // DEPRECATED: Use CreateDatabaseV2 - rpc CreateDatabaseWith(DatabaseSettings) returns (google.protobuf.Empty) { - option deprecated = true; - option (google.api.http) = { - post: "/db/createwith" - body: "*" - }; - } - - rpc CreateDatabaseV2(CreateDatabaseRequest) returns (CreateDatabaseResponse) { - option (google.api.http) = { - post: "/db/create/v2" - body: "*" - }; - } - - rpc LoadDatabase(LoadDatabaseRequest) returns (LoadDatabaseResponse) { - option (google.api.http) = { - post: "/db/load" - body: "*" - }; - } - - rpc UnloadDatabase(UnloadDatabaseRequest) returns (UnloadDatabaseResponse) { - option (google.api.http) = { - post: "/db/unload" - body: "*" - }; - } - - rpc DeleteDatabase(DeleteDatabaseRequest) returns (DeleteDatabaseResponse) { - option (google.api.http) = { - post: "/db/delete" - body: "*" - }; - } - - // DEPRECATED: Use DatabaseListV2 - rpc DatabaseList (google.protobuf.Empty) returns (DatabaseListResponse){ - option deprecated = true; - option (google.api.http) = { - post: "/db/list" - body: "*" - }; - }; - - rpc DatabaseListV2 (DatabaseListRequestV2) returns (DatabaseListResponseV2){ - option (google.api.http) = { - post: "/db/list/v2" - body: "*" - }; - }; - - rpc UseDatabase(Database) returns (UseDatabaseReply) { - option (google.api.http) = { - get: "/db/use/{databaseName}" - }; - } - - // DEPRECATED: Use UpdateDatabaseV2 - rpc UpdateDatabase(DatabaseSettings) returns (google.protobuf.Empty) { - option deprecated = true; - option (google.api.http) = { - post: "/db/update" - body: "*" - }; - } - - rpc UpdateDatabaseV2(UpdateDatabaseRequest) returns (UpdateDatabaseResponse) { - option (google.api.http) = { - post: "/db/update/v2" - body: "*" - }; - } - - // DEPRECATED: Use GetDatabaseSettingsV2 - rpc GetDatabaseSettings(google.protobuf.Empty) returns (DatabaseSettings) { - option deprecated = true; - option (google.api.http) = { - post: "/db/settings" - body: "*" - }; - } - - rpc GetDatabaseSettingsV2(DatabaseSettingsRequest) returns (DatabaseSettingsResponse) { - option (google.api.http) = { - post: "/db/settings/v2" - body: "*" - }; - } - - rpc FlushIndex(FlushIndexRequest) returns (FlushIndexResponse) { - option (google.api.http) = { - get: "/db/flushindex" - }; - } - - rpc CompactIndex(google.protobuf.Empty) returns (google.protobuf.Empty) { - option (google.api.http) = { - get: "/db/compactindex" - }; - } - - // Streams - rpc streamGet(KeyRequest) returns (stream Chunk) {}; - rpc streamSet(stream Chunk) returns (TxHeader) {}; - rpc streamVerifiableGet(VerifiableGetRequest) returns (stream Chunk) {}; - rpc streamVerifiableSet(stream Chunk) returns (VerifiableTx) {}; - rpc streamScan(ScanRequest) returns (stream Chunk) {}; - rpc streamZScan(ZScanRequest) returns (stream Chunk) {}; - rpc streamHistory(HistoryRequest) returns (stream Chunk) {}; - rpc streamExecAll(stream Chunk) returns (TxHeader) {}; - - // Replication - rpc exportTx(ExportTxRequest) returns (stream Chunk) {}; - rpc replicateTx(stream Chunk) returns (TxHeader) {}; - - rpc SQLExec(SQLExecRequest) returns (SQLExecResult) { - option (google.api.http) = { - post: "/db/sqlexec" - body: "*" - }; - }; - - rpc SQLQuery(SQLQueryRequest) returns (SQLQueryResult) { - option (google.api.http) = { - post: "/db/sqlquery" - body: "*" - }; - }; - - rpc ListTables(google.protobuf.Empty) returns (SQLQueryResult) { - option (google.api.http) = { - get: "/db/table/list" - }; - }; - - rpc DescribeTable(Table) returns (SQLQueryResult) { - option (google.api.http) = { - post: "/db/tables" - body: "*" - }; - }; - - rpc VerifiableSQLGet (VerifiableSQLGetRequest) returns (VerifiableSQLEntry){ - option (google.api.http) = { - post: "/db/verifiable/sqlget" - body: "*" - }; - }; + rpc ListUsers(google.protobuf.Empty) returns (UserList) { + option (google.api.http) = { + get: "/user/list" + }; + } + + rpc CreateUser(CreateUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/user" + body: "*" + }; + } + + rpc ChangePassword(ChangePasswordRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/user/password/change" + body: "*" + }; + } + + rpc ChangePermission(ChangePermissionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/user/changepermission" + body: "*" + }; + } + + rpc SetActiveUser(SetActiveUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/user/setactiveUser" + body: "*" + }; + } + + rpc UpdateAuthConfig(AuthConfig) returns (google.protobuf.Empty) { + option deprecated = true; + } // DEPRECATED + + rpc UpdateMTLSConfig(MTLSConfig) returns (google.protobuf.Empty) { + option deprecated = true; + } // DEPRECATED + + rpc OpenSession(OpenSessionRequest) returns (OpenSessionResponse) {} + + rpc CloseSession(google.protobuf.Empty) returns (google.protobuf.Empty) {} + + rpc KeepAlive(google.protobuf.Empty) returns (google.protobuf.Empty) {} + + rpc NewTx(NewTxRequest) returns (NewTxResponse) {} + + rpc Commit(google.protobuf.Empty) returns (CommittedSQLTx) {} + + rpc Rollback(google.protobuf.Empty) returns (google.protobuf.Empty) {} + + rpc TxSQLExec(SQLExecRequest) returns (google.protobuf.Empty) {} + + rpc TxSQLQuery(SQLQueryRequest) returns (stream SQLQueryResult) {} + + rpc Login(LoginRequest) returns (LoginResponse) { + option deprecated = true; + option (google.api.http) = { + post: "/login" + body: "*" + }; + } + + rpc Logout(google.protobuf.Empty) returns (google.protobuf.Empty) { + option deprecated = true; + option (google.api.http) = { + post: "/logout" + body: "*" + }; + } + + rpc Set(SetRequest) returns (TxHeader) { + option (google.api.http) = { + post: "/db/set" + body: "*" + }; + } + + rpc VerifiableSet(VerifiableSetRequest) returns (VerifiableTx) { + option (google.api.http) = { + post: "/db/verifiable/set" + body: "*" + }; + } + + rpc Get(KeyRequest) returns (Entry) { + option (google.api.http) = { + get: "/db/get/{key}" + }; + } + + rpc VerifiableGet(VerifiableGetRequest) returns (VerifiableEntry) { + option (google.api.http) = { + post: "/db/verifiable/get" + body: "*" + }; + } + + rpc Delete(DeleteKeysRequest) returns (TxHeader) { + option (google.api.http) = { + post: "/db/deletekey" + body: "*" + }; + } + + rpc GetAll(KeyListRequest) returns (Entries) { + option (google.api.http) = { + post: "/db/getall" + body: "*" + }; + } + + rpc ExecAll(ExecAllRequest) returns (TxHeader) { + option (google.api.http) = { + post: "/db/execall" + body: "*" + }; + } + + rpc Scan(ScanRequest) returns (Entries) { + option (google.api.http) = { + post: "/db/scan" + body: "*" + }; + } + + // NOT YET SUPPORTED + rpc Count(KeyPrefix) returns (EntryCount) { + option (google.api.http) = { + get: "/db/count/{prefix}" + }; + } + + // NOT YET SUPPORTED + rpc CountAll(google.protobuf.Empty) returns (EntryCount) { + option (google.api.http) = { + get: "/db/countall" + }; + } + + rpc TxById(TxRequest) returns (Tx) { + option (google.api.http) = { + get: "/db/tx/{tx}" + }; + } + + rpc VerifiableTxById(VerifiableTxRequest) returns (VerifiableTx) { + option (google.api.http) = { + get: "/db/verifiable/tx/{tx}" + }; + } + + rpc TxScan(TxScanRequest) returns (TxList) { + option (google.api.http) = { + post: "/db/tx" + body: "*" + }; + } + + rpc History(HistoryRequest) returns (Entries) { + option (google.api.http) = { + post: "/db/history" + body: "*" + }; + } + + // ServerInfo returns information about the server instance. + // ServerInfoRequest is defined for future extensions. + rpc ServerInfo(ServerInfoRequest) returns (ServerInfoResponse) { + option (google.api.http) = { + get: "/serverinfo" + }; + } + + // DEPRECATED: Use ServerInfo + rpc Health(google.protobuf.Empty) returns (HealthResponse) { + option (google.api.http) = { + get: "/health" + }; + } + + rpc DatabaseHealth(google.protobuf.Empty) returns (DatabaseHealthResponse) { + option (google.api.http) = { + get: "/db/health" + }; + } + + rpc CurrentState(google.protobuf.Empty) returns (ImmutableState) { + option (google.api.http) = { + get: "/db/state" + }; + } + + rpc SetReference(ReferenceRequest) returns (TxHeader) { + option (google.api.http) = { + post: "/db/setreference" + body: "*" + }; + } + + rpc VerifiableSetReference(VerifiableReferenceRequest) returns (VerifiableTx) { + option (google.api.http) = { + post: "/db/verifiable/setreference" + body: "*" + }; + } + + rpc ZAdd(ZAddRequest) returns (TxHeader) { + option (google.api.http) = { + post: "/db/zadd" + body: "*" + }; + } + + rpc VerifiableZAdd(VerifiableZAddRequest) returns (VerifiableTx) { + option (google.api.http) = { + post: "/db/verifiable/zadd" + body: "*" + }; + } + + rpc ZScan(ZScanRequest) returns (ZEntries) { + option (google.api.http) = { + post: "/db/zscan" + body: "*" + }; + } + + // DEPRECATED: Use CreateDatabaseV2 + rpc CreateDatabase(Database) returns (google.protobuf.Empty) { + option deprecated = true; + option (google.api.http) = { + post: "/db/create" + body: "*" + }; + } + + // DEPRECATED: Use CreateDatabaseV2 + rpc CreateDatabaseWith(DatabaseSettings) returns (google.protobuf.Empty) { + option deprecated = true; + option (google.api.http) = { + post: "/db/createwith" + body: "*" + }; + } + + rpc CreateDatabaseV2(CreateDatabaseRequest) returns (CreateDatabaseResponse) { + option (google.api.http) = { + post: "/db/create/v2" + body: "*" + }; + } + + rpc LoadDatabase(LoadDatabaseRequest) returns (LoadDatabaseResponse) { + option (google.api.http) = { + post: "/db/load" + body: "*" + }; + } + + rpc UnloadDatabase(UnloadDatabaseRequest) returns (UnloadDatabaseResponse) { + option (google.api.http) = { + post: "/db/unload" + body: "*" + }; + } + + rpc DeleteDatabase(DeleteDatabaseRequest) returns (DeleteDatabaseResponse) { + option (google.api.http) = { + post: "/db/delete" + body: "*" + }; + } + + // DEPRECATED: Use DatabaseListV2 + rpc DatabaseList(google.protobuf.Empty) returns (DatabaseListResponse) { + option deprecated = true; + option (google.api.http) = { + post: "/db/list" + body: "*" + }; + } + + rpc DatabaseListV2(DatabaseListRequestV2) returns (DatabaseListResponseV2) { + option (google.api.http) = { + post: "/db/list/v2" + body: "*" + }; + } + + rpc UseDatabase(Database) returns (UseDatabaseReply) { + option (google.api.http) = { + get: "/db/use/{databaseName}" + }; + } + + // DEPRECATED: Use UpdateDatabaseV2 + rpc UpdateDatabase(DatabaseSettings) returns (google.protobuf.Empty) { + option deprecated = true; + option (google.api.http) = { + post: "/db/update" + body: "*" + }; + } + + rpc UpdateDatabaseV2(UpdateDatabaseRequest) returns (UpdateDatabaseResponse) { + option (google.api.http) = { + post: "/db/update/v2" + body: "*" + }; + } + + // DEPRECATED: Use GetDatabaseSettingsV2 + rpc GetDatabaseSettings(google.protobuf.Empty) returns (DatabaseSettings) { + option deprecated = true; + option (google.api.http) = { + post: "/db/settings" + body: "*" + }; + } + + rpc GetDatabaseSettingsV2(DatabaseSettingsRequest) returns (DatabaseSettingsResponse) { + option (google.api.http) = { + post: "/db/settings/v2" + body: "*" + }; + } + + rpc FlushIndex(FlushIndexRequest) returns (FlushIndexResponse) { + option (google.api.http) = { + get: "/db/flushindex" + }; + } + + rpc CompactIndex(google.protobuf.Empty) returns (google.protobuf.Empty) { + option (google.api.http) = { + get: "/db/compactindex" + }; + } + + // Streams + rpc streamGet(KeyRequest) returns (stream Chunk) {} + + rpc streamSet(stream Chunk) returns (TxHeader) {} + + rpc streamVerifiableGet(VerifiableGetRequest) returns (stream Chunk) {} + + rpc streamVerifiableSet(stream Chunk) returns (VerifiableTx) {} + + rpc streamScan(ScanRequest) returns (stream Chunk) {} + + rpc streamZScan(ZScanRequest) returns (stream Chunk) {} + + rpc streamHistory(HistoryRequest) returns (stream Chunk) {} + + rpc streamExecAll(stream Chunk) returns (TxHeader) {} + + // Replication + rpc exportTx(ExportTxRequest) returns (stream Chunk) {} + + rpc replicateTx(stream Chunk) returns (TxHeader) {} + + rpc streamExportTx(stream ExportTxRequest) returns (stream Chunk) {} + + rpc SQLExec(SQLExecRequest) returns (SQLExecResult) { + option (google.api.http) = { + post: "/db/sqlexec" + body: "*" + }; + } + + // For backward compatibility with the grpc-gateway API + rpc UnarySQLQuery(SQLQueryRequest) returns (SQLQueryResult) { + option (google.api.http) = { + post: "/db/sqlquery" + body: "*" + }; + } + + rpc SQLQuery(SQLQueryRequest) returns (stream SQLQueryResult) { + option (google.api.http) = { + post: "/db/sqlquery" + body: "*" + }; + } + + rpc ListTables(google.protobuf.Empty) returns (SQLQueryResult) { + option (google.api.http) = { + get: "/db/table/list" + }; + } + + rpc DescribeTable(Table) returns (SQLQueryResult) { + option (google.api.http) = { + post: "/db/tables" + body: "*" + }; + } + + rpc VerifiableSQLGet(VerifiableSQLGetRequest) returns (VerifiableSQLEntry) { + option (google.api.http) = { + post: "/db/verifiable/sqlget" + body: "*" + }; + } + + rpc TruncateDatabase(TruncateDatabaseRequest) returns (TruncateDatabaseResponse) { + option (google.api.http) = { + post: "/db/truncate" + body: "*" + }; + } } diff --git a/immudb/grpc/schema_pb2.py b/immudb/grpc/schema_pb2.py index dcb9ce2..150f55a 100644 --- a/immudb/grpc/schema_pb2.py +++ b/immudb/grpc/schema_pb2.py @@ -17,7 +17,7 @@ from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cschema.proto\x12\rimmudb.schema\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1cgoogle/protobuf/struct.proto\"\x12\n\x03Key\x12\x0b\n\x03key\x18\x01 \x01(\x0c\"2\n\nPermission\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\x12\x12\n\npermission\x18\x02 \x01(\r\"z\n\x04User\x12\x0c\n\x04user\x18\x01 \x01(\x0c\x12.\n\x0bpermissions\x18\x03 \x03(\x0b\x32\x19.immudb.schema.Permission\x12\x11\n\tcreatedby\x18\x04 \x01(\t\x12\x11\n\tcreatedat\x18\x05 \x01(\t\x12\x0e\n\x06\x61\x63tive\x18\x06 \x01(\x08\".\n\x08UserList\x12\"\n\x05users\x18\x01 \x03(\x0b\x32\x13.immudb.schema.User\"Y\n\x11\x43reateUserRequest\x12\x0c\n\x04user\x18\x01 \x01(\x0c\x12\x10\n\x08password\x18\x02 \x01(\x0c\x12\x12\n\npermission\x18\x03 \x01(\r\x12\x10\n\x08\x64\x61tabase\x18\x04 \x01(\t\"\x1b\n\x0bUserRequest\x12\x0c\n\x04user\x18\x01 \x01(\x0c\"O\n\x15\x43hangePasswordRequest\x12\x0c\n\x04user\x18\x01 \x01(\x0c\x12\x13\n\x0boldPassword\x18\x02 \x01(\x0c\x12\x13\n\x0bnewPassword\x18\x03 \x01(\x0c\".\n\x0cLoginRequest\x12\x0c\n\x04user\x18\x01 \x01(\x0c\x12\x10\n\x08password\x18\x02 \x01(\x0c\"/\n\rLoginResponse\x12\r\n\x05token\x18\x01 \x01(\t\x12\x0f\n\x07warning\x18\x02 \x01(\x0c\"\x1a\n\nAuthConfig\x12\x0c\n\x04kind\x18\x01 \x01(\r\"\x1d\n\nMTLSConfig\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\"N\n\x12OpenSessionRequest\x12\x10\n\x08username\x18\x01 \x01(\x0c\x12\x10\n\x08password\x18\x02 \x01(\x0c\x12\x14\n\x0c\x64\x61tabaseName\x18\x03 \x01(\t\"<\n\x13OpenSessionResponse\x12\x11\n\tsessionID\x18\x01 \x01(\t\x12\x12\n\nserverUUID\x18\x02 \x01(\t\"\xb5\x03\n\x0cPrecondition\x12L\n\x0ckeyMustExist\x18\x01 \x01(\x0b\x32\x34.immudb.schema.Precondition.KeyMustExistPreconditionH\x00\x12R\n\x0fkeyMustNotExist\x18\x02 \x01(\x0b\x32\x37.immudb.schema.Precondition.KeyMustNotExistPreconditionH\x00\x12^\n\x15keyNotModifiedAfterTX\x18\x03 \x01(\x0b\x32=.immudb.schema.Precondition.KeyNotModifiedAfterTXPreconditionH\x00\x1a\'\n\x18KeyMustExistPrecondition\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x1a*\n\x1bKeyMustNotExistPrecondition\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x1a>\n!KeyNotModifiedAfterTXPrecondition\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12\x0c\n\x04txID\x18\x02 \x01(\x04\x42\x0e\n\x0cprecondition\"S\n\x08KeyValue\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12\r\n\x05value\x18\x02 \x01(\x0c\x12+\n\x08metadata\x18\x03 \x01(\x0b\x32\x19.immudb.schema.KVMetadata\"\xaf\x01\n\x05\x45ntry\x12\n\n\x02tx\x18\x01 \x01(\x04\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12\r\n\x05value\x18\x03 \x01(\x0c\x12.\n\x0creferencedBy\x18\x04 \x01(\x0b\x32\x18.immudb.schema.Reference\x12+\n\x08metadata\x18\x05 \x01(\x0b\x32\x19.immudb.schema.KVMetadata\x12\x0f\n\x07\x65xpired\x18\x06 \x01(\x08\x12\x10\n\x08revision\x18\x07 \x01(\x04\"q\n\tReference\x12\n\n\x02tx\x18\x01 \x01(\x04\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12\x0c\n\x04\x61tTx\x18\x03 \x01(\x04\x12+\n\x08metadata\x18\x04 \x01(\x0b\x32\x19.immudb.schema.KVMetadata\x12\x10\n\x08revision\x18\x05 \x01(\x04\"\x94\x01\n\x02Op\x12%\n\x02kv\x18\x01 \x01(\x0b\x32\x17.immudb.schema.KeyValueH\x00\x12*\n\x04zAdd\x18\x02 \x01(\x0b\x32\x1a.immudb.schema.ZAddRequestH\x00\x12.\n\x03ref\x18\x03 \x01(\x0b\x32\x1f.immudb.schema.ReferenceRequestH\x00\x42\x0b\n\toperation\"{\n\x0e\x45xecAllRequest\x12%\n\nOperations\x18\x01 \x03(\x0b\x32\x11.immudb.schema.Op\x12\x0e\n\x06noWait\x18\x02 \x01(\x08\x12\x32\n\rpreconditions\x18\x03 \x03(\x0b\x32\x1b.immudb.schema.Precondition\"0\n\x07\x45ntries\x12%\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x14.immudb.schema.Entry\"d\n\x06ZEntry\x12\x0b\n\x03set\x18\x01 \x01(\x0c\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12#\n\x05\x65ntry\x18\x03 \x01(\x0b\x32\x14.immudb.schema.Entry\x12\r\n\x05score\x18\x04 \x01(\x01\x12\x0c\n\x04\x61tTx\x18\x05 \x01(\x04\"2\n\x08ZEntries\x12&\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x15.immudb.schema.ZEntry\"\xb9\x01\n\x0bScanRequest\x12\x0f\n\x07seekKey\x18\x01 \x01(\x0c\x12\x0e\n\x06\x65ndKey\x18\x07 \x01(\x0c\x12\x0e\n\x06prefix\x18\x02 \x01(\x0c\x12\x0c\n\x04\x64\x65sc\x18\x03 \x01(\x08\x12\r\n\x05limit\x18\x04 \x01(\x04\x12\x0f\n\x07sinceTx\x18\x05 \x01(\x04\x12\x0e\n\x06noWait\x18\x06 \x01(\x08\x12\x15\n\rinclusiveSeek\x18\x08 \x01(\x08\x12\x14\n\x0cinclusiveEnd\x18\t \x01(\x08\x12\x0e\n\x06offset\x18\n \x01(\x04\"\x1b\n\tKeyPrefix\x12\x0e\n\x06prefix\x18\x01 \x01(\x0c\"\x1b\n\nEntryCount\x12\r\n\x05\x63ount\x18\x01 \x01(\x04\"1\n\tSignature\x12\x11\n\tpublicKey\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\"\xaf\x01\n\x08TxHeader\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x0f\n\x07prevAlh\x18\x02 \x01(\x0c\x12\n\n\x02ts\x18\x03 \x01(\x03\x12\x10\n\x08nentries\x18\x04 \x01(\x05\x12\n\n\x02\x65H\x18\x05 \x01(\x0c\x12\x0e\n\x06\x62lTxId\x18\x06 \x01(\x04\x12\x0e\n\x06\x62lRoot\x18\x07 \x01(\x0c\x12\x0f\n\x07version\x18\x08 \x01(\x05\x12+\n\x08metadata\x18\t \x01(\x0b\x32\x19.immudb.schema.TxMetadata\"\x0c\n\nTxMetadata\"D\n\x0bLinearProof\x12\x12\n\nsourceTxId\x18\x01 \x01(\x04\x12\x12\n\nTargetTxId\x18\x02 \x01(\x04\x12\r\n\x05terms\x18\x03 \x03(\x0c\"\x83\x02\n\tDualProof\x12/\n\x0esourceTxHeader\x18\x01 \x01(\x0b\x32\x17.immudb.schema.TxHeader\x12/\n\x0etargetTxHeader\x18\x02 \x01(\x0b\x32\x17.immudb.schema.TxHeader\x12\x16\n\x0einclusionProof\x18\x03 \x03(\x0c\x12\x18\n\x10\x63onsistencyProof\x18\x04 \x03(\x0c\x12\x15\n\rtargetBlTxAlh\x18\x05 \x01(\x0c\x12\x1a\n\x12lastInclusionProof\x18\x06 \x03(\x0c\x12/\n\x0blinearProof\x18\x07 \x01(\x0b\x32\x1a.immudb.schema.LinearProof\"\xa8\x01\n\x02Tx\x12\'\n\x06header\x18\x01 \x01(\x0b\x32\x17.immudb.schema.TxHeader\x12\'\n\x07\x65ntries\x18\x02 \x03(\x0b\x32\x16.immudb.schema.TxEntry\x12\'\n\tkvEntries\x18\x03 \x03(\x0b\x32\x14.immudb.schema.Entry\x12\'\n\x08zEntries\x18\x04 \x03(\x0b\x32\x15.immudb.schema.ZEntry\"p\n\x07TxEntry\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12\x0e\n\x06hValue\x18\x02 \x01(\x0c\x12\x0c\n\x04vLen\x18\x03 \x01(\x05\x12+\n\x08metadata\x18\x04 \x01(\x0b\x32\x19.immudb.schema.KVMetadata\x12\r\n\x05value\x18\x05 \x01(\x0c\"b\n\nKVMetadata\x12\x0f\n\x07\x64\x65leted\x18\x01 \x01(\x08\x12-\n\nexpiration\x18\x02 \x01(\x0b\x32\x19.immudb.schema.Expiration\x12\x14\n\x0cnonIndexable\x18\x03 \x01(\x08\"\x1f\n\nExpiration\x12\x11\n\texpiresAt\x18\x01 \x01(\x03\"\x87\x01\n\x0cVerifiableTx\x12\x1d\n\x02tx\x18\x01 \x01(\x0b\x32\x11.immudb.schema.Tx\x12+\n\tdualProof\x18\x02 \x01(\x0b\x32\x18.immudb.schema.DualProof\x12+\n\tsignature\x18\x03 \x01(\x0b\x32\x18.immudb.schema.Signature\"\xa0\x01\n\x0fVerifiableEntry\x12#\n\x05\x65ntry\x18\x01 \x01(\x0b\x32\x14.immudb.schema.Entry\x12\x31\n\x0cverifiableTx\x18\x02 \x01(\x0b\x32\x1b.immudb.schema.VerifiableTx\x12\x35\n\x0einclusionProof\x18\x03 \x01(\x0b\x32\x1d.immudb.schema.InclusionProof\"<\n\x0eInclusionProof\x12\x0c\n\x04leaf\x18\x01 \x01(\x05\x12\r\n\x05width\x18\x02 \x01(\x05\x12\r\n\x05terms\x18\x03 \x03(\x0c\"v\n\nSetRequest\x12$\n\x03KVs\x18\x01 \x03(\x0b\x32\x17.immudb.schema.KeyValue\x12\x0e\n\x06noWait\x18\x02 \x01(\x08\x12\x32\n\rpreconditions\x18\x03 \x03(\x0b\x32\x1b.immudb.schema.Precondition\"\\\n\nKeyRequest\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12\x0c\n\x04\x61tTx\x18\x02 \x01(\x04\x12\x0f\n\x07sinceTx\x18\x03 \x01(\x04\x12\x0e\n\x06noWait\x18\x04 \x01(\x08\x12\x12\n\natRevision\x18\x05 \x01(\x03\"/\n\x0eKeyListRequest\x12\x0c\n\x04keys\x18\x01 \x03(\x0c\x12\x0f\n\x07sinceTx\x18\x02 \x01(\x04\"B\n\x11\x44\x65leteKeysRequest\x12\x0c\n\x04keys\x18\x01 \x03(\x0c\x12\x0f\n\x07sinceTx\x18\x02 \x01(\x04\x12\x0e\n\x06noWait\x18\x03 \x01(\x08\"[\n\x14VerifiableSetRequest\x12-\n\nsetRequest\x18\x01 \x01(\x0b\x32\x19.immudb.schema.SetRequest\x12\x14\n\x0cproveSinceTx\x18\x02 \x01(\x04\"[\n\x14VerifiableGetRequest\x12-\n\nkeyRequest\x18\x01 \x01(\x0b\x32\x19.immudb.schema.KeyRequest\x12\x14\n\x0cproveSinceTx\x18\x02 \x01(\x04\"\x13\n\x11ServerInfoRequest\"%\n\x12ServerInfoResponse\x12\x0f\n\x07version\x18\x01 \x01(\t\"1\n\x0eHealthResponse\x12\x0e\n\x06status\x18\x01 \x01(\x08\x12\x0f\n\x07version\x18\x02 \x01(\t\"Q\n\x16\x44\x61tabaseHealthResponse\x12\x17\n\x0fpendingRequests\x18\x01 \x01(\r\x12\x1e\n\x16lastRequestCompletedAt\x18\x02 \x01(\x03\"g\n\x0eImmutableState\x12\n\n\x02\x64\x62\x18\x01 \x01(\t\x12\x0c\n\x04txId\x18\x02 \x01(\x04\x12\x0e\n\x06txHash\x18\x03 \x01(\x0c\x12+\n\tsignature\x18\x04 \x01(\x0b\x32\x18.immudb.schema.Signature\"\x9a\x01\n\x10ReferenceRequest\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12\x15\n\rreferencedKey\x18\x02 \x01(\x0c\x12\x0c\n\x04\x61tTx\x18\x03 \x01(\x04\x12\x10\n\x08\x62oundRef\x18\x04 \x01(\x08\x12\x0e\n\x06noWait\x18\x05 \x01(\x08\x12\x32\n\rpreconditions\x18\x06 \x03(\x0b\x32\x1b.immudb.schema.Precondition\"m\n\x1aVerifiableReferenceRequest\x12\x39\n\x10referenceRequest\x18\x01 \x01(\x0b\x32\x1f.immudb.schema.ReferenceRequest\x12\x14\n\x0cproveSinceTx\x18\x02 \x01(\x04\"f\n\x0bZAddRequest\x12\x0b\n\x03set\x18\x01 \x01(\x0c\x12\r\n\x05score\x18\x02 \x01(\x01\x12\x0b\n\x03key\x18\x03 \x01(\x0c\x12\x0c\n\x04\x61tTx\x18\x04 \x01(\x04\x12\x10\n\x08\x62oundRef\x18\x05 \x01(\x08\x12\x0e\n\x06noWait\x18\x06 \x01(\x08\"\x16\n\x05Score\x12\r\n\x05score\x18\x01 \x01(\x01\"\x86\x02\n\x0cZScanRequest\x12\x0b\n\x03set\x18\x01 \x01(\x0c\x12\x0f\n\x07seekKey\x18\x02 \x01(\x0c\x12\x11\n\tseekScore\x18\x03 \x01(\x01\x12\x10\n\x08seekAtTx\x18\x04 \x01(\x04\x12\x15\n\rinclusiveSeek\x18\x05 \x01(\x08\x12\r\n\x05limit\x18\x06 \x01(\x04\x12\x0c\n\x04\x64\x65sc\x18\x07 \x01(\x08\x12&\n\x08minScore\x18\x08 \x01(\x0b\x32\x14.immudb.schema.Score\x12&\n\x08maxScore\x18\t \x01(\x0b\x32\x14.immudb.schema.Score\x12\x0f\n\x07sinceTx\x18\n \x01(\x04\x12\x0e\n\x06noWait\x18\x0b \x01(\x08\x12\x0e\n\x06offset\x18\x0c \x01(\x04\"[\n\x0eHistoryRequest\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12\x0e\n\x06offset\x18\x02 \x01(\x04\x12\r\n\x05limit\x18\x03 \x01(\x05\x12\x0c\n\x04\x64\x65sc\x18\x04 \x01(\x08\x12\x0f\n\x07sinceTx\x18\x05 \x01(\x04\"^\n\x15VerifiableZAddRequest\x12/\n\x0bzAddRequest\x18\x01 \x01(\x0b\x32\x1a.immudb.schema.ZAddRequest\x12\x14\n\x0cproveSinceTx\x18\x02 \x01(\x04\"\x8b\x01\n\tTxRequest\x12\n\n\x02tx\x18\x01 \x01(\x04\x12/\n\x0b\x65ntriesSpec\x18\x02 \x01(\x0b\x32\x1a.immudb.schema.EntriesSpec\x12\x0f\n\x07sinceTx\x18\x03 \x01(\x04\x12\x0e\n\x06noWait\x18\x04 \x01(\x08\x12 \n\x18keepReferencesUnresolved\x18\x05 \x01(\x08\"\xac\x01\n\x0b\x45ntriesSpec\x12\x33\n\rkvEntriesSpec\x18\x01 \x01(\x0b\x32\x1c.immudb.schema.EntryTypeSpec\x12\x32\n\x0czEntriesSpec\x18\x02 \x01(\x0b\x32\x1c.immudb.schema.EntryTypeSpec\x12\x34\n\x0esqlEntriesSpec\x18\x03 \x01(\x0b\x32\x1c.immudb.schema.EntryTypeSpec\"?\n\rEntryTypeSpec\x12.\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x1e.immudb.schema.EntryTypeAction\"\xab\x01\n\x13VerifiableTxRequest\x12\n\n\x02tx\x18\x01 \x01(\x04\x12\x14\n\x0cproveSinceTx\x18\x02 \x01(\x04\x12/\n\x0b\x65ntriesSpec\x18\x03 \x01(\x0b\x32\x1a.immudb.schema.EntriesSpec\x12\x0f\n\x07sinceTx\x18\x04 \x01(\x04\x12\x0e\n\x06noWait\x18\x05 \x01(\x08\x12 \n\x18keepReferencesUnresolved\x18\x06 \x01(\x08\"\x91\x01\n\rTxScanRequest\x12\x11\n\tinitialTx\x18\x01 \x01(\x04\x12\r\n\x05limit\x18\x02 \x01(\r\x12\x0c\n\x04\x64\x65sc\x18\x03 \x01(\x08\x12/\n\x0b\x65ntriesSpec\x18\x04 \x01(\x0b\x32\x1a.immudb.schema.EntriesSpec\x12\x0f\n\x07sinceTx\x18\x05 \x01(\x04\x12\x0e\n\x06noWait\x18\x06 \x01(\x08\"(\n\x06TxList\x12\x1e\n\x03txs\x18\x01 \x03(\x0b\x32\x11.immudb.schema.Tx\"\x1d\n\x0f\x45xportTxRequest\x12\n\n\x02tx\x18\x01 \x01(\x04\" \n\x08\x44\x61tabase\x12\x14\n\x0c\x64\x61tabaseName\x18\x01 \x01(\t\"\x9b\x02\n\x10\x44\x61tabaseSettings\x12\x14\n\x0c\x64\x61tabaseName\x18\x01 \x01(\t\x12\x0f\n\x07replica\x18\x02 \x01(\x08\x12\x16\n\x0emasterDatabase\x18\x03 \x01(\t\x12\x15\n\rmasterAddress\x18\x04 \x01(\t\x12\x12\n\nmasterPort\x18\x05 \x01(\r\x12\x18\n\x10\x66ollowerUsername\x18\x06 \x01(\t\x12\x18\n\x10\x66ollowerPassword\x18\x07 \x01(\t\x12\x10\n\x08\x66ileSize\x18\x08 \x01(\r\x12\x11\n\tmaxKeyLen\x18\t \x01(\r\x12\x13\n\x0bmaxValueLen\x18\n \x01(\r\x12\x14\n\x0cmaxTxEntries\x18\x0b \x01(\r\x12\x19\n\x11\x65xcludeCommitTime\x18\x0c \x01(\x08\"u\n\x15\x43reateDatabaseRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x39\n\x08settings\x18\x02 \x01(\x0b\x32\'.immudb.schema.DatabaseNullableSettings\x12\x13\n\x0bifNotExists\x18\x03 \x01(\x08\"y\n\x16\x43reateDatabaseResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x39\n\x08settings\x18\x02 \x01(\x0b\x32\'.immudb.schema.DatabaseNullableSettings\x12\x16\n\x0e\x61lreadyExisted\x18\x03 \x01(\x08\"d\n\x15UpdateDatabaseRequest\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\x12\x39\n\x08settings\x18\x02 \x01(\x0b\x32\'.immudb.schema.DatabaseNullableSettings\"e\n\x16UpdateDatabaseResponse\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\x12\x39\n\x08settings\x18\x02 \x01(\x0b\x32\'.immudb.schema.DatabaseNullableSettings\"\x19\n\x17\x44\x61tabaseSettingsRequest\"g\n\x18\x44\x61tabaseSettingsResponse\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\x12\x39\n\x08settings\x18\x02 \x01(\x0b\x32\'.immudb.schema.DatabaseNullableSettings\"\x1f\n\x0eNullableUint32\x12\r\n\x05value\x18\x01 \x01(\r\"\x1f\n\x0eNullableUint64\x12\r\n\x05value\x18\x01 \x01(\x04\"\x1e\n\rNullableFloat\x12\r\n\x05value\x18\x01 \x01(\x02\"\x1d\n\x0cNullableBool\x12\r\n\x05value\x18\x01 \x01(\x08\"\x1f\n\x0eNullableString\x12\r\n\x05value\x18\x01 \x01(\t\"%\n\x14NullableMilliseconds\x12\r\n\x05value\x18\x01 \x01(\x03\"\xd2\x08\n\x18\x44\x61tabaseNullableSettings\x12G\n\x13replicationSettings\x18\x02 \x01(\x0b\x32*.immudb.schema.ReplicationNullableSettings\x12/\n\x08\x66ileSize\x18\x08 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x30\n\tmaxKeyLen\x18\t \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x32\n\x0bmaxValueLen\x18\n \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x33\n\x0cmaxTxEntries\x18\x0b \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x36\n\x11\x65xcludeCommitTime\x18\x0c \x01(\x0b\x32\x1b.immudb.schema.NullableBool\x12\x35\n\x0emaxConcurrency\x18\r \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x37\n\x10maxIOConcurrency\x18\x0e \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x35\n\x0etxLogCacheSize\x18\x0f \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x39\n\x12vLogMaxOpenedFiles\x18\x10 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12:\n\x13txLogMaxOpenedFiles\x18\x11 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12>\n\x17\x63ommitLogMaxOpenedFiles\x18\x12 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12;\n\rindexSettings\x18\x13 \x01(\x0b\x32$.immudb.schema.IndexNullableSettings\x12;\n\x14writeTxHeaderVersion\x18\x14 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12-\n\x08\x61utoload\x18\x15 \x01(\x0b\x32\x1b.immudb.schema.NullableBool\x12\x35\n\x0ereadTxPoolSize\x18\x16 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12:\n\rsyncFrequency\x18\x17 \x01(\x0b\x32#.immudb.schema.NullableMilliseconds\x12\x36\n\x0fwriteBufferSize\x18\x18 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x37\n\x0b\x61htSettings\x18\x19 \x01(\x0b\x32\".immudb.schema.AHTNullableSettings\"\xdd\x02\n\x1bReplicationNullableSettings\x12,\n\x07replica\x18\x01 \x01(\x0b\x32\x1b.immudb.schema.NullableBool\x12\x35\n\x0emasterDatabase\x18\x02 \x01(\x0b\x32\x1d.immudb.schema.NullableString\x12\x34\n\rmasterAddress\x18\x03 \x01(\x0b\x32\x1d.immudb.schema.NullableString\x12\x31\n\nmasterPort\x18\x04 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x37\n\x10\x66ollowerUsername\x18\x05 \x01(\x0b\x32\x1d.immudb.schema.NullableString\x12\x37\n\x10\x66ollowerPassword\x18\x06 \x01(\x0b\x32\x1d.immudb.schema.NullableString\"\x86\x06\n\x15IndexNullableSettings\x12\x35\n\x0e\x66lushThreshold\x18\x01 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x34\n\rsyncThreshold\x18\x02 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x30\n\tcacheSize\x18\x03 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x32\n\x0bmaxNodeSize\x18\x04 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x39\n\x12maxActiveSnapshots\x18\x05 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x39\n\x12renewSnapRootAfter\x18\x06 \x01(\x0b\x32\x1d.immudb.schema.NullableUint64\x12\x35\n\x0e\x63ompactionThld\x18\x07 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12<\n\x15\x64\x65layDuringCompaction\x18\x08 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12=\n\x16nodesLogMaxOpenedFiles\x18\t \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12?\n\x18historyLogMaxOpenedFiles\x18\n \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12>\n\x17\x63ommitLogMaxOpenedFiles\x18\x0b \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x36\n\x0f\x66lushBufferSize\x18\x0c \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x37\n\x11\x63leanupPercentage\x18\r \x01(\x0b\x32\x1c.immudb.schema.NullableFloat\"\x83\x01\n\x13\x41HTNullableSettings\x12\x34\n\rsyncThreshold\x18\x01 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x36\n\x0fwriteBufferSize\x18\x02 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\"\'\n\x13LoadDatabaseRequest\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\"(\n\x14LoadDatabaseResponse\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\")\n\x15UnloadDatabaseRequest\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\"*\n\x16UnloadDatabaseResponse\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\")\n\x15\x44\x65leteDatabaseRequest\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\"*\n\x16\x44\x65leteDatabaseResponse\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\">\n\x11\x46lushIndexRequest\x12\x19\n\x11\x63leanupPercentage\x18\x01 \x01(\x02\x12\x0e\n\x06synced\x18\x02 \x01(\x08\"&\n\x12\x46lushIndexResponse\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\"\x1a\n\x05Table\x12\x11\n\ttableName\x18\x01 \x01(\t\"h\n\rSQLGetRequest\x12\r\n\x05table\x18\x01 \x01(\t\x12)\n\x08pkValues\x18\x02 \x03(\x0b\x32\x17.immudb.schema.SQLValue\x12\x0c\n\x04\x61tTx\x18\x03 \x01(\x04\x12\x0f\n\x07sinceTx\x18\x04 \x01(\x04\"d\n\x17VerifiableSQLGetRequest\x12\x33\n\rsqlGetRequest\x18\x01 \x01(\x0b\x32\x1c.immudb.schema.SQLGetRequest\x12\x14\n\x0cproveSinceTx\x18\x02 \x01(\x04\"_\n\x08SQLEntry\x12\n\n\x02tx\x18\x01 \x01(\x04\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12\r\n\x05value\x18\x03 \x01(\x0c\x12+\n\x08metadata\x18\x04 \x01(\x0b\x32\x19.immudb.schema.KVMetadata\"\xdd\x05\n\x12VerifiableSQLEntry\x12)\n\x08sqlEntry\x18\x01 \x01(\x0b\x32\x17.immudb.schema.SQLEntry\x12\x31\n\x0cverifiableTx\x18\x02 \x01(\x0b\x32\x1b.immudb.schema.VerifiableTx\x12\x35\n\x0einclusionProof\x18\x03 \x01(\x0b\x32\x1d.immudb.schema.InclusionProof\x12\x12\n\nDatabaseId\x18\x04 \x01(\r\x12\x0f\n\x07TableId\x18\x05 \x01(\r\x12\r\n\x05PKIDs\x18\x10 \x03(\r\x12I\n\x0c\x43olNamesById\x18\x08 \x03(\x0b\x32\x33.immudb.schema.VerifiableSQLEntry.ColNamesByIdEntry\x12I\n\x0c\x43olIdsByName\x18\t \x03(\x0b\x32\x33.immudb.schema.VerifiableSQLEntry.ColIdsByNameEntry\x12I\n\x0c\x43olTypesById\x18\n \x03(\x0b\x32\x33.immudb.schema.VerifiableSQLEntry.ColTypesByIdEntry\x12\x45\n\nColLenById\x18\x0b \x03(\x0b\x32\x31.immudb.schema.VerifiableSQLEntry.ColLenByIdEntry\x1a\x33\n\x11\x43olNamesByIdEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x43olIdsByNameEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\r:\x02\x38\x01\x1a\x33\n\x11\x43olTypesByIdEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0f\x43olLenByIdEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01J\x04\x08\x06\x10\x07\"!\n\x10UseDatabaseReply\x12\r\n\x05token\x18\x01 \x01(\t\"\x82\x01\n\x17\x43hangePermissionRequest\x12/\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x1f.immudb.schema.PermissionAction\x12\x10\n\x08username\x18\x02 \x01(\t\x12\x10\n\x08\x64\x61tabase\x18\x03 \x01(\t\x12\x12\n\npermission\x18\x04 \x01(\r\"8\n\x14SetActiveUserRequest\x12\x0e\n\x06\x61\x63tive\x18\x01 \x01(\x08\x12\x10\n\x08username\x18\x02 \x01(\t\"B\n\x14\x44\x61tabaseListResponse\x12*\n\tdatabases\x18\x01 \x03(\x0b\x32\x17.immudb.schema.Database\"\x17\n\x15\x44\x61tabaseListRequestV2\"P\n\x16\x44\x61tabaseListResponseV2\x12\x36\n\tdatabases\x18\x01 \x03(\x0b\x32#.immudb.schema.DatabaseWithSettings\"o\n\x14\x44\x61tabaseWithSettings\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x39\n\x08settings\x18\x02 \x01(\x0b\x32\'.immudb.schema.DatabaseNullableSettings\x12\x0e\n\x06loaded\x18\x03 \x01(\x08\"\x18\n\x05\x43hunk\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\"9\n\x12UseSnapshotRequest\x12\x0f\n\x07sinceTx\x18\x01 \x01(\x04\x12\x12\n\nasBeforeTx\x18\x02 \x01(\x04\"X\n\x0eSQLExecRequest\x12\x0b\n\x03sql\x18\x01 \x01(\t\x12)\n\x06params\x18\x02 \x03(\x0b\x32\x19.immudb.schema.NamedParam\x12\x0e\n\x06noWait\x18\x03 \x01(\x08\"`\n\x0fSQLQueryRequest\x12\x0b\n\x03sql\x18\x01 \x01(\t\x12)\n\x06params\x18\x02 \x03(\x0b\x32\x19.immudb.schema.NamedParam\x12\x15\n\rreuseSnapshot\x18\x03 \x01(\x08\"B\n\nNamedParam\x12\x0c\n\x04name\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.immudb.schema.SQLValue\"N\n\rSQLExecResult\x12*\n\x03txs\x18\x05 \x03(\x0b\x32\x1d.immudb.schema.CommittedSQLTx\x12\x11\n\tongoingTx\x18\x06 \x01(\x08\"\x8d\x03\n\x0e\x43ommittedSQLTx\x12\'\n\x06header\x18\x01 \x01(\x0b\x32\x17.immudb.schema.TxHeader\x12\x13\n\x0bupdatedRows\x18\x02 \x01(\r\x12K\n\x0flastInsertedPKs\x18\x03 \x03(\x0b\x32\x32.immudb.schema.CommittedSQLTx.LastInsertedPKsEntry\x12M\n\x10\x66irstInsertedPKs\x18\x04 \x03(\x0b\x32\x33.immudb.schema.CommittedSQLTx.FirstInsertedPKsEntry\x1aO\n\x14LastInsertedPKsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.immudb.schema.SQLValue:\x02\x38\x01\x1aP\n\x15\x46irstInsertedPKsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.immudb.schema.SQLValue:\x02\x38\x01\"Z\n\x0eSQLQueryResult\x12&\n\x07\x63olumns\x18\x02 \x03(\x0b\x32\x15.immudb.schema.Column\x12 \n\x04rows\x18\x01 \x03(\x0b\x32\x12.immudb.schema.Row\"$\n\x06\x43olumn\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\"?\n\x03Row\x12\x0f\n\x07\x63olumns\x18\x01 \x03(\t\x12\'\n\x06values\x18\x02 \x03(\x0b\x32\x17.immudb.schema.SQLValue\"\x82\x01\n\x08SQLValue\x12*\n\x04null\x18\x01 \x01(\x0e\x32\x1a.google.protobuf.NullValueH\x00\x12\x0b\n\x01n\x18\x02 \x01(\x03H\x00\x12\x0b\n\x01s\x18\x03 \x01(\tH\x00\x12\x0b\n\x01\x62\x18\x04 \x01(\x08H\x00\x12\x0c\n\x02\x62s\x18\x05 \x01(\x0cH\x00\x12\x0c\n\x02ts\x18\x06 \x01(\x03H\x00\x42\x07\n\x05value\"3\n\x0cNewTxRequest\x12#\n\x04mode\x18\x01 \x01(\x0e\x32\x15.immudb.schema.TxMode\"&\n\rNewTxResponse\x12\x15\n\rtransactionID\x18\x01 \x01(\t\"(\n\tErrorInfo\x12\x0c\n\x04\x63ode\x18\x01 \x01(\t\x12\r\n\x05\x63\x61use\x18\x02 \x01(\t\"\x1a\n\tDebugInfo\x12\r\n\x05stack\x18\x01 \x01(\t\" \n\tRetryInfo\x12\x13\n\x0bretry_delay\x18\x01 \x01(\x05*K\n\x0f\x45ntryTypeAction\x12\x0b\n\x07\x45XCLUDE\x10\x00\x12\x0f\n\x0bONLY_DIGEST\x10\x01\x12\r\n\tRAW_VALUE\x10\x02\x12\x0b\n\x07RESOLVE\x10\x03*)\n\x10PermissionAction\x12\t\n\x05GRANT\x10\x00\x12\n\n\x06REVOKE\x10\x01*4\n\x06TxMode\x12\x0c\n\x08ReadOnly\x10\x00\x12\r\n\tWriteOnly\x10\x01\x12\r\n\tReadWrite\x10\x02\x32\xd1\x32\n\x0bImmuService\x12P\n\tListUsers\x12\x16.google.protobuf.Empty\x1a\x17.immudb.schema.UserList\"\x12\x82\xd3\xe4\x93\x02\x0c\x12\n/user/list\x12X\n\nCreateUser\x12 .immudb.schema.CreateUserRequest\x1a\x16.google.protobuf.Empty\"\x10\x82\xd3\xe4\x93\x02\n\"\x05/user:\x01*\x12p\n\x0e\x43hangePassword\x12$.immudb.schema.ChangePasswordRequest\x1a\x16.google.protobuf.Empty\" \x82\xd3\xe4\x93\x02\x1a\"\x15/user/password/change:\x01*\x12u\n\x10\x43hangePermission\x12&.immudb.schema.ChangePermissionRequest\x1a\x16.google.protobuf.Empty\"!\x82\xd3\xe4\x93\x02\x1b\"\x16/user/changepermission:\x01*\x12l\n\rSetActiveUser\x12#.immudb.schema.SetActiveUserRequest\x1a\x16.google.protobuf.Empty\"\x1e\x82\xd3\xe4\x93\x02\x18\"\x13/user/setactiveUser:\x01*\x12J\n\x10UpdateAuthConfig\x12\x19.immudb.schema.AuthConfig\x1a\x16.google.protobuf.Empty\"\x03\x88\x02\x01\x12J\n\x10UpdateMTLSConfig\x12\x19.immudb.schema.MTLSConfig\x1a\x16.google.protobuf.Empty\"\x03\x88\x02\x01\x12V\n\x0bOpenSession\x12!.immudb.schema.OpenSessionRequest\x1a\".immudb.schema.OpenSessionResponse\"\x00\x12@\n\x0c\x43loseSession\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12=\n\tKeepAlive\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12\x44\n\x05NewTx\x12\x1b.immudb.schema.NewTxRequest\x1a\x1c.immudb.schema.NewTxResponse\"\x00\x12\x41\n\x06\x43ommit\x12\x16.google.protobuf.Empty\x1a\x1d.immudb.schema.CommittedSQLTx\"\x00\x12<\n\x08Rollback\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12\x44\n\tTxSQLExec\x12\x1d.immudb.schema.SQLExecRequest\x1a\x16.google.protobuf.Empty\"\x00\x12M\n\nTxSQLQuery\x12\x1e.immudb.schema.SQLQueryRequest\x1a\x1d.immudb.schema.SQLQueryResult\"\x00\x12X\n\x05Login\x12\x1b.immudb.schema.LoginRequest\x1a\x1c.immudb.schema.LoginResponse\"\x14\x88\x02\x01\x82\xd3\xe4\x93\x02\x0b\"\x06/login:\x01*\x12O\n\x06Logout\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x15\x88\x02\x01\x82\xd3\xe4\x93\x02\x0c\"\x07/logout:\x01*\x12M\n\x03Set\x12\x19.immudb.schema.SetRequest\x1a\x17.immudb.schema.TxHeader\"\x12\x82\xd3\xe4\x93\x02\x0c\"\x07/db/set:\x01*\x12p\n\rVerifiableSet\x12#.immudb.schema.VerifiableSetRequest\x1a\x1b.immudb.schema.VerifiableTx\"\x1d\x82\xd3\xe4\x93\x02\x17\"\x12/db/verifiable/set:\x01*\x12M\n\x03Get\x12\x19.immudb.schema.KeyRequest\x1a\x14.immudb.schema.Entry\"\x15\x82\xd3\xe4\x93\x02\x0f\x12\r/db/get/{key}\x12s\n\rVerifiableGet\x12#.immudb.schema.VerifiableGetRequest\x1a\x1e.immudb.schema.VerifiableEntry\"\x1d\x82\xd3\xe4\x93\x02\x17\"\x12/db/verifiable/get:\x01*\x12Z\n\x06\x44\x65lete\x12 .immudb.schema.DeleteKeysRequest\x1a\x17.immudb.schema.TxHeader\"\x15\x82\xd3\xe4\x93\x02\x0f\"\n/db/delete:\x01*\x12V\n\x06GetAll\x12\x1d.immudb.schema.KeyListRequest\x1a\x16.immudb.schema.Entries\"\x15\x82\xd3\xe4\x93\x02\x0f\"\n/db/getall:\x01*\x12Y\n\x07\x45xecAll\x12\x1d.immudb.schema.ExecAllRequest\x1a\x17.immudb.schema.TxHeader\"\x16\x82\xd3\xe4\x93\x02\x10\"\x0b/db/execall:\x01*\x12O\n\x04Scan\x12\x1a.immudb.schema.ScanRequest\x1a\x16.immudb.schema.Entries\"\x13\x82\xd3\xe4\x93\x02\r\"\x08/db/scan:\x01*\x12X\n\x05\x43ount\x12\x18.immudb.schema.KeyPrefix\x1a\x19.immudb.schema.EntryCount\"\x1a\x82\xd3\xe4\x93\x02\x14\x12\x12/db/count/{prefix}\x12S\n\x08\x43ountAll\x12\x16.google.protobuf.Empty\x1a\x19.immudb.schema.EntryCount\"\x14\x82\xd3\xe4\x93\x02\x0e\x12\x0c/db/countall\x12J\n\x06TxById\x12\x18.immudb.schema.TxRequest\x1a\x11.immudb.schema.Tx\"\x13\x82\xd3\xe4\x93\x02\r\x12\x0b/db/tx/{tx}\x12s\n\x10VerifiableTxById\x12\".immudb.schema.VerifiableTxRequest\x1a\x1b.immudb.schema.VerifiableTx\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/db/verifiable/tx/{tx}\x12P\n\x06TxScan\x12\x1c.immudb.schema.TxScanRequest\x1a\x15.immudb.schema.TxList\"\x11\x82\xd3\xe4\x93\x02\x0b\"\x06/db/tx:\x01*\x12X\n\x07History\x12\x1d.immudb.schema.HistoryRequest\x1a\x16.immudb.schema.Entries\"\x16\x82\xd3\xe4\x93\x02\x10\"\x0b/db/history:\x01*\x12\x66\n\nServerInfo\x12 .immudb.schema.ServerInfoRequest\x1a!.immudb.schema.ServerInfoResponse\"\x13\x82\xd3\xe4\x93\x02\r\x12\x0b/serverinfo\x12P\n\x06Health\x12\x16.google.protobuf.Empty\x1a\x1d.immudb.schema.HealthResponse\"\x0f\x82\xd3\xe4\x93\x02\t\x12\x07/health\x12\x63\n\x0e\x44\x61tabaseHealth\x12\x16.google.protobuf.Empty\x1a%.immudb.schema.DatabaseHealthResponse\"\x12\x82\xd3\xe4\x93\x02\x0c\x12\n/db/health\x12X\n\x0c\x43urrentState\x12\x16.google.protobuf.Empty\x1a\x1d.immudb.schema.ImmutableState\"\x11\x82\xd3\xe4\x93\x02\x0b\x12\t/db/state\x12\x65\n\x0cSetReference\x12\x1f.immudb.schema.ReferenceRequest\x1a\x17.immudb.schema.TxHeader\"\x1b\x82\xd3\xe4\x93\x02\x15\"\x10/db/setreference:\x01*\x12\x88\x01\n\x16VerifiableSetReference\x12).immudb.schema.VerifiableReferenceRequest\x1a\x1b.immudb.schema.VerifiableTx\"&\x82\xd3\xe4\x93\x02 \"\x1b/db/verifiable/setreference:\x01*\x12P\n\x04ZAdd\x12\x1a.immudb.schema.ZAddRequest\x1a\x17.immudb.schema.TxHeader\"\x13\x82\xd3\xe4\x93\x02\r\"\x08/db/zadd:\x01*\x12s\n\x0eVerifiableZAdd\x12$.immudb.schema.VerifiableZAddRequest\x1a\x1b.immudb.schema.VerifiableTx\"\x1e\x82\xd3\xe4\x93\x02\x18\"\x13/db/verifiable/zadd:\x01*\x12S\n\x05ZScan\x12\x1b.immudb.schema.ZScanRequest\x1a\x17.immudb.schema.ZEntries\"\x14\x82\xd3\xe4\x93\x02\x0e\"\t/db/zscan:\x01*\x12[\n\x0e\x43reateDatabase\x12\x17.immudb.schema.Database\x1a\x16.google.protobuf.Empty\"\x18\x88\x02\x01\x82\xd3\xe4\x93\x02\x0f\"\n/db/create:\x01*\x12k\n\x12\x43reateDatabaseWith\x12\x1f.immudb.schema.DatabaseSettings\x1a\x16.google.protobuf.Empty\"\x1c\x88\x02\x01\x82\xd3\xe4\x93\x02\x13\"\x0e/db/createwith:\x01*\x12y\n\x10\x43reateDatabaseV2\x12$.immudb.schema.CreateDatabaseRequest\x1a%.immudb.schema.CreateDatabaseResponse\"\x18\x82\xd3\xe4\x93\x02\x12\"\r/db/create/v2:\x01*\x12l\n\x0cLoadDatabase\x12\".immudb.schema.LoadDatabaseRequest\x1a#.immudb.schema.LoadDatabaseResponse\"\x13\x82\xd3\xe4\x93\x02\r\"\x08/db/load:\x01*\x12t\n\x0eUnloadDatabase\x12$.immudb.schema.UnloadDatabaseRequest\x1a%.immudb.schema.UnloadDatabaseResponse\"\x15\x82\xd3\xe4\x93\x02\x0f\"\n/db/unload:\x01*\x12t\n\x0e\x44\x65leteDatabase\x12$.immudb.schema.DeleteDatabaseRequest\x1a%.immudb.schema.DeleteDatabaseResponse\"\x15\x82\xd3\xe4\x93\x02\x0f\"\n/db/delete:\x01*\x12\x63\n\x0c\x44\x61tabaseList\x12\x16.google.protobuf.Empty\x1a#.immudb.schema.DatabaseListResponse\"\x16\x88\x02\x01\x82\xd3\xe4\x93\x02\r\"\x08/db/list:\x01*\x12u\n\x0e\x44\x61tabaseListV2\x12$.immudb.schema.DatabaseListRequestV2\x1a%.immudb.schema.DatabaseListResponseV2\"\x16\x82\xd3\xe4\x93\x02\x10\"\x0b/db/list/v2:\x01*\x12g\n\x0bUseDatabase\x12\x17.immudb.schema.Database\x1a\x1f.immudb.schema.UseDatabaseReply\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/db/use/{databaseName}\x12\x63\n\x0eUpdateDatabase\x12\x1f.immudb.schema.DatabaseSettings\x1a\x16.google.protobuf.Empty\"\x18\x88\x02\x01\x82\xd3\xe4\x93\x02\x0f\"\n/db/update:\x01*\x12y\n\x10UpdateDatabaseV2\x12$.immudb.schema.UpdateDatabaseRequest\x1a%.immudb.schema.UpdateDatabaseResponse\"\x18\x82\xd3\xe4\x93\x02\x12\"\r/db/update/v2:\x01*\x12j\n\x13GetDatabaseSettings\x12\x16.google.protobuf.Empty\x1a\x1f.immudb.schema.DatabaseSettings\"\x1a\x88\x02\x01\x82\xd3\xe4\x93\x02\x11\"\x0c/db/settings:\x01*\x12\x84\x01\n\x15GetDatabaseSettingsV2\x12&.immudb.schema.DatabaseSettingsRequest\x1a\'.immudb.schema.DatabaseSettingsResponse\"\x1a\x82\xd3\xe4\x93\x02\x14\"\x0f/db/settings/v2:\x01*\x12i\n\nFlushIndex\x12 .immudb.schema.FlushIndexRequest\x1a!.immudb.schema.FlushIndexResponse\"\x16\x82\xd3\xe4\x93\x02\x10\x12\x0e/db/flushindex\x12X\n\x0c\x43ompactIndex\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x18\x82\xd3\xe4\x93\x02\x12\x12\x10/db/compactindex\x12@\n\tstreamGet\x12\x19.immudb.schema.KeyRequest\x1a\x14.immudb.schema.Chunk\"\x00\x30\x01\x12>\n\tstreamSet\x12\x14.immudb.schema.Chunk\x1a\x17.immudb.schema.TxHeader\"\x00(\x01\x12T\n\x13streamVerifiableGet\x12#.immudb.schema.VerifiableGetRequest\x1a\x14.immudb.schema.Chunk\"\x00\x30\x01\x12L\n\x13streamVerifiableSet\x12\x14.immudb.schema.Chunk\x1a\x1b.immudb.schema.VerifiableTx\"\x00(\x01\x12\x42\n\nstreamScan\x12\x1a.immudb.schema.ScanRequest\x1a\x14.immudb.schema.Chunk\"\x00\x30\x01\x12\x44\n\x0bstreamZScan\x12\x1b.immudb.schema.ZScanRequest\x1a\x14.immudb.schema.Chunk\"\x00\x30\x01\x12H\n\rstreamHistory\x12\x1d.immudb.schema.HistoryRequest\x1a\x14.immudb.schema.Chunk\"\x00\x30\x01\x12\x42\n\rstreamExecAll\x12\x14.immudb.schema.Chunk\x1a\x17.immudb.schema.TxHeader\"\x00(\x01\x12\x44\n\x08\x65xportTx\x12\x1e.immudb.schema.ExportTxRequest\x1a\x14.immudb.schema.Chunk\"\x00\x30\x01\x12@\n\x0breplicateTx\x12\x14.immudb.schema.Chunk\x1a\x17.immudb.schema.TxHeader\"\x00(\x01\x12^\n\x07SQLExec\x12\x1d.immudb.schema.SQLExecRequest\x1a\x1c.immudb.schema.SQLExecResult\"\x16\x82\xd3\xe4\x93\x02\x10\"\x0b/db/sqlexec:\x01*\x12\x62\n\x08SQLQuery\x12\x1e.immudb.schema.SQLQueryRequest\x1a\x1d.immudb.schema.SQLQueryResult\"\x17\x82\xd3\xe4\x93\x02\x11\"\x0c/db/sqlquery:\x01*\x12[\n\nListTables\x12\x16.google.protobuf.Empty\x1a\x1d.immudb.schema.SQLQueryResult\"\x16\x82\xd3\xe4\x93\x02\x10\x12\x0e/db/table/list\x12[\n\rDescribeTable\x12\x14.immudb.schema.Table\x1a\x1d.immudb.schema.SQLQueryResult\"\x15\x82\xd3\xe4\x93\x02\x0f\"\n/db/tables:\x01*\x12\x7f\n\x10VerifiableSQLGet\x12&.immudb.schema.VerifiableSQLGetRequest\x1a!.immudb.schema.VerifiableSQLEntry\" \x82\xd3\xe4\x93\x02\x1a\"\x15/db/verifiable/sqlget:\x01*B-Z+github.com/codenotary/immudb/pkg/api/schemab\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cschema.proto\x12\rimmudb.schema\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1cgoogle/protobuf/struct.proto\"\x12\n\x03Key\x12\x0b\n\x03key\x18\x01 \x01(\x0c\"2\n\nPermission\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\x12\x12\n\npermission\x18\x02 \x01(\r\"z\n\x04User\x12\x0c\n\x04user\x18\x01 \x01(\x0c\x12.\n\x0bpermissions\x18\x03 \x03(\x0b\x32\x19.immudb.schema.Permission\x12\x11\n\tcreatedby\x18\x04 \x01(\t\x12\x11\n\tcreatedat\x18\x05 \x01(\t\x12\x0e\n\x06\x61\x63tive\x18\x06 \x01(\x08\".\n\x08UserList\x12\"\n\x05users\x18\x01 \x03(\x0b\x32\x13.immudb.schema.User\"Y\n\x11\x43reateUserRequest\x12\x0c\n\x04user\x18\x01 \x01(\x0c\x12\x10\n\x08password\x18\x02 \x01(\x0c\x12\x12\n\npermission\x18\x03 \x01(\r\x12\x10\n\x08\x64\x61tabase\x18\x04 \x01(\t\"\x1b\n\x0bUserRequest\x12\x0c\n\x04user\x18\x01 \x01(\x0c\"O\n\x15\x43hangePasswordRequest\x12\x0c\n\x04user\x18\x01 \x01(\x0c\x12\x13\n\x0boldPassword\x18\x02 \x01(\x0c\x12\x13\n\x0bnewPassword\x18\x03 \x01(\x0c\".\n\x0cLoginRequest\x12\x0c\n\x04user\x18\x01 \x01(\x0c\x12\x10\n\x08password\x18\x02 \x01(\x0c\"/\n\rLoginResponse\x12\r\n\x05token\x18\x01 \x01(\t\x12\x0f\n\x07warning\x18\x02 \x01(\x0c\"\x1a\n\nAuthConfig\x12\x0c\n\x04kind\x18\x01 \x01(\r\"\x1d\n\nMTLSConfig\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\"N\n\x12OpenSessionRequest\x12\x10\n\x08username\x18\x01 \x01(\x0c\x12\x10\n\x08password\x18\x02 \x01(\x0c\x12\x14\n\x0c\x64\x61tabaseName\x18\x03 \x01(\t\"<\n\x13OpenSessionResponse\x12\x11\n\tsessionID\x18\x01 \x01(\t\x12\x12\n\nserverUUID\x18\x02 \x01(\t\"\xb5\x03\n\x0cPrecondition\x12L\n\x0ckeyMustExist\x18\x01 \x01(\x0b\x32\x34.immudb.schema.Precondition.KeyMustExistPreconditionH\x00\x12R\n\x0fkeyMustNotExist\x18\x02 \x01(\x0b\x32\x37.immudb.schema.Precondition.KeyMustNotExistPreconditionH\x00\x12^\n\x15keyNotModifiedAfterTX\x18\x03 \x01(\x0b\x32=.immudb.schema.Precondition.KeyNotModifiedAfterTXPreconditionH\x00\x1a\'\n\x18KeyMustExistPrecondition\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x1a*\n\x1bKeyMustNotExistPrecondition\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x1a>\n!KeyNotModifiedAfterTXPrecondition\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12\x0c\n\x04txID\x18\x02 \x01(\x04\x42\x0e\n\x0cprecondition\"S\n\x08KeyValue\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12\r\n\x05value\x18\x02 \x01(\x0c\x12+\n\x08metadata\x18\x03 \x01(\x0b\x32\x19.immudb.schema.KVMetadata\"\xaf\x01\n\x05\x45ntry\x12\n\n\x02tx\x18\x01 \x01(\x04\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12\r\n\x05value\x18\x03 \x01(\x0c\x12.\n\x0creferencedBy\x18\x04 \x01(\x0b\x32\x18.immudb.schema.Reference\x12+\n\x08metadata\x18\x05 \x01(\x0b\x32\x19.immudb.schema.KVMetadata\x12\x0f\n\x07\x65xpired\x18\x06 \x01(\x08\x12\x10\n\x08revision\x18\x07 \x01(\x04\"q\n\tReference\x12\n\n\x02tx\x18\x01 \x01(\x04\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12\x0c\n\x04\x61tTx\x18\x03 \x01(\x04\x12+\n\x08metadata\x18\x04 \x01(\x0b\x32\x19.immudb.schema.KVMetadata\x12\x10\n\x08revision\x18\x05 \x01(\x04\"\x94\x01\n\x02Op\x12%\n\x02kv\x18\x01 \x01(\x0b\x32\x17.immudb.schema.KeyValueH\x00\x12*\n\x04zAdd\x18\x02 \x01(\x0b\x32\x1a.immudb.schema.ZAddRequestH\x00\x12.\n\x03ref\x18\x03 \x01(\x0b\x32\x1f.immudb.schema.ReferenceRequestH\x00\x42\x0b\n\toperation\"{\n\x0e\x45xecAllRequest\x12%\n\nOperations\x18\x01 \x03(\x0b\x32\x11.immudb.schema.Op\x12\x0e\n\x06noWait\x18\x02 \x01(\x08\x12\x32\n\rpreconditions\x18\x03 \x03(\x0b\x32\x1b.immudb.schema.Precondition\"0\n\x07\x45ntries\x12%\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x14.immudb.schema.Entry\"d\n\x06ZEntry\x12\x0b\n\x03set\x18\x01 \x01(\x0c\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12#\n\x05\x65ntry\x18\x03 \x01(\x0b\x32\x14.immudb.schema.Entry\x12\r\n\x05score\x18\x04 \x01(\x01\x12\x0c\n\x04\x61tTx\x18\x05 \x01(\x04\"2\n\x08ZEntries\x12&\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x15.immudb.schema.ZEntry\"\xb9\x01\n\x0bScanRequest\x12\x0f\n\x07seekKey\x18\x01 \x01(\x0c\x12\x0e\n\x06\x65ndKey\x18\x07 \x01(\x0c\x12\x0e\n\x06prefix\x18\x02 \x01(\x0c\x12\x0c\n\x04\x64\x65sc\x18\x03 \x01(\x08\x12\r\n\x05limit\x18\x04 \x01(\x04\x12\x0f\n\x07sinceTx\x18\x05 \x01(\x04\x12\x0e\n\x06noWait\x18\x06 \x01(\x08\x12\x15\n\rinclusiveSeek\x18\x08 \x01(\x08\x12\x14\n\x0cinclusiveEnd\x18\t \x01(\x08\x12\x0e\n\x06offset\x18\n \x01(\x04\"\x1b\n\tKeyPrefix\x12\x0e\n\x06prefix\x18\x01 \x01(\x0c\"\x1b\n\nEntryCount\x12\r\n\x05\x63ount\x18\x01 \x01(\x04\"1\n\tSignature\x12\x11\n\tpublicKey\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\"\xaf\x01\n\x08TxHeader\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x0f\n\x07prevAlh\x18\x02 \x01(\x0c\x12\n\n\x02ts\x18\x03 \x01(\x03\x12\x10\n\x08nentries\x18\x04 \x01(\x05\x12\n\n\x02\x65H\x18\x05 \x01(\x0c\x12\x0e\n\x06\x62lTxId\x18\x06 \x01(\x04\x12\x0e\n\x06\x62lRoot\x18\x07 \x01(\x0c\x12\x0f\n\x07version\x18\x08 \x01(\x05\x12+\n\x08metadata\x18\t \x01(\x0b\x32\x19.immudb.schema.TxMetadata\"2\n\nTxMetadata\x12\x15\n\rtruncatedTxID\x18\x01 \x01(\x04\x12\r\n\x05\x65xtra\x18\x02 \x01(\x0c\"D\n\x0bLinearProof\x12\x12\n\nsourceTxId\x18\x01 \x01(\x04\x12\x12\n\nTargetTxId\x18\x02 \x01(\x04\x12\r\n\x05terms\x18\x03 \x03(\x0c\"f\n\x12LinearAdvanceProof\x12\x18\n\x10linearProofTerms\x18\x01 \x03(\x0c\x12\x36\n\x0finclusionProofs\x18\x02 \x03(\x0b\x32\x1d.immudb.schema.InclusionProof\"\xc2\x02\n\tDualProof\x12/\n\x0esourceTxHeader\x18\x01 \x01(\x0b\x32\x17.immudb.schema.TxHeader\x12/\n\x0etargetTxHeader\x18\x02 \x01(\x0b\x32\x17.immudb.schema.TxHeader\x12\x16\n\x0einclusionProof\x18\x03 \x03(\x0c\x12\x18\n\x10\x63onsistencyProof\x18\x04 \x03(\x0c\x12\x15\n\rtargetBlTxAlh\x18\x05 \x01(\x0c\x12\x1a\n\x12lastInclusionProof\x18\x06 \x03(\x0c\x12/\n\x0blinearProof\x18\x07 \x01(\x0b\x32\x1a.immudb.schema.LinearProof\x12=\n\x12LinearAdvanceProof\x18\x08 \x01(\x0b\x32!.immudb.schema.LinearAdvanceProof\"\xa1\x01\n\x0b\x44ualProofV2\x12/\n\x0esourceTxHeader\x18\x01 \x01(\x0b\x32\x17.immudb.schema.TxHeader\x12/\n\x0etargetTxHeader\x18\x02 \x01(\x0b\x32\x17.immudb.schema.TxHeader\x12\x16\n\x0einclusionProof\x18\x03 \x03(\x0c\x12\x18\n\x10\x63onsistencyProof\x18\x04 \x03(\x0c\"\xa8\x01\n\x02Tx\x12\'\n\x06header\x18\x01 \x01(\x0b\x32\x17.immudb.schema.TxHeader\x12\'\n\x07\x65ntries\x18\x02 \x03(\x0b\x32\x16.immudb.schema.TxEntry\x12\'\n\tkvEntries\x18\x03 \x03(\x0b\x32\x14.immudb.schema.Entry\x12\'\n\x08zEntries\x18\x04 \x03(\x0b\x32\x15.immudb.schema.ZEntry\"p\n\x07TxEntry\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12\x0e\n\x06hValue\x18\x02 \x01(\x0c\x12\x0c\n\x04vLen\x18\x03 \x01(\x05\x12+\n\x08metadata\x18\x04 \x01(\x0b\x32\x19.immudb.schema.KVMetadata\x12\r\n\x05value\x18\x05 \x01(\x0c\"b\n\nKVMetadata\x12\x0f\n\x07\x64\x65leted\x18\x01 \x01(\x08\x12-\n\nexpiration\x18\x02 \x01(\x0b\x32\x19.immudb.schema.Expiration\x12\x14\n\x0cnonIndexable\x18\x03 \x01(\x08\"\x1f\n\nExpiration\x12\x11\n\texpiresAt\x18\x01 \x01(\x03\"\x87\x01\n\x0cVerifiableTx\x12\x1d\n\x02tx\x18\x01 \x01(\x0b\x32\x11.immudb.schema.Tx\x12+\n\tdualProof\x18\x02 \x01(\x0b\x32\x18.immudb.schema.DualProof\x12+\n\tsignature\x18\x03 \x01(\x0b\x32\x18.immudb.schema.Signature\"\x8b\x01\n\x0eVerifiableTxV2\x12\x1d\n\x02tx\x18\x01 \x01(\x0b\x32\x11.immudb.schema.Tx\x12-\n\tdualProof\x18\x02 \x01(\x0b\x32\x1a.immudb.schema.DualProofV2\x12+\n\tsignature\x18\x03 \x01(\x0b\x32\x18.immudb.schema.Signature\"\xa0\x01\n\x0fVerifiableEntry\x12#\n\x05\x65ntry\x18\x01 \x01(\x0b\x32\x14.immudb.schema.Entry\x12\x31\n\x0cverifiableTx\x18\x02 \x01(\x0b\x32\x1b.immudb.schema.VerifiableTx\x12\x35\n\x0einclusionProof\x18\x03 \x01(\x0b\x32\x1d.immudb.schema.InclusionProof\"<\n\x0eInclusionProof\x12\x0c\n\x04leaf\x18\x01 \x01(\x05\x12\r\n\x05width\x18\x02 \x01(\x05\x12\r\n\x05terms\x18\x03 \x03(\x0c\"v\n\nSetRequest\x12$\n\x03KVs\x18\x01 \x03(\x0b\x32\x17.immudb.schema.KeyValue\x12\x0e\n\x06noWait\x18\x02 \x01(\x08\x12\x32\n\rpreconditions\x18\x03 \x03(\x0b\x32\x1b.immudb.schema.Precondition\"\\\n\nKeyRequest\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12\x0c\n\x04\x61tTx\x18\x02 \x01(\x04\x12\x0f\n\x07sinceTx\x18\x03 \x01(\x04\x12\x0e\n\x06noWait\x18\x04 \x01(\x08\x12\x12\n\natRevision\x18\x05 \x01(\x03\"/\n\x0eKeyListRequest\x12\x0c\n\x04keys\x18\x01 \x03(\x0c\x12\x0f\n\x07sinceTx\x18\x02 \x01(\x04\"B\n\x11\x44\x65leteKeysRequest\x12\x0c\n\x04keys\x18\x01 \x03(\x0c\x12\x0f\n\x07sinceTx\x18\x02 \x01(\x04\x12\x0e\n\x06noWait\x18\x03 \x01(\x08\"[\n\x14VerifiableSetRequest\x12-\n\nsetRequest\x18\x01 \x01(\x0b\x32\x19.immudb.schema.SetRequest\x12\x14\n\x0cproveSinceTx\x18\x02 \x01(\x04\"[\n\x14VerifiableGetRequest\x12-\n\nkeyRequest\x18\x01 \x01(\x0b\x32\x19.immudb.schema.KeyRequest\x12\x14\n\x0cproveSinceTx\x18\x02 \x01(\x04\"\x13\n\x11ServerInfoRequest\"\x82\x01\n\x12ServerInfoResponse\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\x11\n\tstartedAt\x18\x02 \x01(\x03\x12\x17\n\x0fnumTransactions\x18\x03 \x01(\x03\x12\x14\n\x0cnumDatabases\x18\x04 \x01(\x05\x12\x19\n\x11\x64\x61tabasesDiskSize\x18\x05 \x01(\x03\"1\n\x0eHealthResponse\x12\x0e\n\x06status\x18\x01 \x01(\x08\x12\x0f\n\x07version\x18\x02 \x01(\t\"Q\n\x16\x44\x61tabaseHealthResponse\x12\x17\n\x0fpendingRequests\x18\x01 \x01(\r\x12\x1e\n\x16lastRequestCompletedAt\x18\x02 \x01(\x03\"\x9d\x01\n\x0eImmutableState\x12\n\n\x02\x64\x62\x18\x01 \x01(\t\x12\x0c\n\x04txId\x18\x02 \x01(\x04\x12\x0e\n\x06txHash\x18\x03 \x01(\x0c\x12+\n\tsignature\x18\x04 \x01(\x0b\x32\x18.immudb.schema.Signature\x12\x18\n\x10precommittedTxId\x18\x05 \x01(\x04\x12\x1a\n\x12precommittedTxHash\x18\x06 \x01(\x0c\"\x9a\x01\n\x10ReferenceRequest\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12\x15\n\rreferencedKey\x18\x02 \x01(\x0c\x12\x0c\n\x04\x61tTx\x18\x03 \x01(\x04\x12\x10\n\x08\x62oundRef\x18\x04 \x01(\x08\x12\x0e\n\x06noWait\x18\x05 \x01(\x08\x12\x32\n\rpreconditions\x18\x06 \x03(\x0b\x32\x1b.immudb.schema.Precondition\"m\n\x1aVerifiableReferenceRequest\x12\x39\n\x10referenceRequest\x18\x01 \x01(\x0b\x32\x1f.immudb.schema.ReferenceRequest\x12\x14\n\x0cproveSinceTx\x18\x02 \x01(\x04\"f\n\x0bZAddRequest\x12\x0b\n\x03set\x18\x01 \x01(\x0c\x12\r\n\x05score\x18\x02 \x01(\x01\x12\x0b\n\x03key\x18\x03 \x01(\x0c\x12\x0c\n\x04\x61tTx\x18\x04 \x01(\x04\x12\x10\n\x08\x62oundRef\x18\x05 \x01(\x08\x12\x0e\n\x06noWait\x18\x06 \x01(\x08\"\x16\n\x05Score\x12\r\n\x05score\x18\x01 \x01(\x01\"\x86\x02\n\x0cZScanRequest\x12\x0b\n\x03set\x18\x01 \x01(\x0c\x12\x0f\n\x07seekKey\x18\x02 \x01(\x0c\x12\x11\n\tseekScore\x18\x03 \x01(\x01\x12\x10\n\x08seekAtTx\x18\x04 \x01(\x04\x12\x15\n\rinclusiveSeek\x18\x05 \x01(\x08\x12\r\n\x05limit\x18\x06 \x01(\x04\x12\x0c\n\x04\x64\x65sc\x18\x07 \x01(\x08\x12&\n\x08minScore\x18\x08 \x01(\x0b\x32\x14.immudb.schema.Score\x12&\n\x08maxScore\x18\t \x01(\x0b\x32\x14.immudb.schema.Score\x12\x0f\n\x07sinceTx\x18\n \x01(\x04\x12\x0e\n\x06noWait\x18\x0b \x01(\x08\x12\x0e\n\x06offset\x18\x0c \x01(\x04\"[\n\x0eHistoryRequest\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12\x0e\n\x06offset\x18\x02 \x01(\x04\x12\r\n\x05limit\x18\x03 \x01(\x05\x12\x0c\n\x04\x64\x65sc\x18\x04 \x01(\x08\x12\x0f\n\x07sinceTx\x18\x05 \x01(\x04\"^\n\x15VerifiableZAddRequest\x12/\n\x0bzAddRequest\x18\x01 \x01(\x0b\x32\x1a.immudb.schema.ZAddRequest\x12\x14\n\x0cproveSinceTx\x18\x02 \x01(\x04\"\x8b\x01\n\tTxRequest\x12\n\n\x02tx\x18\x01 \x01(\x04\x12/\n\x0b\x65ntriesSpec\x18\x02 \x01(\x0b\x32\x1a.immudb.schema.EntriesSpec\x12\x0f\n\x07sinceTx\x18\x03 \x01(\x04\x12\x0e\n\x06noWait\x18\x04 \x01(\x08\x12 \n\x18keepReferencesUnresolved\x18\x05 \x01(\x08\"\xac\x01\n\x0b\x45ntriesSpec\x12\x33\n\rkvEntriesSpec\x18\x01 \x01(\x0b\x32\x1c.immudb.schema.EntryTypeSpec\x12\x32\n\x0czEntriesSpec\x18\x02 \x01(\x0b\x32\x1c.immudb.schema.EntryTypeSpec\x12\x34\n\x0esqlEntriesSpec\x18\x03 \x01(\x0b\x32\x1c.immudb.schema.EntryTypeSpec\"?\n\rEntryTypeSpec\x12.\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x1e.immudb.schema.EntryTypeAction\"\xab\x01\n\x13VerifiableTxRequest\x12\n\n\x02tx\x18\x01 \x01(\x04\x12\x14\n\x0cproveSinceTx\x18\x02 \x01(\x04\x12/\n\x0b\x65ntriesSpec\x18\x03 \x01(\x0b\x32\x1a.immudb.schema.EntriesSpec\x12\x0f\n\x07sinceTx\x18\x04 \x01(\x04\x12\x0e\n\x06noWait\x18\x05 \x01(\x08\x12 \n\x18keepReferencesUnresolved\x18\x06 \x01(\x08\"\x91\x01\n\rTxScanRequest\x12\x11\n\tinitialTx\x18\x01 \x01(\x04\x12\r\n\x05limit\x18\x02 \x01(\r\x12\x0c\n\x04\x64\x65sc\x18\x03 \x01(\x08\x12/\n\x0b\x65ntriesSpec\x18\x04 \x01(\x0b\x32\x1a.immudb.schema.EntriesSpec\x12\x0f\n\x07sinceTx\x18\x05 \x01(\x04\x12\x0e\n\x06noWait\x18\x06 \x01(\x08\"(\n\x06TxList\x12\x1e\n\x03txs\x18\x01 \x03(\x0b\x32\x11.immudb.schema.Tx\"\x87\x01\n\x0f\x45xportTxRequest\x12\n\n\x02tx\x18\x01 \x01(\x04\x12\x19\n\x11\x61llowPreCommitted\x18\x02 \x01(\x08\x12\x31\n\x0creplicaState\x18\x03 \x01(\x0b\x32\x1b.immudb.schema.ReplicaState\x12\x1a\n\x12skipIntegrityCheck\x18\x04 \x01(\x08\"|\n\x0cReplicaState\x12\x0c\n\x04UUID\x18\x01 \x01(\t\x12\x15\n\rcommittedTxID\x18\x02 \x01(\x04\x12\x14\n\x0c\x63ommittedAlh\x18\x03 \x01(\x0c\x12\x18\n\x10precommittedTxID\x18\x04 \x01(\x04\x12\x17\n\x0fprecommittedAlh\x18\x05 \x01(\x0c\" \n\x08\x44\x61tabase\x12\x14\n\x0c\x64\x61tabaseName\x18\x01 \x01(\t\"\x99\x02\n\x10\x44\x61tabaseSettings\x12\x14\n\x0c\x64\x61tabaseName\x18\x01 \x01(\t\x12\x0f\n\x07replica\x18\x02 \x01(\x08\x12\x17\n\x0fprimaryDatabase\x18\x03 \x01(\t\x12\x13\n\x0bprimaryHost\x18\x04 \x01(\t\x12\x13\n\x0bprimaryPort\x18\x05 \x01(\r\x12\x17\n\x0fprimaryUsername\x18\x06 \x01(\t\x12\x17\n\x0fprimaryPassword\x18\x07 \x01(\t\x12\x10\n\x08\x66ileSize\x18\x08 \x01(\r\x12\x11\n\tmaxKeyLen\x18\t \x01(\r\x12\x13\n\x0bmaxValueLen\x18\n \x01(\r\x12\x14\n\x0cmaxTxEntries\x18\x0b \x01(\r\x12\x19\n\x11\x65xcludeCommitTime\x18\x0c \x01(\x08\"u\n\x15\x43reateDatabaseRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x39\n\x08settings\x18\x02 \x01(\x0b\x32\'.immudb.schema.DatabaseNullableSettings\x12\x13\n\x0bifNotExists\x18\x03 \x01(\x08\"y\n\x16\x43reateDatabaseResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x39\n\x08settings\x18\x02 \x01(\x0b\x32\'.immudb.schema.DatabaseNullableSettings\x12\x16\n\x0e\x61lreadyExisted\x18\x03 \x01(\x08\"d\n\x15UpdateDatabaseRequest\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\x12\x39\n\x08settings\x18\x02 \x01(\x0b\x32\'.immudb.schema.DatabaseNullableSettings\"e\n\x16UpdateDatabaseResponse\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\x12\x39\n\x08settings\x18\x02 \x01(\x0b\x32\'.immudb.schema.DatabaseNullableSettings\"\x19\n\x17\x44\x61tabaseSettingsRequest\"g\n\x18\x44\x61tabaseSettingsResponse\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\x12\x39\n\x08settings\x18\x02 \x01(\x0b\x32\'.immudb.schema.DatabaseNullableSettings\"\x1f\n\x0eNullableUint32\x12\r\n\x05value\x18\x01 \x01(\r\"\x1f\n\x0eNullableUint64\x12\r\n\x05value\x18\x01 \x01(\x04\"\x1e\n\rNullableFloat\x12\r\n\x05value\x18\x01 \x01(\x02\"\x1d\n\x0cNullableBool\x12\r\n\x05value\x18\x01 \x01(\x08\"\x1f\n\x0eNullableString\x12\r\n\x05value\x18\x01 \x01(\t\"%\n\x14NullableMilliseconds\x12\r\n\x05value\x18\x01 \x01(\x03\"\xaf\x0b\n\x18\x44\x61tabaseNullableSettings\x12G\n\x13replicationSettings\x18\x02 \x01(\x0b\x32*.immudb.schema.ReplicationNullableSettings\x12/\n\x08\x66ileSize\x18\x08 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x30\n\tmaxKeyLen\x18\t \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x32\n\x0bmaxValueLen\x18\n \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x33\n\x0cmaxTxEntries\x18\x0b \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x36\n\x11\x65xcludeCommitTime\x18\x0c \x01(\x0b\x32\x1b.immudb.schema.NullableBool\x12\x35\n\x0emaxConcurrency\x18\r \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x37\n\x10maxIOConcurrency\x18\x0e \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x35\n\x0etxLogCacheSize\x18\x0f \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x39\n\x12vLogMaxOpenedFiles\x18\x10 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12:\n\x13txLogMaxOpenedFiles\x18\x11 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12>\n\x17\x63ommitLogMaxOpenedFiles\x18\x12 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12;\n\rindexSettings\x18\x13 \x01(\x0b\x32$.immudb.schema.IndexNullableSettings\x12;\n\x14writeTxHeaderVersion\x18\x14 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12-\n\x08\x61utoload\x18\x15 \x01(\x0b\x32\x1b.immudb.schema.NullableBool\x12\x35\n\x0ereadTxPoolSize\x18\x16 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12:\n\rsyncFrequency\x18\x17 \x01(\x0b\x32#.immudb.schema.NullableMilliseconds\x12\x36\n\x0fwriteBufferSize\x18\x18 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x37\n\x0b\x61htSettings\x18\x19 \x01(\x0b\x32\".immudb.schema.AHTNullableSettings\x12<\n\x15maxActiveTransactions\x18\x1a \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x37\n\x10mvccReadSetLimit\x18\x1b \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x34\n\rvLogCacheSize\x18\x1c \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x45\n\x12truncationSettings\x18\x1d \x01(\x0b\x32).immudb.schema.TruncationNullableSettings\x12\x33\n\x0e\x65mbeddedValues\x18\x1e \x01(\x0b\x32\x1b.immudb.schema.NullableBool\x12\x32\n\rpreallocFiles\x18\x1f \x01(\x0b\x32\x1b.immudb.schema.NullableBool\"\xeb\x05\n\x1bReplicationNullableSettings\x12,\n\x07replica\x18\x01 \x01(\x0b\x32\x1b.immudb.schema.NullableBool\x12\x36\n\x0fprimaryDatabase\x18\x02 \x01(\x0b\x32\x1d.immudb.schema.NullableString\x12\x32\n\x0bprimaryHost\x18\x03 \x01(\x0b\x32\x1d.immudb.schema.NullableString\x12\x32\n\x0bprimaryPort\x18\x04 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x36\n\x0fprimaryUsername\x18\x05 \x01(\x0b\x32\x1d.immudb.schema.NullableString\x12\x36\n\x0fprimaryPassword\x18\x06 \x01(\x0b\x32\x1d.immudb.schema.NullableString\x12\x34\n\x0fsyncReplication\x18\x07 \x01(\x0b\x32\x1b.immudb.schema.NullableBool\x12/\n\x08syncAcks\x18\x08 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12;\n\x14prefetchTxBufferSize\x18\t \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x43\n\x1creplicationCommitConcurrency\x18\n \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x36\n\x11\x61llowTxDiscarding\x18\x0b \x01(\x0b\x32\x1b.immudb.schema.NullableBool\x12\x37\n\x12skipIntegrityCheck\x18\x0c \x01(\x0b\x32\x1b.immudb.schema.NullableBool\x12\x34\n\x0fwaitForIndexing\x18\r \x01(\x0b\x32\x1b.immudb.schema.NullableBool\"\x9c\x01\n\x1aTruncationNullableSettings\x12<\n\x0fretentionPeriod\x18\x01 \x01(\x0b\x32#.immudb.schema.NullableMilliseconds\x12@\n\x13truncationFrequency\x18\x02 \x01(\x0b\x32#.immudb.schema.NullableMilliseconds\"\xff\x06\n\x15IndexNullableSettings\x12\x35\n\x0e\x66lushThreshold\x18\x01 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x34\n\rsyncThreshold\x18\x02 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x30\n\tcacheSize\x18\x03 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x32\n\x0bmaxNodeSize\x18\x04 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x39\n\x12maxActiveSnapshots\x18\x05 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x39\n\x12renewSnapRootAfter\x18\x06 \x01(\x0b\x32\x1d.immudb.schema.NullableUint64\x12\x35\n\x0e\x63ompactionThld\x18\x07 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12<\n\x15\x64\x65layDuringCompaction\x18\x08 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12=\n\x16nodesLogMaxOpenedFiles\x18\t \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12?\n\x18historyLogMaxOpenedFiles\x18\n \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12>\n\x17\x63ommitLogMaxOpenedFiles\x18\x0b \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x36\n\x0f\x66lushBufferSize\x18\x0c \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x37\n\x11\x63leanupPercentage\x18\r \x01(\x0b\x32\x1c.immudb.schema.NullableFloat\x12\x32\n\x0bmaxBulkSize\x18\x0e \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x43\n\x16\x62ulkPreparationTimeout\x18\x0f \x01(\x0b\x32#.immudb.schema.NullableMilliseconds\"\x83\x01\n\x13\x41HTNullableSettings\x12\x34\n\rsyncThreshold\x18\x01 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\x12\x36\n\x0fwriteBufferSize\x18\x02 \x01(\x0b\x32\x1d.immudb.schema.NullableUint32\"\'\n\x13LoadDatabaseRequest\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\"(\n\x14LoadDatabaseResponse\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\")\n\x15UnloadDatabaseRequest\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\"*\n\x16UnloadDatabaseResponse\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\")\n\x15\x44\x65leteDatabaseRequest\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\"*\n\x16\x44\x65leteDatabaseResponse\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\">\n\x11\x46lushIndexRequest\x12\x19\n\x11\x63leanupPercentage\x18\x01 \x01(\x02\x12\x0e\n\x06synced\x18\x02 \x01(\x08\"&\n\x12\x46lushIndexResponse\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\"\x1a\n\x05Table\x12\x11\n\ttableName\x18\x01 \x01(\t\"h\n\rSQLGetRequest\x12\r\n\x05table\x18\x01 \x01(\t\x12)\n\x08pkValues\x18\x02 \x03(\x0b\x32\x17.immudb.schema.SQLValue\x12\x0c\n\x04\x61tTx\x18\x03 \x01(\x04\x12\x0f\n\x07sinceTx\x18\x04 \x01(\x04\"d\n\x17VerifiableSQLGetRequest\x12\x33\n\rsqlGetRequest\x18\x01 \x01(\x0b\x32\x1c.immudb.schema.SQLGetRequest\x12\x14\n\x0cproveSinceTx\x18\x02 \x01(\x04\"_\n\x08SQLEntry\x12\n\n\x02tx\x18\x01 \x01(\x04\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12\r\n\x05value\x18\x03 \x01(\x0c\x12+\n\x08metadata\x18\x04 \x01(\x0b\x32\x19.immudb.schema.KVMetadata\"\xef\x05\n\x12VerifiableSQLEntry\x12)\n\x08sqlEntry\x18\x01 \x01(\x0b\x32\x17.immudb.schema.SQLEntry\x12\x31\n\x0cverifiableTx\x18\x02 \x01(\x0b\x32\x1b.immudb.schema.VerifiableTx\x12\x35\n\x0einclusionProof\x18\x03 \x01(\x0b\x32\x1d.immudb.schema.InclusionProof\x12\x12\n\nDatabaseId\x18\x04 \x01(\r\x12\x0f\n\x07TableId\x18\x05 \x01(\r\x12\r\n\x05PKIDs\x18\x10 \x03(\r\x12I\n\x0c\x43olNamesById\x18\x08 \x03(\x0b\x32\x33.immudb.schema.VerifiableSQLEntry.ColNamesByIdEntry\x12I\n\x0c\x43olIdsByName\x18\t \x03(\x0b\x32\x33.immudb.schema.VerifiableSQLEntry.ColIdsByNameEntry\x12I\n\x0c\x43olTypesById\x18\n \x03(\x0b\x32\x33.immudb.schema.VerifiableSQLEntry.ColTypesByIdEntry\x12\x45\n\nColLenById\x18\x0b \x03(\x0b\x32\x31.immudb.schema.VerifiableSQLEntry.ColLenByIdEntry\x12\x10\n\x08MaxColId\x18\x0c \x01(\r\x1a\x33\n\x11\x43olNamesByIdEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11\x43olIdsByNameEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\r:\x02\x38\x01\x1a\x33\n\x11\x43olTypesByIdEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0f\x43olLenByIdEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01J\x04\x08\x06\x10\x07\"!\n\x10UseDatabaseReply\x12\r\n\x05token\x18\x01 \x01(\t\"\x82\x01\n\x17\x43hangePermissionRequest\x12/\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x1f.immudb.schema.PermissionAction\x12\x10\n\x08username\x18\x02 \x01(\t\x12\x10\n\x08\x64\x61tabase\x18\x03 \x01(\t\x12\x12\n\npermission\x18\x04 \x01(\r\"8\n\x14SetActiveUserRequest\x12\x0e\n\x06\x61\x63tive\x18\x01 \x01(\x08\x12\x10\n\x08username\x18\x02 \x01(\t\"B\n\x14\x44\x61tabaseListResponse\x12*\n\tdatabases\x18\x01 \x03(\x0b\x32\x17.immudb.schema.Database\"\x17\n\x15\x44\x61tabaseListRequestV2\"H\n\x16\x44\x61tabaseListResponseV2\x12.\n\tdatabases\x18\x01 \x03(\x0b\x32\x1b.immudb.schema.DatabaseInfo\"\x92\x01\n\x0c\x44\x61tabaseInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x39\n\x08settings\x18\x02 \x01(\x0b\x32\'.immudb.schema.DatabaseNullableSettings\x12\x0e\n\x06loaded\x18\x03 \x01(\x08\x12\x10\n\x08\x64iskSize\x18\x04 \x01(\x04\x12\x17\n\x0fnumTransactions\x18\x05 \x01(\x04\"\x7f\n\x05\x43hunk\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12\x34\n\x08metadata\x18\x02 \x03(\x0b\x32\".immudb.schema.Chunk.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01\"9\n\x12UseSnapshotRequest\x12\x0f\n\x07sinceTx\x18\x01 \x01(\x04\x12\x12\n\nasBeforeTx\x18\x02 \x01(\x04\"X\n\x0eSQLExecRequest\x12\x0b\n\x03sql\x18\x01 \x01(\t\x12)\n\x06params\x18\x02 \x03(\x0b\x32\x19.immudb.schema.NamedParam\x12\x0e\n\x06noWait\x18\x03 \x01(\x08\"z\n\x0fSQLQueryRequest\x12\x0b\n\x03sql\x18\x01 \x01(\t\x12)\n\x06params\x18\x02 \x03(\x0b\x32\x19.immudb.schema.NamedParam\x12\x19\n\rreuseSnapshot\x18\x03 \x01(\x08\x42\x02\x18\x01\x12\x14\n\x0c\x61\x63\x63\x65ptStream\x18\x04 \x01(\x08\"B\n\nNamedParam\x12\x0c\n\x04name\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.immudb.schema.SQLValue\"N\n\rSQLExecResult\x12*\n\x03txs\x18\x05 \x03(\x0b\x32\x1d.immudb.schema.CommittedSQLTx\x12\x11\n\tongoingTx\x18\x06 \x01(\x08\"\x8d\x03\n\x0e\x43ommittedSQLTx\x12\'\n\x06header\x18\x01 \x01(\x0b\x32\x17.immudb.schema.TxHeader\x12\x13\n\x0bupdatedRows\x18\x02 \x01(\r\x12K\n\x0flastInsertedPKs\x18\x03 \x03(\x0b\x32\x32.immudb.schema.CommittedSQLTx.LastInsertedPKsEntry\x12M\n\x10\x66irstInsertedPKs\x18\x04 \x03(\x0b\x32\x33.immudb.schema.CommittedSQLTx.FirstInsertedPKsEntry\x1aO\n\x14LastInsertedPKsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.immudb.schema.SQLValue:\x02\x38\x01\x1aP\n\x15\x46irstInsertedPKsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.immudb.schema.SQLValue:\x02\x38\x01\"Z\n\x0eSQLQueryResult\x12&\n\x07\x63olumns\x18\x02 \x03(\x0b\x32\x15.immudb.schema.Column\x12 \n\x04rows\x18\x01 \x03(\x0b\x32\x12.immudb.schema.Row\"$\n\x06\x43olumn\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\"?\n\x03Row\x12\x0f\n\x07\x63olumns\x18\x01 \x03(\t\x12\'\n\x06values\x18\x02 \x03(\x0b\x32\x17.immudb.schema.SQLValue\"\x8f\x01\n\x08SQLValue\x12*\n\x04null\x18\x01 \x01(\x0e\x32\x1a.google.protobuf.NullValueH\x00\x12\x0b\n\x01n\x18\x02 \x01(\x03H\x00\x12\x0b\n\x01s\x18\x03 \x01(\tH\x00\x12\x0b\n\x01\x62\x18\x04 \x01(\x08H\x00\x12\x0c\n\x02\x62s\x18\x05 \x01(\x0cH\x00\x12\x0c\n\x02ts\x18\x06 \x01(\x03H\x00\x12\x0b\n\x01\x66\x18\x07 \x01(\x01H\x00\x42\x07\n\x05value\"\xcb\x01\n\x0cNewTxRequest\x12#\n\x04mode\x18\x01 \x01(\x0e\x32\x15.immudb.schema.TxMode\x12>\n\x17snapshotMustIncludeTxID\x18\x02 \x01(\x0b\x32\x1d.immudb.schema.NullableUint64\x12\x42\n\x15snapshotRenewalPeriod\x18\x03 \x01(\x0b\x32#.immudb.schema.NullableMilliseconds\x12\x12\n\nunsafeMVCC\x18\x04 \x01(\x08\"&\n\rNewTxResponse\x12\x15\n\rtransactionID\x18\x01 \x01(\t\"(\n\tErrorInfo\x12\x0c\n\x04\x63ode\x18\x01 \x01(\t\x12\r\n\x05\x63\x61use\x18\x02 \x01(\t\"\x1a\n\tDebugInfo\x12\r\n\x05stack\x18\x01 \x01(\t\" \n\tRetryInfo\x12\x13\n\x0bretry_delay\x18\x01 \x01(\x05\"D\n\x17TruncateDatabaseRequest\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t\x12\x17\n\x0fretentionPeriod\x18\x02 \x01(\x03\",\n\x18TruncateDatabaseResponse\x12\x10\n\x08\x64\x61tabase\x18\x01 \x01(\t*K\n\x0f\x45ntryTypeAction\x12\x0b\n\x07\x45XCLUDE\x10\x00\x12\x0f\n\x0bONLY_DIGEST\x10\x01\x12\r\n\tRAW_VALUE\x10\x02\x12\x0b\n\x07RESOLVE\x10\x03*)\n\x10PermissionAction\x12\t\n\x05GRANT\x10\x00\x12\n\n\x06REVOKE\x10\x01*4\n\x06TxMode\x12\x0c\n\x08ReadOnly\x10\x00\x12\r\n\tWriteOnly\x10\x01\x12\r\n\tReadWrite\x10\x02\x32\x8d\x35\n\x0bImmuService\x12P\n\tListUsers\x12\x16.google.protobuf.Empty\x1a\x17.immudb.schema.UserList\"\x12\x82\xd3\xe4\x93\x02\x0c\x12\n/user/list\x12X\n\nCreateUser\x12 .immudb.schema.CreateUserRequest\x1a\x16.google.protobuf.Empty\"\x10\x82\xd3\xe4\x93\x02\n\"\x05/user:\x01*\x12p\n\x0e\x43hangePassword\x12$.immudb.schema.ChangePasswordRequest\x1a\x16.google.protobuf.Empty\" \x82\xd3\xe4\x93\x02\x1a\"\x15/user/password/change:\x01*\x12u\n\x10\x43hangePermission\x12&.immudb.schema.ChangePermissionRequest\x1a\x16.google.protobuf.Empty\"!\x82\xd3\xe4\x93\x02\x1b\"\x16/user/changepermission:\x01*\x12l\n\rSetActiveUser\x12#.immudb.schema.SetActiveUserRequest\x1a\x16.google.protobuf.Empty\"\x1e\x82\xd3\xe4\x93\x02\x18\"\x13/user/setactiveUser:\x01*\x12J\n\x10UpdateAuthConfig\x12\x19.immudb.schema.AuthConfig\x1a\x16.google.protobuf.Empty\"\x03\x88\x02\x01\x12J\n\x10UpdateMTLSConfig\x12\x19.immudb.schema.MTLSConfig\x1a\x16.google.protobuf.Empty\"\x03\x88\x02\x01\x12V\n\x0bOpenSession\x12!.immudb.schema.OpenSessionRequest\x1a\".immudb.schema.OpenSessionResponse\"\x00\x12@\n\x0c\x43loseSession\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12=\n\tKeepAlive\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12\x44\n\x05NewTx\x12\x1b.immudb.schema.NewTxRequest\x1a\x1c.immudb.schema.NewTxResponse\"\x00\x12\x41\n\x06\x43ommit\x12\x16.google.protobuf.Empty\x1a\x1d.immudb.schema.CommittedSQLTx\"\x00\x12<\n\x08Rollback\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12\x44\n\tTxSQLExec\x12\x1d.immudb.schema.SQLExecRequest\x1a\x16.google.protobuf.Empty\"\x00\x12O\n\nTxSQLQuery\x12\x1e.immudb.schema.SQLQueryRequest\x1a\x1d.immudb.schema.SQLQueryResult\"\x00\x30\x01\x12X\n\x05Login\x12\x1b.immudb.schema.LoginRequest\x1a\x1c.immudb.schema.LoginResponse\"\x14\x88\x02\x01\x82\xd3\xe4\x93\x02\x0b\"\x06/login:\x01*\x12O\n\x06Logout\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x15\x88\x02\x01\x82\xd3\xe4\x93\x02\x0c\"\x07/logout:\x01*\x12M\n\x03Set\x12\x19.immudb.schema.SetRequest\x1a\x17.immudb.schema.TxHeader\"\x12\x82\xd3\xe4\x93\x02\x0c\"\x07/db/set:\x01*\x12p\n\rVerifiableSet\x12#.immudb.schema.VerifiableSetRequest\x1a\x1b.immudb.schema.VerifiableTx\"\x1d\x82\xd3\xe4\x93\x02\x17\"\x12/db/verifiable/set:\x01*\x12M\n\x03Get\x12\x19.immudb.schema.KeyRequest\x1a\x14.immudb.schema.Entry\"\x15\x82\xd3\xe4\x93\x02\x0f\x12\r/db/get/{key}\x12s\n\rVerifiableGet\x12#.immudb.schema.VerifiableGetRequest\x1a\x1e.immudb.schema.VerifiableEntry\"\x1d\x82\xd3\xe4\x93\x02\x17\"\x12/db/verifiable/get:\x01*\x12]\n\x06\x44\x65lete\x12 .immudb.schema.DeleteKeysRequest\x1a\x17.immudb.schema.TxHeader\"\x18\x82\xd3\xe4\x93\x02\x12\"\r/db/deletekey:\x01*\x12V\n\x06GetAll\x12\x1d.immudb.schema.KeyListRequest\x1a\x16.immudb.schema.Entries\"\x15\x82\xd3\xe4\x93\x02\x0f\"\n/db/getall:\x01*\x12Y\n\x07\x45xecAll\x12\x1d.immudb.schema.ExecAllRequest\x1a\x17.immudb.schema.TxHeader\"\x16\x82\xd3\xe4\x93\x02\x10\"\x0b/db/execall:\x01*\x12O\n\x04Scan\x12\x1a.immudb.schema.ScanRequest\x1a\x16.immudb.schema.Entries\"\x13\x82\xd3\xe4\x93\x02\r\"\x08/db/scan:\x01*\x12X\n\x05\x43ount\x12\x18.immudb.schema.KeyPrefix\x1a\x19.immudb.schema.EntryCount\"\x1a\x82\xd3\xe4\x93\x02\x14\x12\x12/db/count/{prefix}\x12S\n\x08\x43ountAll\x12\x16.google.protobuf.Empty\x1a\x19.immudb.schema.EntryCount\"\x14\x82\xd3\xe4\x93\x02\x0e\x12\x0c/db/countall\x12J\n\x06TxById\x12\x18.immudb.schema.TxRequest\x1a\x11.immudb.schema.Tx\"\x13\x82\xd3\xe4\x93\x02\r\x12\x0b/db/tx/{tx}\x12s\n\x10VerifiableTxById\x12\".immudb.schema.VerifiableTxRequest\x1a\x1b.immudb.schema.VerifiableTx\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/db/verifiable/tx/{tx}\x12P\n\x06TxScan\x12\x1c.immudb.schema.TxScanRequest\x1a\x15.immudb.schema.TxList\"\x11\x82\xd3\xe4\x93\x02\x0b\"\x06/db/tx:\x01*\x12X\n\x07History\x12\x1d.immudb.schema.HistoryRequest\x1a\x16.immudb.schema.Entries\"\x16\x82\xd3\xe4\x93\x02\x10\"\x0b/db/history:\x01*\x12\x66\n\nServerInfo\x12 .immudb.schema.ServerInfoRequest\x1a!.immudb.schema.ServerInfoResponse\"\x13\x82\xd3\xe4\x93\x02\r\x12\x0b/serverinfo\x12P\n\x06Health\x12\x16.google.protobuf.Empty\x1a\x1d.immudb.schema.HealthResponse\"\x0f\x82\xd3\xe4\x93\x02\t\x12\x07/health\x12\x63\n\x0e\x44\x61tabaseHealth\x12\x16.google.protobuf.Empty\x1a%.immudb.schema.DatabaseHealthResponse\"\x12\x82\xd3\xe4\x93\x02\x0c\x12\n/db/health\x12X\n\x0c\x43urrentState\x12\x16.google.protobuf.Empty\x1a\x1d.immudb.schema.ImmutableState\"\x11\x82\xd3\xe4\x93\x02\x0b\x12\t/db/state\x12\x65\n\x0cSetReference\x12\x1f.immudb.schema.ReferenceRequest\x1a\x17.immudb.schema.TxHeader\"\x1b\x82\xd3\xe4\x93\x02\x15\"\x10/db/setreference:\x01*\x12\x88\x01\n\x16VerifiableSetReference\x12).immudb.schema.VerifiableReferenceRequest\x1a\x1b.immudb.schema.VerifiableTx\"&\x82\xd3\xe4\x93\x02 \"\x1b/db/verifiable/setreference:\x01*\x12P\n\x04ZAdd\x12\x1a.immudb.schema.ZAddRequest\x1a\x17.immudb.schema.TxHeader\"\x13\x82\xd3\xe4\x93\x02\r\"\x08/db/zadd:\x01*\x12s\n\x0eVerifiableZAdd\x12$.immudb.schema.VerifiableZAddRequest\x1a\x1b.immudb.schema.VerifiableTx\"\x1e\x82\xd3\xe4\x93\x02\x18\"\x13/db/verifiable/zadd:\x01*\x12S\n\x05ZScan\x12\x1b.immudb.schema.ZScanRequest\x1a\x17.immudb.schema.ZEntries\"\x14\x82\xd3\xe4\x93\x02\x0e\"\t/db/zscan:\x01*\x12[\n\x0e\x43reateDatabase\x12\x17.immudb.schema.Database\x1a\x16.google.protobuf.Empty\"\x18\x88\x02\x01\x82\xd3\xe4\x93\x02\x0f\"\n/db/create:\x01*\x12k\n\x12\x43reateDatabaseWith\x12\x1f.immudb.schema.DatabaseSettings\x1a\x16.google.protobuf.Empty\"\x1c\x88\x02\x01\x82\xd3\xe4\x93\x02\x13\"\x0e/db/createwith:\x01*\x12y\n\x10\x43reateDatabaseV2\x12$.immudb.schema.CreateDatabaseRequest\x1a%.immudb.schema.CreateDatabaseResponse\"\x18\x82\xd3\xe4\x93\x02\x12\"\r/db/create/v2:\x01*\x12l\n\x0cLoadDatabase\x12\".immudb.schema.LoadDatabaseRequest\x1a#.immudb.schema.LoadDatabaseResponse\"\x13\x82\xd3\xe4\x93\x02\r\"\x08/db/load:\x01*\x12t\n\x0eUnloadDatabase\x12$.immudb.schema.UnloadDatabaseRequest\x1a%.immudb.schema.UnloadDatabaseResponse\"\x15\x82\xd3\xe4\x93\x02\x0f\"\n/db/unload:\x01*\x12t\n\x0e\x44\x65leteDatabase\x12$.immudb.schema.DeleteDatabaseRequest\x1a%.immudb.schema.DeleteDatabaseResponse\"\x15\x82\xd3\xe4\x93\x02\x0f\"\n/db/delete:\x01*\x12\x63\n\x0c\x44\x61tabaseList\x12\x16.google.protobuf.Empty\x1a#.immudb.schema.DatabaseListResponse\"\x16\x88\x02\x01\x82\xd3\xe4\x93\x02\r\"\x08/db/list:\x01*\x12u\n\x0e\x44\x61tabaseListV2\x12$.immudb.schema.DatabaseListRequestV2\x1a%.immudb.schema.DatabaseListResponseV2\"\x16\x82\xd3\xe4\x93\x02\x10\"\x0b/db/list/v2:\x01*\x12g\n\x0bUseDatabase\x12\x17.immudb.schema.Database\x1a\x1f.immudb.schema.UseDatabaseReply\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/db/use/{databaseName}\x12\x63\n\x0eUpdateDatabase\x12\x1f.immudb.schema.DatabaseSettings\x1a\x16.google.protobuf.Empty\"\x18\x88\x02\x01\x82\xd3\xe4\x93\x02\x0f\"\n/db/update:\x01*\x12y\n\x10UpdateDatabaseV2\x12$.immudb.schema.UpdateDatabaseRequest\x1a%.immudb.schema.UpdateDatabaseResponse\"\x18\x82\xd3\xe4\x93\x02\x12\"\r/db/update/v2:\x01*\x12j\n\x13GetDatabaseSettings\x12\x16.google.protobuf.Empty\x1a\x1f.immudb.schema.DatabaseSettings\"\x1a\x88\x02\x01\x82\xd3\xe4\x93\x02\x11\"\x0c/db/settings:\x01*\x12\x84\x01\n\x15GetDatabaseSettingsV2\x12&.immudb.schema.DatabaseSettingsRequest\x1a\'.immudb.schema.DatabaseSettingsResponse\"\x1a\x82\xd3\xe4\x93\x02\x14\"\x0f/db/settings/v2:\x01*\x12i\n\nFlushIndex\x12 .immudb.schema.FlushIndexRequest\x1a!.immudb.schema.FlushIndexResponse\"\x16\x82\xd3\xe4\x93\x02\x10\x12\x0e/db/flushindex\x12X\n\x0c\x43ompactIndex\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x18\x82\xd3\xe4\x93\x02\x12\x12\x10/db/compactindex\x12@\n\tstreamGet\x12\x19.immudb.schema.KeyRequest\x1a\x14.immudb.schema.Chunk\"\x00\x30\x01\x12>\n\tstreamSet\x12\x14.immudb.schema.Chunk\x1a\x17.immudb.schema.TxHeader\"\x00(\x01\x12T\n\x13streamVerifiableGet\x12#.immudb.schema.VerifiableGetRequest\x1a\x14.immudb.schema.Chunk\"\x00\x30\x01\x12L\n\x13streamVerifiableSet\x12\x14.immudb.schema.Chunk\x1a\x1b.immudb.schema.VerifiableTx\"\x00(\x01\x12\x42\n\nstreamScan\x12\x1a.immudb.schema.ScanRequest\x1a\x14.immudb.schema.Chunk\"\x00\x30\x01\x12\x44\n\x0bstreamZScan\x12\x1b.immudb.schema.ZScanRequest\x1a\x14.immudb.schema.Chunk\"\x00\x30\x01\x12H\n\rstreamHistory\x12\x1d.immudb.schema.HistoryRequest\x1a\x14.immudb.schema.Chunk\"\x00\x30\x01\x12\x42\n\rstreamExecAll\x12\x14.immudb.schema.Chunk\x1a\x17.immudb.schema.TxHeader\"\x00(\x01\x12\x44\n\x08\x65xportTx\x12\x1e.immudb.schema.ExportTxRequest\x1a\x14.immudb.schema.Chunk\"\x00\x30\x01\x12@\n\x0breplicateTx\x12\x14.immudb.schema.Chunk\x1a\x17.immudb.schema.TxHeader\"\x00(\x01\x12L\n\x0estreamExportTx\x12\x1e.immudb.schema.ExportTxRequest\x1a\x14.immudb.schema.Chunk\"\x00(\x01\x30\x01\x12^\n\x07SQLExec\x12\x1d.immudb.schema.SQLExecRequest\x1a\x1c.immudb.schema.SQLExecResult\"\x16\x82\xd3\xe4\x93\x02\x10\"\x0b/db/sqlexec:\x01*\x12g\n\rUnarySQLQuery\x12\x1e.immudb.schema.SQLQueryRequest\x1a\x1d.immudb.schema.SQLQueryResult\"\x17\x82\xd3\xe4\x93\x02\x11\"\x0c/db/sqlquery:\x01*\x12\x64\n\x08SQLQuery\x12\x1e.immudb.schema.SQLQueryRequest\x1a\x1d.immudb.schema.SQLQueryResult\"\x17\x82\xd3\xe4\x93\x02\x11\"\x0c/db/sqlquery:\x01*0\x01\x12[\n\nListTables\x12\x16.google.protobuf.Empty\x1a\x1d.immudb.schema.SQLQueryResult\"\x16\x82\xd3\xe4\x93\x02\x10\x12\x0e/db/table/list\x12[\n\rDescribeTable\x12\x14.immudb.schema.Table\x1a\x1d.immudb.schema.SQLQueryResult\"\x15\x82\xd3\xe4\x93\x02\x0f\"\n/db/tables:\x01*\x12\x7f\n\x10VerifiableSQLGet\x12&.immudb.schema.VerifiableSQLGetRequest\x1a!.immudb.schema.VerifiableSQLEntry\" \x82\xd3\xe4\x93\x02\x1a\"\x15/db/verifiable/sqlget:\x01*\x12|\n\x10TruncateDatabase\x12&.immudb.schema.TruncateDatabaseRequest\x1a\'.immudb.schema.TruncateDatabaseResponse\"\x17\x82\xd3\xe4\x93\x02\x11\"\x0c/db/truncate:\x01*B-Z+github.com/codenotary/immudb/pkg/api/schemab\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -33,6 +33,10 @@ _globals['_VERIFIABLESQLENTRY_COLTYPESBYIDENTRY']._serialized_options = b'8\001' _globals['_VERIFIABLESQLENTRY_COLLENBYIDENTRY']._options = None _globals['_VERIFIABLESQLENTRY_COLLENBYIDENTRY']._serialized_options = b'8\001' + _globals['_CHUNK_METADATAENTRY']._options = None + _globals['_CHUNK_METADATAENTRY']._serialized_options = b'8\001' + _globals['_SQLQUERYREQUEST'].fields_by_name['reuseSnapshot']._options = None + _globals['_SQLQUERYREQUEST'].fields_by_name['reuseSnapshot']._serialized_options = b'\030\001' _globals['_COMMITTEDSQLTX_LASTINSERTEDPKSENTRY']._options = None _globals['_COMMITTEDSQLTX_LASTINSERTEDPKSENTRY']._serialized_options = b'8\001' _globals['_COMMITTEDSQLTX_FIRSTINSERTEDPKSENTRY']._options = None @@ -64,7 +68,7 @@ _globals['_IMMUSERVICE'].methods_by_name['VerifiableGet']._options = None _globals['_IMMUSERVICE'].methods_by_name['VerifiableGet']._serialized_options = b'\202\323\344\223\002\027\"\022/db/verifiable/get:\001*' _globals['_IMMUSERVICE'].methods_by_name['Delete']._options = None - _globals['_IMMUSERVICE'].methods_by_name['Delete']._serialized_options = b'\202\323\344\223\002\017\"\n/db/delete:\001*' + _globals['_IMMUSERVICE'].methods_by_name['Delete']._serialized_options = b'\202\323\344\223\002\022\"\r/db/deletekey:\001*' _globals['_IMMUSERVICE'].methods_by_name['GetAll']._options = None _globals['_IMMUSERVICE'].methods_by_name['GetAll']._serialized_options = b'\202\323\344\223\002\017\"\n/db/getall:\001*' _globals['_IMMUSERVICE'].methods_by_name['ExecAll']._options = None @@ -133,6 +137,8 @@ _globals['_IMMUSERVICE'].methods_by_name['CompactIndex']._serialized_options = b'\202\323\344\223\002\022\022\020/db/compactindex' _globals['_IMMUSERVICE'].methods_by_name['SQLExec']._options = None _globals['_IMMUSERVICE'].methods_by_name['SQLExec']._serialized_options = b'\202\323\344\223\002\020\"\013/db/sqlexec:\001*' + _globals['_IMMUSERVICE'].methods_by_name['UnarySQLQuery']._options = None + _globals['_IMMUSERVICE'].methods_by_name['UnarySQLQuery']._serialized_options = b'\202\323\344\223\002\021\"\014/db/sqlquery:\001*' _globals['_IMMUSERVICE'].methods_by_name['SQLQuery']._options = None _globals['_IMMUSERVICE'].methods_by_name['SQLQuery']._serialized_options = b'\202\323\344\223\002\021\"\014/db/sqlquery:\001*' _globals['_IMMUSERVICE'].methods_by_name['ListTables']._options = None @@ -141,12 +147,14 @@ _globals['_IMMUSERVICE'].methods_by_name['DescribeTable']._serialized_options = b'\202\323\344\223\002\017\"\n/db/tables:\001*' _globals['_IMMUSERVICE'].methods_by_name['VerifiableSQLGet']._options = None _globals['_IMMUSERVICE'].methods_by_name['VerifiableSQLGet']._serialized_options = b'\202\323\344\223\002\032\"\025/db/verifiable/sqlget:\001*' - _globals['_ENTRYTYPEACTION']._serialized_start=12968 - _globals['_ENTRYTYPEACTION']._serialized_end=13043 - _globals['_PERMISSIONACTION']._serialized_start=13045 - _globals['_PERMISSIONACTION']._serialized_end=13086 - _globals['_TXMODE']._serialized_start=13088 - _globals['_TXMODE']._serialized_end=13140 + _globals['_IMMUSERVICE'].methods_by_name['TruncateDatabase']._options = None + _globals['_IMMUSERVICE'].methods_by_name['TruncateDatabase']._serialized_options = b'\202\323\344\223\002\021\"\014/db/truncate:\001*' + _globals['_ENTRYTYPEACTION']._serialized_start=15343 + _globals['_ENTRYTYPEACTION']._serialized_end=15418 + _globals['_PERMISSIONACTION']._serialized_start=15420 + _globals['_PERMISSIONACTION']._serialized_end=15461 + _globals['_TXMODE']._serialized_start=15463 + _globals['_TXMODE']._serialized_end=15515 _globals['_KEY']._serialized_start=120 _globals['_KEY']._serialized_end=138 _globals['_PERMISSION']._serialized_start=140 @@ -208,195 +216,211 @@ _globals['_TXHEADER']._serialized_start=2459 _globals['_TXHEADER']._serialized_end=2634 _globals['_TXMETADATA']._serialized_start=2636 - _globals['_TXMETADATA']._serialized_end=2648 - _globals['_LINEARPROOF']._serialized_start=2650 - _globals['_LINEARPROOF']._serialized_end=2718 - _globals['_DUALPROOF']._serialized_start=2721 - _globals['_DUALPROOF']._serialized_end=2980 - _globals['_TX']._serialized_start=2983 - _globals['_TX']._serialized_end=3151 - _globals['_TXENTRY']._serialized_start=3153 - _globals['_TXENTRY']._serialized_end=3265 - _globals['_KVMETADATA']._serialized_start=3267 - _globals['_KVMETADATA']._serialized_end=3365 - _globals['_EXPIRATION']._serialized_start=3367 - _globals['_EXPIRATION']._serialized_end=3398 - _globals['_VERIFIABLETX']._serialized_start=3401 - _globals['_VERIFIABLETX']._serialized_end=3536 - _globals['_VERIFIABLEENTRY']._serialized_start=3539 - _globals['_VERIFIABLEENTRY']._serialized_end=3699 - _globals['_INCLUSIONPROOF']._serialized_start=3701 - _globals['_INCLUSIONPROOF']._serialized_end=3761 - _globals['_SETREQUEST']._serialized_start=3763 - _globals['_SETREQUEST']._serialized_end=3881 - _globals['_KEYREQUEST']._serialized_start=3883 - _globals['_KEYREQUEST']._serialized_end=3975 - _globals['_KEYLISTREQUEST']._serialized_start=3977 - _globals['_KEYLISTREQUEST']._serialized_end=4024 - _globals['_DELETEKEYSREQUEST']._serialized_start=4026 - _globals['_DELETEKEYSREQUEST']._serialized_end=4092 - _globals['_VERIFIABLESETREQUEST']._serialized_start=4094 - _globals['_VERIFIABLESETREQUEST']._serialized_end=4185 - _globals['_VERIFIABLEGETREQUEST']._serialized_start=4187 - _globals['_VERIFIABLEGETREQUEST']._serialized_end=4278 - _globals['_SERVERINFOREQUEST']._serialized_start=4280 - _globals['_SERVERINFOREQUEST']._serialized_end=4299 - _globals['_SERVERINFORESPONSE']._serialized_start=4301 - _globals['_SERVERINFORESPONSE']._serialized_end=4338 - _globals['_HEALTHRESPONSE']._serialized_start=4340 - _globals['_HEALTHRESPONSE']._serialized_end=4389 - _globals['_DATABASEHEALTHRESPONSE']._serialized_start=4391 - _globals['_DATABASEHEALTHRESPONSE']._serialized_end=4472 - _globals['_IMMUTABLESTATE']._serialized_start=4474 - _globals['_IMMUTABLESTATE']._serialized_end=4577 - _globals['_REFERENCEREQUEST']._serialized_start=4580 - _globals['_REFERENCEREQUEST']._serialized_end=4734 - _globals['_VERIFIABLEREFERENCEREQUEST']._serialized_start=4736 - _globals['_VERIFIABLEREFERENCEREQUEST']._serialized_end=4845 - _globals['_ZADDREQUEST']._serialized_start=4847 - _globals['_ZADDREQUEST']._serialized_end=4949 - _globals['_SCORE']._serialized_start=4951 - _globals['_SCORE']._serialized_end=4973 - _globals['_ZSCANREQUEST']._serialized_start=4976 - _globals['_ZSCANREQUEST']._serialized_end=5238 - _globals['_HISTORYREQUEST']._serialized_start=5240 - _globals['_HISTORYREQUEST']._serialized_end=5331 - _globals['_VERIFIABLEZADDREQUEST']._serialized_start=5333 - _globals['_VERIFIABLEZADDREQUEST']._serialized_end=5427 - _globals['_TXREQUEST']._serialized_start=5430 - _globals['_TXREQUEST']._serialized_end=5569 - _globals['_ENTRIESSPEC']._serialized_start=5572 - _globals['_ENTRIESSPEC']._serialized_end=5744 - _globals['_ENTRYTYPESPEC']._serialized_start=5746 - _globals['_ENTRYTYPESPEC']._serialized_end=5809 - _globals['_VERIFIABLETXREQUEST']._serialized_start=5812 - _globals['_VERIFIABLETXREQUEST']._serialized_end=5983 - _globals['_TXSCANREQUEST']._serialized_start=5986 - _globals['_TXSCANREQUEST']._serialized_end=6131 - _globals['_TXLIST']._serialized_start=6133 - _globals['_TXLIST']._serialized_end=6173 - _globals['_EXPORTTXREQUEST']._serialized_start=6175 - _globals['_EXPORTTXREQUEST']._serialized_end=6204 - _globals['_DATABASE']._serialized_start=6206 - _globals['_DATABASE']._serialized_end=6238 - _globals['_DATABASESETTINGS']._serialized_start=6241 - _globals['_DATABASESETTINGS']._serialized_end=6524 - _globals['_CREATEDATABASEREQUEST']._serialized_start=6526 - _globals['_CREATEDATABASEREQUEST']._serialized_end=6643 - _globals['_CREATEDATABASERESPONSE']._serialized_start=6645 - _globals['_CREATEDATABASERESPONSE']._serialized_end=6766 - _globals['_UPDATEDATABASEREQUEST']._serialized_start=6768 - _globals['_UPDATEDATABASEREQUEST']._serialized_end=6868 - _globals['_UPDATEDATABASERESPONSE']._serialized_start=6870 - _globals['_UPDATEDATABASERESPONSE']._serialized_end=6971 - _globals['_DATABASESETTINGSREQUEST']._serialized_start=6973 - _globals['_DATABASESETTINGSREQUEST']._serialized_end=6998 - _globals['_DATABASESETTINGSRESPONSE']._serialized_start=7000 - _globals['_DATABASESETTINGSRESPONSE']._serialized_end=7103 - _globals['_NULLABLEUINT32']._serialized_start=7105 - _globals['_NULLABLEUINT32']._serialized_end=7136 - _globals['_NULLABLEUINT64']._serialized_start=7138 - _globals['_NULLABLEUINT64']._serialized_end=7169 - _globals['_NULLABLEFLOAT']._serialized_start=7171 - _globals['_NULLABLEFLOAT']._serialized_end=7201 - _globals['_NULLABLEBOOL']._serialized_start=7203 - _globals['_NULLABLEBOOL']._serialized_end=7232 - _globals['_NULLABLESTRING']._serialized_start=7234 - _globals['_NULLABLESTRING']._serialized_end=7265 - _globals['_NULLABLEMILLISECONDS']._serialized_start=7267 - _globals['_NULLABLEMILLISECONDS']._serialized_end=7304 - _globals['_DATABASENULLABLESETTINGS']._serialized_start=7307 - _globals['_DATABASENULLABLESETTINGS']._serialized_end=8413 - _globals['_REPLICATIONNULLABLESETTINGS']._serialized_start=8416 - _globals['_REPLICATIONNULLABLESETTINGS']._serialized_end=8765 - _globals['_INDEXNULLABLESETTINGS']._serialized_start=8768 - _globals['_INDEXNULLABLESETTINGS']._serialized_end=9542 - _globals['_AHTNULLABLESETTINGS']._serialized_start=9545 - _globals['_AHTNULLABLESETTINGS']._serialized_end=9676 - _globals['_LOADDATABASEREQUEST']._serialized_start=9678 - _globals['_LOADDATABASEREQUEST']._serialized_end=9717 - _globals['_LOADDATABASERESPONSE']._serialized_start=9719 - _globals['_LOADDATABASERESPONSE']._serialized_end=9759 - _globals['_UNLOADDATABASEREQUEST']._serialized_start=9761 - _globals['_UNLOADDATABASEREQUEST']._serialized_end=9802 - _globals['_UNLOADDATABASERESPONSE']._serialized_start=9804 - _globals['_UNLOADDATABASERESPONSE']._serialized_end=9846 - _globals['_DELETEDATABASEREQUEST']._serialized_start=9848 - _globals['_DELETEDATABASEREQUEST']._serialized_end=9889 - _globals['_DELETEDATABASERESPONSE']._serialized_start=9891 - _globals['_DELETEDATABASERESPONSE']._serialized_end=9933 - _globals['_FLUSHINDEXREQUEST']._serialized_start=9935 - _globals['_FLUSHINDEXREQUEST']._serialized_end=9997 - _globals['_FLUSHINDEXRESPONSE']._serialized_start=9999 - _globals['_FLUSHINDEXRESPONSE']._serialized_end=10037 - _globals['_TABLE']._serialized_start=10039 - _globals['_TABLE']._serialized_end=10065 - _globals['_SQLGETREQUEST']._serialized_start=10067 - _globals['_SQLGETREQUEST']._serialized_end=10171 - _globals['_VERIFIABLESQLGETREQUEST']._serialized_start=10173 - _globals['_VERIFIABLESQLGETREQUEST']._serialized_end=10273 - _globals['_SQLENTRY']._serialized_start=10275 - _globals['_SQLENTRY']._serialized_end=10370 - _globals['_VERIFIABLESQLENTRY']._serialized_start=10373 - _globals['_VERIFIABLESQLENTRY']._serialized_end=11106 - _globals['_VERIFIABLESQLENTRY_COLNAMESBYIDENTRY']._serialized_start=10892 - _globals['_VERIFIABLESQLENTRY_COLNAMESBYIDENTRY']._serialized_end=10943 - _globals['_VERIFIABLESQLENTRY_COLIDSBYNAMEENTRY']._serialized_start=10945 - _globals['_VERIFIABLESQLENTRY_COLIDSBYNAMEENTRY']._serialized_end=10996 - _globals['_VERIFIABLESQLENTRY_COLTYPESBYIDENTRY']._serialized_start=10998 - _globals['_VERIFIABLESQLENTRY_COLTYPESBYIDENTRY']._serialized_end=11049 - _globals['_VERIFIABLESQLENTRY_COLLENBYIDENTRY']._serialized_start=11051 - _globals['_VERIFIABLESQLENTRY_COLLENBYIDENTRY']._serialized_end=11100 - _globals['_USEDATABASEREPLY']._serialized_start=11108 - _globals['_USEDATABASEREPLY']._serialized_end=11141 - _globals['_CHANGEPERMISSIONREQUEST']._serialized_start=11144 - _globals['_CHANGEPERMISSIONREQUEST']._serialized_end=11274 - _globals['_SETACTIVEUSERREQUEST']._serialized_start=11276 - _globals['_SETACTIVEUSERREQUEST']._serialized_end=11332 - _globals['_DATABASELISTRESPONSE']._serialized_start=11334 - _globals['_DATABASELISTRESPONSE']._serialized_end=11400 - _globals['_DATABASELISTREQUESTV2']._serialized_start=11402 - _globals['_DATABASELISTREQUESTV2']._serialized_end=11425 - _globals['_DATABASELISTRESPONSEV2']._serialized_start=11427 - _globals['_DATABASELISTRESPONSEV2']._serialized_end=11507 - _globals['_DATABASEWITHSETTINGS']._serialized_start=11509 - _globals['_DATABASEWITHSETTINGS']._serialized_end=11620 - _globals['_CHUNK']._serialized_start=11622 - _globals['_CHUNK']._serialized_end=11646 - _globals['_USESNAPSHOTREQUEST']._serialized_start=11648 - _globals['_USESNAPSHOTREQUEST']._serialized_end=11705 - _globals['_SQLEXECREQUEST']._serialized_start=11707 - _globals['_SQLEXECREQUEST']._serialized_end=11795 - _globals['_SQLQUERYREQUEST']._serialized_start=11797 - _globals['_SQLQUERYREQUEST']._serialized_end=11893 - _globals['_NAMEDPARAM']._serialized_start=11895 - _globals['_NAMEDPARAM']._serialized_end=11961 - _globals['_SQLEXECRESULT']._serialized_start=11963 - _globals['_SQLEXECRESULT']._serialized_end=12041 - _globals['_COMMITTEDSQLTX']._serialized_start=12044 - _globals['_COMMITTEDSQLTX']._serialized_end=12441 - _globals['_COMMITTEDSQLTX_LASTINSERTEDPKSENTRY']._serialized_start=12280 - _globals['_COMMITTEDSQLTX_LASTINSERTEDPKSENTRY']._serialized_end=12359 - _globals['_COMMITTEDSQLTX_FIRSTINSERTEDPKSENTRY']._serialized_start=12361 - _globals['_COMMITTEDSQLTX_FIRSTINSERTEDPKSENTRY']._serialized_end=12441 - _globals['_SQLQUERYRESULT']._serialized_start=12443 - _globals['_SQLQUERYRESULT']._serialized_end=12533 - _globals['_COLUMN']._serialized_start=12535 - _globals['_COLUMN']._serialized_end=12571 - _globals['_ROW']._serialized_start=12573 - _globals['_ROW']._serialized_end=12636 - _globals['_SQLVALUE']._serialized_start=12639 - _globals['_SQLVALUE']._serialized_end=12769 - _globals['_NEWTXREQUEST']._serialized_start=12771 - _globals['_NEWTXREQUEST']._serialized_end=12822 - _globals['_NEWTXRESPONSE']._serialized_start=12824 - _globals['_NEWTXRESPONSE']._serialized_end=12862 - _globals['_ERRORINFO']._serialized_start=12864 - _globals['_ERRORINFO']._serialized_end=12904 - _globals['_DEBUGINFO']._serialized_start=12906 - _globals['_DEBUGINFO']._serialized_end=12932 - _globals['_RETRYINFO']._serialized_start=12934 - _globals['_RETRYINFO']._serialized_end=12966 - _globals['_IMMUSERVICE']._serialized_start=13143 - _globals['_IMMUSERVICE']._serialized_end=19624 + _globals['_TXMETADATA']._serialized_end=2686 + _globals['_LINEARPROOF']._serialized_start=2688 + _globals['_LINEARPROOF']._serialized_end=2756 + _globals['_LINEARADVANCEPROOF']._serialized_start=2758 + _globals['_LINEARADVANCEPROOF']._serialized_end=2860 + _globals['_DUALPROOF']._serialized_start=2863 + _globals['_DUALPROOF']._serialized_end=3185 + _globals['_DUALPROOFV2']._serialized_start=3188 + _globals['_DUALPROOFV2']._serialized_end=3349 + _globals['_TX']._serialized_start=3352 + _globals['_TX']._serialized_end=3520 + _globals['_TXENTRY']._serialized_start=3522 + _globals['_TXENTRY']._serialized_end=3634 + _globals['_KVMETADATA']._serialized_start=3636 + _globals['_KVMETADATA']._serialized_end=3734 + _globals['_EXPIRATION']._serialized_start=3736 + _globals['_EXPIRATION']._serialized_end=3767 + _globals['_VERIFIABLETX']._serialized_start=3770 + _globals['_VERIFIABLETX']._serialized_end=3905 + _globals['_VERIFIABLETXV2']._serialized_start=3908 + _globals['_VERIFIABLETXV2']._serialized_end=4047 + _globals['_VERIFIABLEENTRY']._serialized_start=4050 + _globals['_VERIFIABLEENTRY']._serialized_end=4210 + _globals['_INCLUSIONPROOF']._serialized_start=4212 + _globals['_INCLUSIONPROOF']._serialized_end=4272 + _globals['_SETREQUEST']._serialized_start=4274 + _globals['_SETREQUEST']._serialized_end=4392 + _globals['_KEYREQUEST']._serialized_start=4394 + _globals['_KEYREQUEST']._serialized_end=4486 + _globals['_KEYLISTREQUEST']._serialized_start=4488 + _globals['_KEYLISTREQUEST']._serialized_end=4535 + _globals['_DELETEKEYSREQUEST']._serialized_start=4537 + _globals['_DELETEKEYSREQUEST']._serialized_end=4603 + _globals['_VERIFIABLESETREQUEST']._serialized_start=4605 + _globals['_VERIFIABLESETREQUEST']._serialized_end=4696 + _globals['_VERIFIABLEGETREQUEST']._serialized_start=4698 + _globals['_VERIFIABLEGETREQUEST']._serialized_end=4789 + _globals['_SERVERINFOREQUEST']._serialized_start=4791 + _globals['_SERVERINFOREQUEST']._serialized_end=4810 + _globals['_SERVERINFORESPONSE']._serialized_start=4813 + _globals['_SERVERINFORESPONSE']._serialized_end=4943 + _globals['_HEALTHRESPONSE']._serialized_start=4945 + _globals['_HEALTHRESPONSE']._serialized_end=4994 + _globals['_DATABASEHEALTHRESPONSE']._serialized_start=4996 + _globals['_DATABASEHEALTHRESPONSE']._serialized_end=5077 + _globals['_IMMUTABLESTATE']._serialized_start=5080 + _globals['_IMMUTABLESTATE']._serialized_end=5237 + _globals['_REFERENCEREQUEST']._serialized_start=5240 + _globals['_REFERENCEREQUEST']._serialized_end=5394 + _globals['_VERIFIABLEREFERENCEREQUEST']._serialized_start=5396 + _globals['_VERIFIABLEREFERENCEREQUEST']._serialized_end=5505 + _globals['_ZADDREQUEST']._serialized_start=5507 + _globals['_ZADDREQUEST']._serialized_end=5609 + _globals['_SCORE']._serialized_start=5611 + _globals['_SCORE']._serialized_end=5633 + _globals['_ZSCANREQUEST']._serialized_start=5636 + _globals['_ZSCANREQUEST']._serialized_end=5898 + _globals['_HISTORYREQUEST']._serialized_start=5900 + _globals['_HISTORYREQUEST']._serialized_end=5991 + _globals['_VERIFIABLEZADDREQUEST']._serialized_start=5993 + _globals['_VERIFIABLEZADDREQUEST']._serialized_end=6087 + _globals['_TXREQUEST']._serialized_start=6090 + _globals['_TXREQUEST']._serialized_end=6229 + _globals['_ENTRIESSPEC']._serialized_start=6232 + _globals['_ENTRIESSPEC']._serialized_end=6404 + _globals['_ENTRYTYPESPEC']._serialized_start=6406 + _globals['_ENTRYTYPESPEC']._serialized_end=6469 + _globals['_VERIFIABLETXREQUEST']._serialized_start=6472 + _globals['_VERIFIABLETXREQUEST']._serialized_end=6643 + _globals['_TXSCANREQUEST']._serialized_start=6646 + _globals['_TXSCANREQUEST']._serialized_end=6791 + _globals['_TXLIST']._serialized_start=6793 + _globals['_TXLIST']._serialized_end=6833 + _globals['_EXPORTTXREQUEST']._serialized_start=6836 + _globals['_EXPORTTXREQUEST']._serialized_end=6971 + _globals['_REPLICASTATE']._serialized_start=6973 + _globals['_REPLICASTATE']._serialized_end=7097 + _globals['_DATABASE']._serialized_start=7099 + _globals['_DATABASE']._serialized_end=7131 + _globals['_DATABASESETTINGS']._serialized_start=7134 + _globals['_DATABASESETTINGS']._serialized_end=7415 + _globals['_CREATEDATABASEREQUEST']._serialized_start=7417 + _globals['_CREATEDATABASEREQUEST']._serialized_end=7534 + _globals['_CREATEDATABASERESPONSE']._serialized_start=7536 + _globals['_CREATEDATABASERESPONSE']._serialized_end=7657 + _globals['_UPDATEDATABASEREQUEST']._serialized_start=7659 + _globals['_UPDATEDATABASEREQUEST']._serialized_end=7759 + _globals['_UPDATEDATABASERESPONSE']._serialized_start=7761 + _globals['_UPDATEDATABASERESPONSE']._serialized_end=7862 + _globals['_DATABASESETTINGSREQUEST']._serialized_start=7864 + _globals['_DATABASESETTINGSREQUEST']._serialized_end=7889 + _globals['_DATABASESETTINGSRESPONSE']._serialized_start=7891 + _globals['_DATABASESETTINGSRESPONSE']._serialized_end=7994 + _globals['_NULLABLEUINT32']._serialized_start=7996 + _globals['_NULLABLEUINT32']._serialized_end=8027 + _globals['_NULLABLEUINT64']._serialized_start=8029 + _globals['_NULLABLEUINT64']._serialized_end=8060 + _globals['_NULLABLEFLOAT']._serialized_start=8062 + _globals['_NULLABLEFLOAT']._serialized_end=8092 + _globals['_NULLABLEBOOL']._serialized_start=8094 + _globals['_NULLABLEBOOL']._serialized_end=8123 + _globals['_NULLABLESTRING']._serialized_start=8125 + _globals['_NULLABLESTRING']._serialized_end=8156 + _globals['_NULLABLEMILLISECONDS']._serialized_start=8158 + _globals['_NULLABLEMILLISECONDS']._serialized_end=8195 + _globals['_DATABASENULLABLESETTINGS']._serialized_start=8198 + _globals['_DATABASENULLABLESETTINGS']._serialized_end=9653 + _globals['_REPLICATIONNULLABLESETTINGS']._serialized_start=9656 + _globals['_REPLICATIONNULLABLESETTINGS']._serialized_end=10403 + _globals['_TRUNCATIONNULLABLESETTINGS']._serialized_start=10406 + _globals['_TRUNCATIONNULLABLESETTINGS']._serialized_end=10562 + _globals['_INDEXNULLABLESETTINGS']._serialized_start=10565 + _globals['_INDEXNULLABLESETTINGS']._serialized_end=11460 + _globals['_AHTNULLABLESETTINGS']._serialized_start=11463 + _globals['_AHTNULLABLESETTINGS']._serialized_end=11594 + _globals['_LOADDATABASEREQUEST']._serialized_start=11596 + _globals['_LOADDATABASEREQUEST']._serialized_end=11635 + _globals['_LOADDATABASERESPONSE']._serialized_start=11637 + _globals['_LOADDATABASERESPONSE']._serialized_end=11677 + _globals['_UNLOADDATABASEREQUEST']._serialized_start=11679 + _globals['_UNLOADDATABASEREQUEST']._serialized_end=11720 + _globals['_UNLOADDATABASERESPONSE']._serialized_start=11722 + _globals['_UNLOADDATABASERESPONSE']._serialized_end=11764 + _globals['_DELETEDATABASEREQUEST']._serialized_start=11766 + _globals['_DELETEDATABASEREQUEST']._serialized_end=11807 + _globals['_DELETEDATABASERESPONSE']._serialized_start=11809 + _globals['_DELETEDATABASERESPONSE']._serialized_end=11851 + _globals['_FLUSHINDEXREQUEST']._serialized_start=11853 + _globals['_FLUSHINDEXREQUEST']._serialized_end=11915 + _globals['_FLUSHINDEXRESPONSE']._serialized_start=11917 + _globals['_FLUSHINDEXRESPONSE']._serialized_end=11955 + _globals['_TABLE']._serialized_start=11957 + _globals['_TABLE']._serialized_end=11983 + _globals['_SQLGETREQUEST']._serialized_start=11985 + _globals['_SQLGETREQUEST']._serialized_end=12089 + _globals['_VERIFIABLESQLGETREQUEST']._serialized_start=12091 + _globals['_VERIFIABLESQLGETREQUEST']._serialized_end=12191 + _globals['_SQLENTRY']._serialized_start=12193 + _globals['_SQLENTRY']._serialized_end=12288 + _globals['_VERIFIABLESQLENTRY']._serialized_start=12291 + _globals['_VERIFIABLESQLENTRY']._serialized_end=13042 + _globals['_VERIFIABLESQLENTRY_COLNAMESBYIDENTRY']._serialized_start=12828 + _globals['_VERIFIABLESQLENTRY_COLNAMESBYIDENTRY']._serialized_end=12879 + _globals['_VERIFIABLESQLENTRY_COLIDSBYNAMEENTRY']._serialized_start=12881 + _globals['_VERIFIABLESQLENTRY_COLIDSBYNAMEENTRY']._serialized_end=12932 + _globals['_VERIFIABLESQLENTRY_COLTYPESBYIDENTRY']._serialized_start=12934 + _globals['_VERIFIABLESQLENTRY_COLTYPESBYIDENTRY']._serialized_end=12985 + _globals['_VERIFIABLESQLENTRY_COLLENBYIDENTRY']._serialized_start=12987 + _globals['_VERIFIABLESQLENTRY_COLLENBYIDENTRY']._serialized_end=13036 + _globals['_USEDATABASEREPLY']._serialized_start=13044 + _globals['_USEDATABASEREPLY']._serialized_end=13077 + _globals['_CHANGEPERMISSIONREQUEST']._serialized_start=13080 + _globals['_CHANGEPERMISSIONREQUEST']._serialized_end=13210 + _globals['_SETACTIVEUSERREQUEST']._serialized_start=13212 + _globals['_SETACTIVEUSERREQUEST']._serialized_end=13268 + _globals['_DATABASELISTRESPONSE']._serialized_start=13270 + _globals['_DATABASELISTRESPONSE']._serialized_end=13336 + _globals['_DATABASELISTREQUESTV2']._serialized_start=13338 + _globals['_DATABASELISTREQUESTV2']._serialized_end=13361 + _globals['_DATABASELISTRESPONSEV2']._serialized_start=13363 + _globals['_DATABASELISTRESPONSEV2']._serialized_end=13435 + _globals['_DATABASEINFO']._serialized_start=13438 + _globals['_DATABASEINFO']._serialized_end=13584 + _globals['_CHUNK']._serialized_start=13586 + _globals['_CHUNK']._serialized_end=13713 + _globals['_CHUNK_METADATAENTRY']._serialized_start=13666 + _globals['_CHUNK_METADATAENTRY']._serialized_end=13713 + _globals['_USESNAPSHOTREQUEST']._serialized_start=13715 + _globals['_USESNAPSHOTREQUEST']._serialized_end=13772 + _globals['_SQLEXECREQUEST']._serialized_start=13774 + _globals['_SQLEXECREQUEST']._serialized_end=13862 + _globals['_SQLQUERYREQUEST']._serialized_start=13864 + _globals['_SQLQUERYREQUEST']._serialized_end=13986 + _globals['_NAMEDPARAM']._serialized_start=13988 + _globals['_NAMEDPARAM']._serialized_end=14054 + _globals['_SQLEXECRESULT']._serialized_start=14056 + _globals['_SQLEXECRESULT']._serialized_end=14134 + _globals['_COMMITTEDSQLTX']._serialized_start=14137 + _globals['_COMMITTEDSQLTX']._serialized_end=14534 + _globals['_COMMITTEDSQLTX_LASTINSERTEDPKSENTRY']._serialized_start=14373 + _globals['_COMMITTEDSQLTX_LASTINSERTEDPKSENTRY']._serialized_end=14452 + _globals['_COMMITTEDSQLTX_FIRSTINSERTEDPKSENTRY']._serialized_start=14454 + _globals['_COMMITTEDSQLTX_FIRSTINSERTEDPKSENTRY']._serialized_end=14534 + _globals['_SQLQUERYRESULT']._serialized_start=14536 + _globals['_SQLQUERYRESULT']._serialized_end=14626 + _globals['_COLUMN']._serialized_start=14628 + _globals['_COLUMN']._serialized_end=14664 + _globals['_ROW']._serialized_start=14666 + _globals['_ROW']._serialized_end=14729 + _globals['_SQLVALUE']._serialized_start=14732 + _globals['_SQLVALUE']._serialized_end=14875 + _globals['_NEWTXREQUEST']._serialized_start=14878 + _globals['_NEWTXREQUEST']._serialized_end=15081 + _globals['_NEWTXRESPONSE']._serialized_start=15083 + _globals['_NEWTXRESPONSE']._serialized_end=15121 + _globals['_ERRORINFO']._serialized_start=15123 + _globals['_ERRORINFO']._serialized_end=15163 + _globals['_DEBUGINFO']._serialized_start=15165 + _globals['_DEBUGINFO']._serialized_end=15191 + _globals['_RETRYINFO']._serialized_start=15193 + _globals['_RETRYINFO']._serialized_end=15225 + _globals['_TRUNCATEDATABASEREQUEST']._serialized_start=15227 + _globals['_TRUNCATEDATABASEREQUEST']._serialized_end=15295 + _globals['_TRUNCATEDATABASERESPONSE']._serialized_start=15297 + _globals['_TRUNCATEDATABASERESPONSE']._serialized_end=15341 + _globals['_IMMUSERVICE']._serialized_start=15518 + _globals['_IMMUSERVICE']._serialized_end=22315 # @@protoc_insertion_point(module_scope) diff --git a/immudb/grpc/schema_pb2_grpc.py b/immudb/grpc/schema_pb2_grpc.py index a43bd66..11456b2 100644 --- a/immudb/grpc/schema_pb2_grpc.py +++ b/immudb/grpc/schema_pb2_grpc.py @@ -86,7 +86,7 @@ def __init__(self, channel): request_serializer=schema__pb2.SQLExecRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, ) - self.TxSQLQuery = channel.unary_unary( + self.TxSQLQuery = channel.unary_stream( '/immudb.schema.ImmuService/TxSQLQuery', request_serializer=schema__pb2.SQLQueryRequest.SerializeToString, response_deserializer=schema__pb2.SQLQueryResult.FromString, @@ -341,12 +341,22 @@ def __init__(self, channel): request_serializer=schema__pb2.Chunk.SerializeToString, response_deserializer=schema__pb2.TxHeader.FromString, ) + self.streamExportTx = channel.stream_stream( + '/immudb.schema.ImmuService/streamExportTx', + request_serializer=schema__pb2.ExportTxRequest.SerializeToString, + response_deserializer=schema__pb2.Chunk.FromString, + ) self.SQLExec = channel.unary_unary( '/immudb.schema.ImmuService/SQLExec', request_serializer=schema__pb2.SQLExecRequest.SerializeToString, response_deserializer=schema__pb2.SQLExecResult.FromString, ) - self.SQLQuery = channel.unary_unary( + self.UnarySQLQuery = channel.unary_unary( + '/immudb.schema.ImmuService/UnarySQLQuery', + request_serializer=schema__pb2.SQLQueryRequest.SerializeToString, + response_deserializer=schema__pb2.SQLQueryResult.FromString, + ) + self.SQLQuery = channel.unary_stream( '/immudb.schema.ImmuService/SQLQuery', request_serializer=schema__pb2.SQLQueryRequest.SerializeToString, response_deserializer=schema__pb2.SQLQueryResult.FromString, @@ -366,6 +376,11 @@ def __init__(self, channel): request_serializer=schema__pb2.VerifiableSQLGetRequest.SerializeToString, response_deserializer=schema__pb2.VerifiableSQLEntry.FromString, ) + self.TruncateDatabase = channel.unary_unary( + '/immudb.schema.ImmuService/TruncateDatabase', + request_serializer=schema__pb2.TruncateDatabaseRequest.SerializeToString, + response_deserializer=schema__pb2.TruncateDatabaseResponse.FromString, + ) class ImmuServiceServicer(object): @@ -774,12 +789,25 @@ def replicateTx(self, request_iterator, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def streamExportTx(self, request_iterator, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def SQLExec(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def UnarySQLQuery(self, request, context): + """For backward compatibility with the grpc-gateway API + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def SQLQuery(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -804,6 +832,12 @@ def VerifiableSQLGet(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def TruncateDatabase(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def add_ImmuServiceServicer_to_server(servicer, server): rpc_method_handlers = { @@ -877,7 +911,7 @@ def add_ImmuServiceServicer_to_server(servicer, server): request_deserializer=schema__pb2.SQLExecRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), - 'TxSQLQuery': grpc.unary_unary_rpc_method_handler( + 'TxSQLQuery': grpc.unary_stream_rpc_method_handler( servicer.TxSQLQuery, request_deserializer=schema__pb2.SQLQueryRequest.FromString, response_serializer=schema__pb2.SQLQueryResult.SerializeToString, @@ -1132,12 +1166,22 @@ def add_ImmuServiceServicer_to_server(servicer, server): request_deserializer=schema__pb2.Chunk.FromString, response_serializer=schema__pb2.TxHeader.SerializeToString, ), + 'streamExportTx': grpc.stream_stream_rpc_method_handler( + servicer.streamExportTx, + request_deserializer=schema__pb2.ExportTxRequest.FromString, + response_serializer=schema__pb2.Chunk.SerializeToString, + ), 'SQLExec': grpc.unary_unary_rpc_method_handler( servicer.SQLExec, request_deserializer=schema__pb2.SQLExecRequest.FromString, response_serializer=schema__pb2.SQLExecResult.SerializeToString, ), - 'SQLQuery': grpc.unary_unary_rpc_method_handler( + 'UnarySQLQuery': grpc.unary_unary_rpc_method_handler( + servicer.UnarySQLQuery, + request_deserializer=schema__pb2.SQLQueryRequest.FromString, + response_serializer=schema__pb2.SQLQueryResult.SerializeToString, + ), + 'SQLQuery': grpc.unary_stream_rpc_method_handler( servicer.SQLQuery, request_deserializer=schema__pb2.SQLQueryRequest.FromString, response_serializer=schema__pb2.SQLQueryResult.SerializeToString, @@ -1157,6 +1201,11 @@ def add_ImmuServiceServicer_to_server(servicer, server): request_deserializer=schema__pb2.VerifiableSQLGetRequest.FromString, response_serializer=schema__pb2.VerifiableSQLEntry.SerializeToString, ), + 'TruncateDatabase': grpc.unary_unary_rpc_method_handler( + servicer.TruncateDatabase, + request_deserializer=schema__pb2.TruncateDatabaseRequest.FromString, + response_serializer=schema__pb2.TruncateDatabaseResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'immudb.schema.ImmuService', rpc_method_handlers) @@ -1417,7 +1466,7 @@ def TxSQLQuery(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/immudb.schema.ImmuService/TxSQLQuery', + return grpc.experimental.unary_stream(request, target, '/immudb.schema.ImmuService/TxSQLQuery', schema__pb2.SQLQueryRequest.SerializeToString, schema__pb2.SQLQueryResult.FromString, options, channel_credentials, @@ -2273,6 +2322,23 @@ def replicateTx(request_iterator, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod + def streamExportTx(request_iterator, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.stream_stream(request_iterator, target, '/immudb.schema.ImmuService/streamExportTx', + schema__pb2.ExportTxRequest.SerializeToString, + schema__pb2.Chunk.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod def SQLExec(request, target, @@ -2290,6 +2356,23 @@ def SQLExec(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod + def UnarySQLQuery(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/immudb.schema.ImmuService/UnarySQLQuery', + schema__pb2.SQLQueryRequest.SerializeToString, + schema__pb2.SQLQueryResult.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod def SQLQuery(request, target, @@ -2301,7 +2384,7 @@ def SQLQuery(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/immudb.schema.ImmuService/SQLQuery', + return grpc.experimental.unary_stream(request, target, '/immudb.schema.ImmuService/SQLQuery', schema__pb2.SQLQueryRequest.SerializeToString, schema__pb2.SQLQueryResult.FromString, options, channel_credentials, @@ -2357,3 +2440,20 @@ def VerifiableSQLGet(request, schema__pb2.VerifiableSQLEntry.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def TruncateDatabase(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/immudb.schema.ImmuService/TruncateDatabase', + schema__pb2.TruncateDatabaseRequest.SerializeToString, + schema__pb2.TruncateDatabaseResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/immudb/handler/sqlquery.py b/immudb/handler/sqlquery.py index 097318a..9e24904 100644 --- a/immudb/handler/sqlquery.py +++ b/immudb/handler/sqlquery.py @@ -19,11 +19,11 @@ from immudb.exceptions import ErrPySDKInvalidColumnMode -def call(service: schema_pb2_grpc.ImmuServiceStub, rs: RootService, query, params, columnNameMode): - return _call_with_executor(query, params, columnNameMode, service.SQLQuery) +def call(service: schema_pb2_grpc.ImmuServiceStub, rs: RootService, query, params, columnNameMode, dbname): + return _call_with_executor(query, params, columnNameMode, dbname, service.SQLQuery) -def _call_with_executor(query, params, columnNameMode, executor): +def _call_with_executor(query, params, columnNameMode, dbname, executor): paramsObj = [] for key, value in params.items(): paramsObj.append(schema_pb2.NamedParam( @@ -31,46 +31,115 @@ def _call_with_executor(query, params, columnNameMode, executor): request = schema_pb2.SQLQueryRequest( sql=query, + acceptStream=True, params=paramsObj) resp = executor(request) - result = [] - columnNames = getColumnNames(resp, columnNameMode) + return RowIterator(resp, columnNameMode, dbname) + + +def fix_colnames(cols, dbname, columnNameMode): + if columnNameMode not in [constants.COLUMN_NAME_MODE_DATABASE, constants.COLUMN_NAME_MODE_FULL]: + return cols + return [x.replace("[@DB]", dbname.decode("utf-8")) for x in cols] + + +def unpack_rows(resp, columnNameMode, colNames): + result = [] for row in resp.rows: if columnNameMode == constants.COLUMN_NAME_MODE_NONE: result.append(tuple([sqlvalue_to_py(i) for i in row.values])) else: result.append( - dict(zip(columnNames, tuple([sqlvalue_to_py(i) for i in row.values])))) + dict(zip(colNames, tuple([sqlvalue_to_py(i) for i in row.values])))) return result -def getColumnNames(resp, columnNameMode): - columnNames = [] - if columnNameMode: - for column in resp.columns: - # note that depending on the version parts can be - # '(dbname.tablename.fieldname)' *or* - # '(tablename.fieldname)' without dbnname. - # In that case we mimic the old behavior by using [@DB] as placeholder - # that will be replaced at higher level. - parts = column.name.strip("()").split(".") - if columnNameMode == constants.COLUMN_NAME_MODE_FIELD: - columnNames.append(parts[-1]) - continue - if columnNameMode == constants.COLUMN_NAME_MODE_TABLE: - columnNames.append(".".join(parts[-2:])) - continue - print( - "Use of COLUMN_NAME_MODE_DATABASE and COLUMN_NAME_MODE_FULL is deprecated") - if len(parts) == 2: - parts.insert(0, "[@DB]") - if columnNameMode == constants.COLUMN_NAME_MODE_DATABASE: - columnNames.append(".".join(parts)) - continue - if columnNameMode == constants.COLUMN_NAME_MODE_FULL: - columnNames.append("("+".".join(parts)+")") - continue - raise ErrPySDKInvalidColumnMode - return columnNames +def getColumnNames(resp, dbname, columnNameMode): + cols = [] + if columnNameMode == constants.COLUMN_NAME_MODE_NONE: + return cols + + for column in resp.columns: + # note that depending on the version parts can be + # '(dbname.tablename.fieldname)' *or* + # '(tablename.fieldname)' without dbnname. + # In that case we mimic the old behavior by using [@DB] as placeholder + # that will be replaced at higher level. + parts = column.name.strip("()").split(".") + if columnNameMode == constants.COLUMN_NAME_MODE_FIELD: + cols.append(parts[-1]) + continue + if columnNameMode == constants.COLUMN_NAME_MODE_TABLE: + cols.append(".".join(parts[-2:])) + continue + print( + "Use of COLUMN_NAME_MODE_DATABASE and COLUMN_NAME_MODE_FULL is deprecated") + if len(parts) == 2: + parts.insert(0, "[@DB]") + if columnNameMode == constants.COLUMN_NAME_MODE_DATABASE: + cols.append(".".join(parts)) + continue + if columnNameMode == constants.COLUMN_NAME_MODE_FULL: + cols.append("("+".".join(parts)+")") + continue + raise ErrPySDKInvalidColumnMode + return fix_colnames(cols, dbname, columnNameMode) + + +class ClosedIterator(BaseException): + pass + + +class RowIterator: + def __init__(self, grpcIt, colNameMode, dbname) -> None: + self._grpcIt = grpcIt + self._nextRow = 0 + self._rows = [] + self._columns = None + self._colNameMode = colNameMode + self._dbname = dbname + self._closed = False + + def __iter__(self): + return self + + def __next__(self): + self._fetch_next() + + row = self._rows[self._nextRow] + self._nextRow = self._nextRow+1 + return row + + def _fetch_next(self): + if self._closed: + raise ClosedIterator + + if self._nextRow < len(self._rows): + return + + res = next(self._grpcIt) + if self._columns == None: + self._columns = getColumnNames(res, self._dbname, self._colsMode()) + + self._rows = unpack_rows( + res, self._colNameMode, self._columns) + self._nextRow = 0 + + if len(self._rows) == 0: + raise StopIteration + + def _colsMode(self): + return self._colNameMode if self._colNameMode != constants.COLUMN_NAME_MODE_NONE else constants.COLUMN_NAME_MODE_FIELD + + def columns(self): + self._fetch_next() + return self._columns + + def close(self): + if self._closed: + raise ClosedIterator + + self._grpcIt.cancel() + self._closed = True diff --git a/immudb/handler/transaction.py b/immudb/handler/transaction.py index 608199f..87f740c 100644 --- a/immudb/handler/transaction.py +++ b/immudb/handler/transaction.py @@ -21,8 +21,9 @@ class Tx: - def __init__(self, stub, session, channel): + def __init__(self, stub, dbname, session, channel): self.stub = stub + self.dbname = dbname self.session = session self.channel = channel self.txStub = None @@ -52,8 +53,12 @@ def rollback(self): self.txStub = None return resp - def sqlQuery(self, query, params=dict(), columnNameMode=constants.COLUMN_NAME_MODE_NONE): - return executeSQLQuery(query, params, columnNameMode, self.txStub.TxSQLQuery) + def sqlQuery(self, query, params=dict(), columnNameMode=constants.COLUMN_NAME_MODE_NONE, acceptStream=False): + it = executeSQLQuery(query, params, columnNameMode, + self.dbname, self.txStub.TxSQLQuery) + if acceptStream: + return it + return list(it) def sqlExec(self, stmt, params=dict(), noWait=False): return executeSQLExec(stmt, params, noWait, self.txStub.TxSQLExec) diff --git a/tests/immu/test_create_load_database_v2.py b/tests/immu/test_create_load_database_v2.py index 904af88..bf1d795 100644 --- a/tests/immu/test_create_load_database_v2.py +++ b/tests/immu/test_create_load_database_v2.py @@ -62,7 +62,7 @@ def test_update_database_v2(wrappedClient: ImmuTestClient): foundDb = False for database in resp.databases: - if database.settings.maxKeyLen == 32 and database.name == name and not database.settings.autoload: + if database.settings.maxKeyLen.value == 32 and database.name == name and not database.settings.autoload.value: foundDb = True assert foundDb == True @@ -76,7 +76,7 @@ def test_update_database_v2(wrappedClient: ImmuTestClient): resp = client.databaseListV2() foundDb = False for database in resp.databases: - if database.settings.maxKeyLen == 32 and database.name == name and database.settings.autoload: + if database.settings.maxKeyLen.value == 32 and database.name == name and database.settings.autoload.value: foundDb = True assert foundDb == True @@ -93,7 +93,7 @@ def test_list_databases_v2(wrappedClient: ImmuTestClient): resp = client.databaseListV2() foundDb = False for database in resp.databases: - if database.settings.maxKeyLen == 32 and database.name == name: + if database.settings.maxKeyLen.value == 32 and database.name == name: foundDb = True assert foundDb == True @@ -106,7 +106,7 @@ def test_list_databases_v2(wrappedClient: ImmuTestClient): resp = client.databaseListV2() foundDb = False for database in resp.databases: - if database.settings.maxKeyLen == 32 and database.name == name: + if database.settings.maxKeyLen.value == 32 and database.name == name: foundDb = True assert foundDb == True diff --git a/tests/immu/test_session.py b/tests/immu/test_session.py index 63c7323..8dd6a63 100644 --- a/tests/immu/test_session.py +++ b/tests/immu/test_session.py @@ -19,33 +19,41 @@ class TestSessionTransaction: def test_simple_unmanaged_session(self, wrappedClient: ImmuTestClient): - if(not wrappedClient.serverHigherOrEqualsToVersion("1.2.0")): + if (not wrappedClient.serverHigherOrEqualsToVersion("1.2.0")): pytest.skip("Version too low") - txInterface = wrappedClient.client.openSession("immudb", "immudb", b"defaultdb") + txInterface = wrappedClient.client.openSession( + "immudb", "immudb", b"defaultdb") try: newTx = txInterface.newTx() table = wrappedClient._generateTableName() - newTx.sqlExec(f"CREATE TABLE {table} (id INTEGER AUTO_INCREMENT, tester VARCHAR[10], PRIMARY KEY id)") + newTx.sqlExec( + f"CREATE TABLE {table} (id INTEGER AUTO_INCREMENT, tester VARCHAR[10], PRIMARY KEY id)") commit = newTx.commit() assert commit.header.id != None newTx = txInterface.newTx() - newTx.sqlExec(f"INSERT INTO {table} (tester) VALUES(@testParam)", params = {"testParam": "123"}) - what = newTx.sqlQuery(f"SELECT * FROM {table}", dict(), columnNameMode=constants.COLUMN_NAME_MODE_FIELD) - if wrappedClient.serverVersionEqual("1.9DOM.0") and what==[]: + newTx.sqlExec( + f"INSERT INTO {table} (tester) VALUES(@testParam)", params={"testParam": "123"}) + what = newTx.sqlQuery( + f"SELECT * FROM {table}", dict(), columnNameMode=constants.COLUMN_NAME_MODE_FIELD) + if wrappedClient.serverVersionEqual("1.9DOM.0") and what == []: pytest.xfail("Known bug #1854") assert what == [{"id": 1, "tester": '123'}] commit = newTx.commit() assert commit.header.id != None newTx = txInterface.newTx() - newTx.sqlExec(f"INSERT INTO {table} (tester) VALUES(@testParam)", params = {"testParam": "321"}) - what = newTx.sqlQuery(f"SELECT * FROM {table}", dict(), columnNameMode=constants.COLUMN_NAME_MODE_FIELD) - assert what == [{"id": 1, "tester": '123'}, {"id": 2, "tester": '321'}] + newTx.sqlExec( + f"INSERT INTO {table} (tester) VALUES(@testParam)", params={"testParam": "321"}) + what = newTx.sqlQuery( + f"SELECT * FROM {table}", dict(), columnNameMode=constants.COLUMN_NAME_MODE_FIELD) + assert what == [{"id": 1, "tester": '123'}, + {"id": 2, "tester": '321'}] commit = newTx.rollback() newTx = txInterface.newTx() - what = newTx.sqlQuery(f"SELECT * FROM {table}", dict(), columnNameMode=constants.COLUMN_NAME_MODE_FIELD) + what = newTx.sqlQuery( + f"SELECT * FROM {table}", dict(), columnNameMode=constants.COLUMN_NAME_MODE_FIELD) assert what == [{"id": 1, "tester": '123'}] commit = newTx.commit() wrappedClient.closeSession() @@ -56,40 +64,48 @@ def test_simple_unmanaged_session(self, wrappedClient: ImmuTestClient): pass def test_simple_managed_session(self, wrappedClient: ImmuTestClient): - if(not wrappedClient.serverHigherOrEqualsToVersion("1.2.0")): + if (not wrappedClient.serverHigherOrEqualsToVersion("1.2.0")): pytest.skip("Version too low") with wrappedClient.client.openManagedSession("immudb", "immudb", b"defaultdb") as session: newTx = session.newTx() table = wrappedClient._generateTableName() - newTx.sqlExec(f"CREATE TABLE {table} (id INTEGER AUTO_INCREMENT, tester VARCHAR[10], PRIMARY KEY id)") + newTx.sqlExec( + f"CREATE TABLE {table} (id INTEGER AUTO_INCREMENT, tester VARCHAR[10], PRIMARY KEY id)") commit = newTx.commit() assert commit.header.id != None newTx = session.newTx() - newTx.sqlExec(f"INSERT INTO {table} (tester) VALUES(@testParam)", params = {"testParam": "123"}) - what = newTx.sqlQuery(f"SELECT * FROM {table}", dict(), columnNameMode=constants.COLUMN_NAME_MODE_FIELD) - if wrappedClient.serverVersionEqual("1.9DOM.0") and what==[]: + newTx.sqlExec( + f"INSERT INTO {table} (tester) VALUES(@testParam)", params={"testParam": "123"}) + what = newTx.sqlQuery(f"SELECT * FROM {table}", dict( + ), columnNameMode=constants.COLUMN_NAME_MODE_FIELD, acceptStream=True) + if wrappedClient.serverVersionEqual("1.9DOM.0") and what == []: pytest.xfail("Known bug #1854") - assert what == [{"id": 1, "tester": '123'}] + assert list(what) == [{"id": 1, "tester": '123'}] commit = newTx.commit() assert commit.header.id != None with wrappedClient.client.openManagedSession("immudb", "immudb", b"defaultdb") as session: newTx = session.newTx() - newTx.sqlExec(f"INSERT INTO {table} (tester) VALUES(@testParam)", params = {"testParam": "321"}) - what = newTx.sqlQuery(f"SELECT * FROM {table}", dict(), columnNameMode=constants.COLUMN_NAME_MODE_FIELD) - assert what == [{"id": 1, "tester": '123'}, {"id": 2, "tester": '321'}] + newTx.sqlExec( + f"INSERT INTO {table} (tester) VALUES(@testParam)", params={"testParam": "321"}) + what = newTx.sqlQuery(f"SELECT * FROM {table}", dict( + ), columnNameMode=constants.COLUMN_NAME_MODE_FIELD, acceptStream=True) + assert list(what) == [{"id": 1, "tester": '123'}, + {"id": 2, "tester": '321'}] commit = newTx.rollback() newTx = session.newTx() - what = newTx.sqlQuery(f"SELECT * FROM {table}", dict(), columnNameMode=constants.COLUMN_NAME_MODE_FIELD) - assert what == [{"id": 1, "tester": '123'}] + what = newTx.sqlQuery(f"SELECT * FROM {table}", dict( + ), columnNameMode=constants.COLUMN_NAME_MODE_FIELD, acceptStream=True) + assert list(what) == [{"id": 1, "tester": '123'}] commit = newTx.commit() def test_unmanaged_session(self, wrappedClient: ImmuTestClient): - if(not wrappedClient.serverHigherOrEqualsToVersion("1.2.0")): + if (not wrappedClient.serverHigherOrEqualsToVersion("1.2.0")): pytest.skip("Version too low") - currentTxInterface = wrappedClient.openSession("immudb", "immudb", b"defaultdb") + currentTxInterface = wrappedClient.openSession( + "immudb", "immudb", b"defaultdb") try: wrappedClient.currentTx = currentTxInterface key = wrappedClient.generateKeyName().encode("utf-8") @@ -101,13 +117,18 @@ def test_unmanaged_session(self, wrappedClient: ImmuTestClient): a = wrappedClient.get(key) assert a.value == b'1' interface = wrappedClient.newTx() - table = wrappedClient.createTestTable("id INTEGER AUTO_INCREMENT", "tester VARCHAR[10]", "PRIMARY KEY id") - wrappedClient.insertToTable(table, ["tester"], ["@blabla"], {"blabla": "3"}) - wrappedClient.insertToTable(table, ["tester"], ["@blabla"], {"blabla": "4"}) - wrappedClient.insertToTable(table, ["tester"], ["@blabla"], {"blabla": "5"}) + table = wrappedClient.createTestTable( + "id INTEGER AUTO_INCREMENT", "tester VARCHAR[10]", "PRIMARY KEY id") + wrappedClient.insertToTable( + table, ["tester"], ["@blabla"], {"blabla": "3"}) + wrappedClient.insertToTable( + table, ["tester"], ["@blabla"], {"blabla": "4"}) + wrappedClient.insertToTable( + table, ["tester"], ["@blabla"], {"blabla": "5"}) interface.commit() wrappedClient.closeSession() - currentTxInterface = wrappedClient.openSession("immudb", "immudb", b"defaultdb") + currentTxInterface = wrappedClient.openSession( + "immudb", "immudb", b"defaultdb") wrappedClient.currentTx = currentTxInterface interface = wrappedClient.newTx() @@ -117,16 +138,20 @@ def test_unmanaged_session(self, wrappedClient: ImmuTestClient): interface.commit() interface = wrappedClient.newTx() - wrappedClient.insertToTable(table, ["tester"], ["@blabla"], {"blabla": "6"}) - wrappedClient.insertToTable(table, ["tester"], ["@blabla"], {"blabla": "7"}) - wrappedClient.insertToTable(table, ["tester"], ["@blabla"], {"blabla": "8"}) + wrappedClient.insertToTable( + table, ["tester"], ["@blabla"], {"blabla": "6"}) + wrappedClient.insertToTable( + table, ["tester"], ["@blabla"], {"blabla": "7"}) + wrappedClient.insertToTable( + table, ["tester"], ["@blabla"], {"blabla": "8"}) interface.rollback() finally: try: wrappedClient.closeSession() except: pass - wrappedClient.currentTx = wrappedClient.openSession("immudb", "immudb", b"defaultdb") + wrappedClient.currentTx = wrappedClient.openSession( + "immudb", "immudb", b"defaultdb") interface = wrappedClient.newTx() what = wrappedClient.simpleSelect(table, ["tester"], dict()) concatenated = [item[0] for item in what] @@ -141,7 +166,7 @@ def test_unmanaged_session(self, wrappedClient: ImmuTestClient): assert a.value == b'1' def test_managed_session(self, wrappedClient: ImmuTestClient): - if(not wrappedClient.serverHigherOrEqualsToVersion("1.2.0")): + if (not wrappedClient.serverHigherOrEqualsToVersion("1.2.0")): pytest.skip("Version too low") with wrappedClient.openManagedSession("immudb", "immudb", b"defaultdb") as session: @@ -156,10 +181,14 @@ def test_managed_session(self, wrappedClient: ImmuTestClient): with wrappedClient.openManagedSession("immudb", "immudb", b"defaultdb") as session: wrappedClient.currentTx = session interface = wrappedClient.newTx() - table = wrappedClient.createTestTable("id INTEGER AUTO_INCREMENT", "tester VARCHAR[10]", "PRIMARY KEY id") - wrappedClient.insertToTable(table, ["tester"], ["@blabla"], {"blabla": "3"}) - wrappedClient.insertToTable(table, ["tester"], ["@blabla"], {"blabla": "4"}) - wrappedClient.insertToTable(table, ["tester"], ["@blabla"], {"blabla": "5"}) + table = wrappedClient.createTestTable( + "id INTEGER AUTO_INCREMENT", "tester VARCHAR[10]", "PRIMARY KEY id") + wrappedClient.insertToTable( + table, ["tester"], ["@blabla"], {"blabla": "3"}) + wrappedClient.insertToTable( + table, ["tester"], ["@blabla"], {"blabla": "4"}) + wrappedClient.insertToTable( + table, ["tester"], ["@blabla"], {"blabla": "5"}) interface.commit() with wrappedClient.openManagedSession("immudb", "immudb", b"defaultdb") as session: @@ -172,9 +201,12 @@ def test_managed_session(self, wrappedClient: ImmuTestClient): with wrappedClient.openManagedSession("immudb", "immudb", b"defaultdb") as session: wrappedClient.currentTx = session interface = wrappedClient.newTx() - wrappedClient.insertToTable(table, ["tester"], ["@blabla"], {"blabla": "6"}) - wrappedClient.insertToTable(table, ["tester"], ["@blabla"], {"blabla": "7"}) - wrappedClient.insertToTable(table, ["tester"], ["@blabla"], {"blabla": "8"}) + wrappedClient.insertToTable( + table, ["tester"], ["@blabla"], {"blabla": "6"}) + wrappedClient.insertToTable( + table, ["tester"], ["@blabla"], {"blabla": "7"}) + wrappedClient.insertToTable( + table, ["tester"], ["@blabla"], {"blabla": "8"}) interface.rollback() with wrappedClient.openManagedSession("immudb", "immudb", b"defaultdb") as session: @@ -187,14 +219,20 @@ def test_managed_session(self, wrappedClient: ImmuTestClient): with wrappedClient.openManagedSession("immudb", "immudb", b"defaultdb") as session: wrappedClient.currentTx = session interface = wrappedClient.newTx() - wrappedClient.insertToTable(table, ["tester"], ["@blabla"], {"blabla": "6"}) - wrappedClient.insertToTable(table, ["tester"], ["@blabla"], {"blabla": "7"}) - wrappedClient.insertToTable(table, ["tester"], ["@blabla"], {"blabla": "8"}) + wrappedClient.insertToTable( + table, ["tester"], ["@blabla"], {"blabla": "6"}) + wrappedClient.insertToTable( + table, ["tester"], ["@blabla"], {"blabla": "7"}) + wrappedClient.insertToTable( + table, ["tester"], ["@blabla"], {"blabla": "8"}) rollbackAs = interface.rollback() interface = wrappedClient.newTx() - wrappedClient.insertToTable(table, ["tester"], ["@blabla"], {"blabla": "6"}) - wrappedClient.insertToTable(table, ["tester"], ["@blabla"], {"blabla": "7"}) - wrappedClient.insertToTable(table, ["tester"], ["@blabla"], {"blabla": "8"}) + wrappedClient.insertToTable( + table, ["tester"], ["@blabla"], {"blabla": "6"}) + wrappedClient.insertToTable( + table, ["tester"], ["@blabla"], {"blabla": "7"}) + wrappedClient.insertToTable( + table, ["tester"], ["@blabla"], {"blabla": "8"}) commitAs = interface.commit() assert commitAs.header.id != None interface = wrappedClient.newTx() @@ -206,5 +244,3 @@ def test_managed_session(self, wrappedClient: ImmuTestClient): concatenated = [item[0] for item in what] assert concatenated == ["3", "4", "5", "6", "7", "8"] what = wrappedClient.commit() - - diff --git a/tests/immu/test_sql_verify.py b/tests/immu/test_sql_verify.py index b77c028..776ede3 100644 --- a/tests/immu/test_sql_verify.py +++ b/tests/immu/test_sql_verify.py @@ -24,33 +24,46 @@ class TestVerifySQL: def test_exec_query(self, wrappedClient: ImmuTestClient): - if(not wrappedClient.serverHigherOrEqualsToVersion("1.2.0")): - return - tabname = wrappedClient.createTestTable("id INTEGER", "name VARCHAR", "test INTEGER NOT NULL", "PRIMARY KEY (id, test)") - wrappedClient.insertToTable(tabname, ["id", "name", "test"], ["@id", "@name", "@test"], {'id': 1, 'name': 'Joe', "test": 3}) - wrappedClient.insertToTable(tabname, ["id", "name", "test"], ["@id", "@name", "@test"], {'id': 2, 'name': 'Joe', "test": 2}) - wrappedClient.insertToTable(tabname, ["id", "name", "test"], ["@id", "@name", "@test"], {'id': 33, 'name': 'Joe', "test": 111}) - wrappedClient.insertToTable(tabname, ["id", "name", "test"], ["@id", "@name", "@test"], {'id': 3, 'name': 'Joe', "test": 1}) - result = wrappedClient.simpleSelect(tabname, ["id", "name"], {'id': 1}, "id=@id") - assert(len(result) > 0) - assert(result == [(1, "Joe")]) + if (not wrappedClient.serverHigherOrEqualsToVersion("1.2.0")): + return + tabname = wrappedClient.createTestTable( + "id INTEGER", "name VARCHAR", "test INTEGER NOT NULL", "PRIMARY KEY (id, test)") + wrappedClient.insertToTable(tabname, ["id", "name", "test"], [ + "@id", "@name", "@test"], {'id': 1, 'name': 'Joe', "test": 3}) + wrappedClient.insertToTable(tabname, ["id", "name", "test"], [ + "@id", "@name", "@test"], {'id': 2, 'name': 'Joe', "test": 2}) + wrappedClient.insertToTable(tabname, ["id", "name", "test"], [ + "@id", "@name", "@test"], {'id': 33, 'name': 'Joe', "test": 111}) + wrappedClient.insertToTable(tabname, ["id", "name", "test"], [ + "@id", "@name", "@test"], {'id': 3, 'name': 'Joe', "test": 1}) + result = wrappedClient.simpleSelect( + tabname, ["id", "name"], {'id': 1}, "id=@id") + assert (len(result) > 0) + assert (result == [(1, "Joe")]) ww = wrappedClient.client.verifiableSQLGet( - tabname, [datatypesv2.PrimaryKeyIntValue(1), datatypesv2.PrimaryKeyIntValue(3)] + tabname, [datatypesv2.PrimaryKeyIntValue( + 1), datatypesv2.PrimaryKeyIntValue(3)] ) assert ww.verified == True def test_varchar(self, wrappedClient: ImmuTestClient): - if(not wrappedClient.serverHigherOrEqualsToVersion("1.2.0")): - return - tabname = wrappedClient.createTestTable("name VARCHAR[256]", "test INTEGER NOT NULL", "PRIMARY KEY (name)") - wrappedClient.insertToTable(tabname, ["name", "test"], ["@name", "@test"], {'id': 1, 'name': 'Joe', "test": 3}) - wrappedClient.insertToTable(tabname, ["name", "test"], ["@name", "@test"], {'id': 2, 'name': 'Joe1', "test": 2}) - wrappedClient.insertToTable(tabname, ["name", "test"], ["@name", "@test"], {'id': 33, 'name': 'Joe2', "test": 111}) - wrappedClient.insertToTable(tabname, ["name", "test"], ["@name", "@test"], {'id': 3, 'name': 'Joe3', "test": 1}) - result = wrappedClient.simpleSelect(tabname, ["name"], {'name': "Joe"}, "name=@name") - assert(len(result) > 0) - assert(result == [("Joe",)]) + if (not wrappedClient.serverHigherOrEqualsToVersion("1.2.0")): + return + tabname = wrappedClient.createTestTable( + "name VARCHAR[128]", "test INTEGER NOT NULL", "PRIMARY KEY (name)") + wrappedClient.insertToTable(tabname, ["name", "test"], [ + "@name", "@test"], {'id': 1, 'name': 'Joe', "test": 3}) + wrappedClient.insertToTable(tabname, ["name", "test"], [ + "@name", "@test"], {'id': 2, 'name': 'Joe1', "test": 2}) + wrappedClient.insertToTable(tabname, ["name", "test"], [ + "@name", "@test"], {'id': 33, 'name': 'Joe2', "test": 111}) + wrappedClient.insertToTable(tabname, ["name", "test"], [ + "@name", "@test"], {'id': 3, 'name': 'Joe3', "test": 1}) + result = wrappedClient.simpleSelect( + tabname, ["name"], {'name': "Joe"}, "name=@name") + assert (len(result) > 0) + assert (result == [("Joe",)]) ww = wrappedClient.client.verifiableSQLGet( tabname, [datatypesv2.PrimaryKeyVarCharValue("Joe")] @@ -58,56 +71,74 @@ def test_varchar(self, wrappedClient: ImmuTestClient): assert ww.verified == True def test_boolean(self, wrappedClient: ImmuTestClient): - if(not wrappedClient.serverHigherOrEqualsToVersion("1.2.0")): - return - tabname = wrappedClient.createTestTable("name VARCHAR[256]", "test BOOLEAN NOT NULL", "PRIMARY KEY (name, test)") - wrappedClient.insertToTable(tabname, ["name", "test"], ["@name", "@test"], {'id': 1, 'name': 'Joe', "test": True}) - wrappedClient.insertToTable(tabname, ["name", "test"], ["@name", "@test"], {'id': 2, 'name': 'Joe1', "test": False}) - wrappedClient.insertToTable(tabname, ["name", "test"], ["@name", "@test"], {'id': 33, 'name': 'Joe2', "test": True}) - wrappedClient.insertToTable(tabname, ["name", "test"], ["@name", "@test"], {'id': 3, 'name': 'Joe3', "test": False}) - result = wrappedClient.simpleSelect(tabname, ["name"], {'name': "Joe"}, "name=@name") - assert(len(result) > 0) - assert(result == [("Joe",)]) + if (not wrappedClient.serverHigherOrEqualsToVersion("1.2.0")): + return + tabname = wrappedClient.createTestTable( + "name VARCHAR[128]", "test BOOLEAN NOT NULL", "PRIMARY KEY (name, test)") + wrappedClient.insertToTable(tabname, ["name", "test"], [ + "@name", "@test"], {'id': 1, 'name': 'Joe', "test": True}) + wrappedClient.insertToTable(tabname, ["name", "test"], [ + "@name", "@test"], {'id': 2, 'name': 'Joe1', "test": False}) + wrappedClient.insertToTable(tabname, ["name", "test"], [ + "@name", "@test"], {'id': 33, 'name': 'Joe2', "test": True}) + wrappedClient.insertToTable(tabname, ["name", "test"], [ + "@name", "@test"], {'id': 3, 'name': 'Joe3', "test": False}) + result = wrappedClient.simpleSelect( + tabname, ["name"], {'name': "Joe"}, "name=@name") + assert (len(result) > 0) + assert (result == [("Joe",)]) ww = wrappedClient.client.verifiableSQLGet( - tabname, [datatypesv2.PrimaryKeyVarCharValue("Joe"), datatypesv2.PrimaryKeyBoolValue(True)] + tabname, [datatypesv2.PrimaryKeyVarCharValue( + "Joe"), datatypesv2.PrimaryKeyBoolValue(True)] ) assert ww.verified == True - + def test_blob(self, wrappedClient: ImmuTestClient): - if(not wrappedClient.serverHigherOrEqualsToVersion("1.2.0")): - return - tabname = wrappedClient.createTestTable("name BLOB[256]", "test BOOLEAN NOT NULL", "PRIMARY KEY (name, test)") - wrappedClient.insertToTable(tabname, ["name", "test"], ["@name", "@test"], {'id': 1, 'name': b'Joe', "test": True}) - wrappedClient.insertToTable(tabname, ["name", "test"], ["@name", "@test"], {'id': 2, 'name': b'Joe1', "test": False}) - wrappedClient.insertToTable(tabname, ["name", "test"], ["@name", "@test"], {'id': 33, 'name': b'Joe2', "test": True}) - wrappedClient.insertToTable(tabname, ["name", "test"], ["@name", "@test"], {'id': 3, 'name': b'Joe3', "test": False}) - result = wrappedClient.simpleSelect(tabname, ["name"], {'name': b"Joe"}, "name=@name") - assert(len(result) > 0) - assert(result == [(b"Joe",)]) + if (not wrappedClient.serverHigherOrEqualsToVersion("1.2.0")): + return + tabname = wrappedClient.createTestTable( + "name BLOB[128]", "test BOOLEAN NOT NULL", "PRIMARY KEY (name, test)") + wrappedClient.insertToTable(tabname, ["name", "test"], [ + "@name", "@test"], {'id': 1, 'name': b'Joe', "test": True}) + wrappedClient.insertToTable(tabname, ["name", "test"], [ + "@name", "@test"], {'id': 2, 'name': b'Joe1', "test": False}) + wrappedClient.insertToTable(tabname, ["name", "test"], [ + "@name", "@test"], {'id': 33, 'name': b'Joe2', "test": True}) + wrappedClient.insertToTable(tabname, ["name", "test"], [ + "@name", "@test"], {'id': 3, 'name': b'Joe3', "test": False}) + result = wrappedClient.simpleSelect( + tabname, ["name"], {'name': b"Joe"}, "name=@name") + assert (len(result) > 0) + assert (result == [(b"Joe",)]) ww = wrappedClient.client.verifiableSQLGet( - tabname, [datatypesv2.PrimaryKeyBlobValue(b"Joe"), datatypesv2.PrimaryKeyBoolValue(True)] + tabname, [datatypesv2.PrimaryKeyBlobValue( + b"Joe"), datatypesv2.PrimaryKeyBoolValue(True)] ) assert ww.verified == True - - + def test_ts(self, wrappedClient: ImmuTestClient): - if(not wrappedClient.serverHigherOrEqualsToVersion("1.2.0")): - return + if (not wrappedClient.serverHigherOrEqualsToVersion("1.2.0")): + return now = datetime.now().astimezone(timezone.utc) - tabname = wrappedClient.createTestTable("name TIMESTAMP", "test BOOLEAN NOT NULL", "PRIMARY KEY (name, test)") - wrappedClient.insertToTable(tabname, ["name", "test"], ["@name", "@test"], {'id': 1, 'name': now, "test": True}) - wrappedClient.insertToTable(tabname, ["name", "test"], ["@name", "@test"], {'id': 2, 'name': now + timedelta(seconds=1), "test": False}) - wrappedClient.insertToTable(tabname, ["name", "test"], ["@name", "@test"], {'id': 33, 'name': now + timedelta(seconds=2), "test": True}) - wrappedClient.insertToTable(tabname, ["name", "test"], ["@name", "@test"], {'id': 3, 'name': now + timedelta(seconds=3), "test": False}) - result = wrappedClient.simpleSelect(tabname, ["name"], {'name': now}, "name=@name") - assert(len(result) > 0) - assert(result == [(now,)]) + tabname = wrappedClient.createTestTable( + "name TIMESTAMP", "test BOOLEAN NOT NULL", "PRIMARY KEY (name, test)") + wrappedClient.insertToTable(tabname, ["name", "test"], [ + "@name", "@test"], {'id': 1, 'name': now, "test": True}) + wrappedClient.insertToTable(tabname, ["name", "test"], [ + "@name", "@test"], {'id': 2, 'name': now + timedelta(seconds=1), "test": False}) + wrappedClient.insertToTable(tabname, ["name", "test"], [ + "@name", "@test"], {'id': 33, 'name': now + timedelta(seconds=2), "test": True}) + wrappedClient.insertToTable(tabname, ["name", "test"], [ + "@name", "@test"], {'id': 3, 'name': now + timedelta(seconds=3), "test": False}) + result = wrappedClient.simpleSelect( + tabname, ["name"], {'name': now}, "name=@name") + assert (len(result) > 0) + assert (result == [(now,)]) ww = wrappedClient.client.verifiableSQLGet( - tabname, [datatypesv2.PrimaryKeyTsValue(int(now.timestamp()*1e6)), datatypesv2.PrimaryKeyBoolValue(True)] + tabname, [datatypesv2.PrimaryKeyTsValue( + int(now.timestamp()*1e6)), datatypesv2.PrimaryKeyBoolValue(True)] ) assert ww.verified == True - - diff --git a/tests/immu/test_user_operations.py b/tests/immu/test_user_operations.py index e6ef1bf..95ae61e 100644 --- a/tests/immu/test_user_operations.py +++ b/tests/immu/test_user_operations.py @@ -21,6 +21,7 @@ import google.protobuf.empty_pb2 import pytest + def get_random_name(length): return ''.join(random.choice(string.ascii_lowercase) for i in range(length)) @@ -48,28 +49,14 @@ def test_users_functions(self, client: ImmudbClient): except grpc.RpcError as e: assert e.details() == 'user already exists' - user1 = "test_"+get_random_name(8) password = "Pw0:"+get_random_string(12) database = "defaultdb" permission = immudb.constants.PERMISSION_RW - try: - resp = client.createUser(user1, "12345", permission, database) - assert False # it is not allowed to create a trivial password - except grpc.RpcError as e: - pass - - try: - resp = client.createUser(user1, "12345", permission, database) - assert False # it is not allowed to create a trivial password - except grpc.RpcError as e: - pass - newPassword = "Pw1:"+get_random_string(12) resp = client.changePassword(user, newPassword, password) assert type(resp.reply) == google.protobuf.empty_pb2.Empty - with pytest.raises(RpcError): assert client.setActiveUser(True, "not existing user") == True @@ -81,8 +68,6 @@ def test_users_functions(self, client: ImmudbClient): with pytest.raises(RpcError): client.login(user, newPassword) - assert client.setActiveUser(True, user) == True # User again active client.login(user, newPassword) - diff --git a/tests/starttestcontainers.sh b/tests/starttestcontainers.sh old mode 100644 new mode 100755 index a25f41e..4a4343b --- a/tests/starttestcontainers.sh +++ b/tests/starttestcontainers.sh @@ -1,7 +1,7 @@ #!/bin/bash cd "$(dirname "$0")" -docker run -d --health-cmd "immuadmin status" --health-interval 10s --health-timeout 5s --health-retries 5 -v "$PWD"/certs/my.key.pem:/key.pem -p 3322:3322 codenotary/immudb:1.4.0 --signingKey=/key.pem -docker run -d --health-cmd "immuadmin status" --health-interval 10s --health-timeout 5s --health-retries 5 -v "$PWD"/certs/my.key.pem:/key.pem -p 3333:3322 codenotary/immudb:1.3.2 --signingKey=/key.pem -docker run -d --health-cmd "immuadmin status" --health-interval 10s --health-timeout 5s --health-retries 5 -v "$PWD"/certs/my.key.pem:/key.pem -p 3344:3322 codenotary/immudb:1.2.4 --signingKey=/key.pem -docker run -d --health-cmd "immuadmin status" --health-interval 10s --health-timeout 5s --health-retries 5 -v "$PWD"/certs/my.key.pem:/key.pem -p 3355:3322 codenotary/immudb:1.1.0 --signingKey=/key.pem +docker run -d --health-cmd "immuadmin status" --health-interval 10s --health-timeout 5s --health-retries 5 -v "$PWD"/certs/my.key.pem:/key.pem -p 3322:3322 codenotary/immudb:1.9.3 --signingKey=/key.pem +docker run -d --health-cmd "immuadmin status" --health-interval 10s --health-timeout 5s --health-retries 5 -v "$PWD"/certs/my.key.pem:/key.pem -p 3333:3322 codenotary/immudb:1.5.0 --signingKey=/key.pem +docker run -d --health-cmd "immuadmin status" --health-interval 10s --health-timeout 5s --health-retries 5 -v "$PWD"/certs/my.key.pem:/key.pem -p 3344:3322 codenotary/immudb:1.4.1 --signingKey=/key.pem +docker run -d --health-cmd "immuadmin status" --health-interval 10s --health-timeout 5s --health-retries 5 -v "$PWD"/certs/my.key.pem:/key.pem -p 3355:3322 codenotary/immudb:1.4.0 --signingKey=/key.pem