diff --git a/.env.example b/.env.example index 4c96bc5..6c40ad7 100644 --- a/.env.example +++ b/.env.example @@ -5,3 +5,4 @@ IMMUDB_TEST_PORT=56789 IMMUDB_USER=immudb IMMUDB_PWD=immudb IMMUDB_DEFAULT_DB=defaultdb +TAP_TS='1' # This is to enable the TypeScript support in tap testing library diff --git a/package.json b/package.json index bf09e2c..7f600f1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "immudb-node", - "version": "1.0.10-rc.6", - "description": "Node ts client for immudb", + "version": "1.0.10-rc.7", + "description": "Node.js SDK for immudb written in TypeScript", "directories": { "src": "src", "test": "tests" @@ -12,31 +12,34 @@ "prepare": "npm run build", "build": "tsc", "test": "tests/test.sh", - "test:dev": "tests/test.sh --dev" + "test:dev": "tests/test.sh --dev", + "tap": "tap --ts" }, "author": "", "license": "ISC", "devDependencies": { - "@types/node": "^14.14.13", - "@types/tap": "^14.10.2", + "@types/btoa": "^1.2.3", + "@types/google-protobuf": "^3.15.2", + "@types/lodash": "^4.14.170", + "@types/mocha": "^8.2.2", + "@types/node": "^14.17.3", + "@types/tap": "^14.10.3", "@typescript-eslint/eslint-plugin": "^3.9.0", "@typescript-eslint/parser": "^3.9.0", "crypto-ts": "^1.0.2", - "grpc": "^1.24.4", + "grpc": "^1.24.10", + "grpc-tools": "^1.11.1", "grpc_tools_node_protoc_ts": "^5.0.1", - "grpc-tools": "^1.9.0", "protobufjs": "6.10.1", - "tap": "14.10.8", + "tap": "15.0.9", "typescript": "^3.9.7" }, "dependencies": { "@grpc/grpc-js": "1.2.0", - "@types/btoa": "^1.2.3", - "@types/google-protobuf": "^3.7.4", - "@types/mocha": "^8.2.0", "btoa": "1.2.1", - "dotenv": "^8.2.0", + "dotenv": "^8.6.0", "google-protobuf": "3.13.0", + "lodash": "^4.17.21", "ts-node": "^9.1.1" }, "repository": { diff --git a/proto/schema.proto b/proto/schema.proto index bb22da6..27a1e7f 100644 --- a/proto/schema.proto +++ b/proto/schema.proto @@ -1,12 +1,9 @@ /* -Copyright 2019-2020 vChain, Inc. - +Copyright 2021 CodeNotary, Inc. All rights reserved. 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 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,6 +14,7 @@ limitations under the License. syntax = "proto3"; import "google/protobuf/empty.proto"; +import "google/protobuf/struct.proto"; package immudb.schema; @@ -109,6 +107,7 @@ message Op { message ExecAllRequest { repeated Op Operations = 1; + bool noWait = 2; } message Entries { @@ -214,6 +213,7 @@ message InclusionProof { message SetRequest { repeated KeyValue KVs = 1; + bool noWait = 2; } message KeyRequest { @@ -254,6 +254,7 @@ message ReferenceRequest { bytes referencedKey = 2; uint64 atTx = 3; bool boundRef = 4; + bool noWait = 5; } message VerifiableReferenceRequest { @@ -267,6 +268,7 @@ message ZAddRequest { bytes key = 3; uint64 atTx = 4; bool boundRef = 5; + bool noWait = 6; } message Score { @@ -320,7 +322,41 @@ message TxList { } message Database { - string databasename = 1; + string databaseName = 1; +} + +message Table { + string tableName = 1; +} + +message SQLGetRequest { + string table = 1; + SQLValue pkValue = 2; + uint64 atTx = 3; + uint64 sinceTx = 4; +} + +message VerifiableSQLGetRequest { + SQLGetRequest sqlGetRequest = 1; + uint64 proveSinceTx = 2; +} + +message SQLEntry { + uint64 tx = 1; + bytes key = 2; + bytes value = 3; +} + +message VerifiableSQLEntry { + SQLEntry sqlEntry = 1; + VerifiableTx verifiableTx = 2; + InclusionProof inclusionProof = 3; + uint64 DatabaseId = 4; + uint64 TableId = 5; + string PKName = 6; + map ColIdsById = 8; + map ColIdsByName = 9; + map ColTypesById = 10; } message UseDatabaseReply{ @@ -348,71 +384,113 @@ message DatabaseListResponse{ repeated Database databases = 1; } -// immudb gRPC & REST service -// IMPORTANT: All get and safeget functions return base64-encoded keys and values, while all set and safeset functions expect base64-encoded inputs. -service ImmuService { - rpc ListUsers (google.protobuf.Empty) returns (UserList){}; - - rpc CreateUser (CreateUserRequest) returns (google.protobuf.Empty){}; - - rpc ChangePassword (ChangePasswordRequest) returns (google.protobuf.Empty){}; - - rpc UpdateAuthConfig (AuthConfig) returns (google.protobuf.Empty){} - rpc UpdateMTLSConfig (MTLSConfig) returns (google.protobuf.Empty){} - - rpc Login (LoginRequest) returns (LoginResponse){}; - - rpc Logout (google.protobuf.Empty) returns (google.protobuf.Empty){}; - - rpc Set (SetRequest) returns (TxMetadata){}; - - rpc VerifiableSet (VerifiableSetRequest) returns (VerifiableTx){}; - - rpc Get (KeyRequest) returns (Entry){}; - - rpc VerifiableGet (VerifiableGetRequest) returns (VerifiableEntry){}; - - rpc GetAll (KeyListRequest) returns (Entries){}; - - rpc ExecAll (ExecAllRequest) returns (TxMetadata) {}; - - rpc Scan(ScanRequest) returns (Entries){}; - - rpc Count(KeyPrefix) returns (EntryCount){}; - - rpc CountAll(google.protobuf.Empty) returns (EntryCount){}; - - rpc TxById(TxRequest) returns (Tx){}; - - rpc VerifiableTxById(VerifiableTxRequest) returns (VerifiableTx){}; - - rpc TxScan(TxScanRequest) returns (TxList) {} - - rpc History(HistoryRequest) returns (Entries){}; - - rpc Health (google.protobuf.Empty) returns (HealthResponse){}; - - rpc CurrentState (google.protobuf.Empty) returns (ImmutableState){}; - - rpc SetReference (ReferenceRequest) returns (TxMetadata){}; - - rpc VerifiableSetReference (VerifiableReferenceRequest) returns (VerifiableTx){}; +message Chunk { + bytes content = 1; +} - rpc ZAdd (ZAddRequest) returns (TxMetadata){}; +message UseSnapshotRequest { + uint64 sinceTx = 1; + uint64 asBeforeTx = 2; +} - rpc VerifiableZAdd (VerifiableZAddRequest) returns (VerifiableTx){}; +message SQLExecRequest { + string sql = 1; + repeated NamedParam params = 2; + bool noWait = 3; +} - rpc ZScan (ZScanRequest) returns (ZEntries){}; +message SQLQueryRequest { + string sql = 1; + repeated NamedParam params = 2; + bool reuseSnapshot = 3; +} - rpc CreateDatabase(Database) returns (google.protobuf.Empty) {} +message NamedParam { + string name = 1; + SQLValue value = 2; +} - rpc DatabaseList (google.protobuf.Empty) returns (DatabaseListResponse){}; +message SQLExecResult { + repeated TxMetadata ctxs = 1; + repeated TxMetadata dtxs = 2; +} - rpc UseDatabase(Database) returns (UseDatabaseReply) {} +message SQLQueryResult { + repeated Column columns = 2; + repeated Row rows = 1; +} - rpc CleanIndex(google.protobuf.Empty) returns (google.protobuf.Empty) {} +message Column { + string name = 1; + string type = 2; +} - rpc ChangePermission(ChangePermissionRequest) returns (google.protobuf.Empty) {} +message Row { + repeated string columns = 1; + repeated SQLValue values = 2; +} - rpc SetActiveUser (SetActiveUserRequest) returns (google.protobuf.Empty){}; +message SQLValue { + oneof value { + google.protobuf.NullValue null = 1; + uint64 n = 2; + string s = 3; + bool b = 4; + bytes bs = 5; + } } + +// immudb gRPC & REST service +// IMPORTANT: All get and safeget functions return base64-encoded keys and values, while all set and safeset functions expect base64-encoded inputs. +service ImmuService { + rpc ListUsers (google.protobuf.Empty) returns (UserList); + rpc CreateUser (CreateUserRequest) returns (google.protobuf.Empty); + rpc ChangePassword (ChangePasswordRequest) returns (google.protobuf.Empty); + rpc UpdateAuthConfig (AuthConfig) returns (google.protobuf.Empty); + rpc UpdateMTLSConfig (MTLSConfig) returns (google.protobuf.Empty); + rpc Login (LoginRequest) returns (LoginResponse); + rpc Logout (google.protobuf.Empty) returns (google.protobuf.Empty); + rpc Set (SetRequest) returns (TxMetadata); + rpc VerifiableSet (VerifiableSetRequest) returns (VerifiableTx); + rpc Get (KeyRequest) returns (Entry); + rpc VerifiableGet (VerifiableGetRequest) returns (VerifiableEntry); + rpc GetAll (KeyListRequest) returns (Entries); + rpc ExecAll (ExecAllRequest) returns (TxMetadata); + rpc Scan(ScanRequest) returns (Entries); + rpc Count(KeyPrefix) returns (EntryCount); + rpc CountAll(google.protobuf.Empty) returns (EntryCount); + rpc TxById(TxRequest) returns (Tx); + rpc VerifiableTxById(VerifiableTxRequest) returns (VerifiableTx); + rpc TxScan(TxScanRequest) returns (TxList); + rpc History(HistoryRequest) returns (Entries); + rpc Health (google.protobuf.Empty) returns (HealthResponse); + rpc CurrentState (google.protobuf.Empty) returns (ImmutableState); + rpc SetReference (ReferenceRequest) returns (TxMetadata); + rpc VerifiableSetReference (VerifiableReferenceRequest) returns (VerifiableTx); + rpc ZAdd (ZAddRequest) returns (TxMetadata); + rpc VerifiableZAdd (VerifiableZAddRequest) returns (VerifiableTx); + rpc ZScan (ZScanRequest) returns (ZEntries); + rpc CreateDatabase(Database) returns (google.protobuf.Empty); + rpc DatabaseList (google.protobuf.Empty) returns (DatabaseListResponse); + rpc UseDatabase(Database) returns (UseDatabaseReply); + rpc CleanIndex(google.protobuf.Empty) returns (google.protobuf.Empty); + rpc ChangePermission(ChangePermissionRequest) returns (google.protobuf.Empty); + rpc SetActiveUser (SetActiveUserRequest) returns (google.protobuf.Empty); + // Streams + rpc streamGet(KeyRequest) returns (stream Chunk); + rpc streamSet(stream Chunk) returns (TxMetadata); + 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 (TxMetadata); + + // SQL + rpc UseSnapshot(UseSnapshotRequest) returns (google.protobuf.Empty); + rpc SQLExec(SQLExecRequest) returns (SQLExecResult); + rpc SQLQuery(SQLQueryRequest) returns (SQLQueryResult); + rpc ListTables(google.protobuf.Empty) returns (SQLQueryResult); + rpc DescribeTable(Table) returns (SQLQueryResult); + rpc VerifiableSQLGet (VerifiableSQLGetRequest) returns (VerifiableSQLEntry); +} \ No newline at end of file diff --git a/src/client.ts b/src/client.ts index 1fa95f0..efea368 100644 --- a/src/client.ts +++ b/src/client.ts @@ -271,11 +271,11 @@ class ImmudbClient { req.setKey(util.utf8Encode(key)); - return new Promise(resolve => + return new Promise((resolve, reject) => this.client.get(req, this._metadata, (err, res) => { if (err) { console.error('Get error', err); - throw new Error(err.message); + reject(err.message); } else { resolve({ tx: res && res.getTx(), @@ -352,7 +352,7 @@ class ImmudbClient { this.client.listUsers(req, this._metadata, (err, res) => { if (err) { console.error('List users error', err); - throw new Error(err.message); + reject(err.message); } const ul = res && res.getUsersList(); @@ -443,7 +443,7 @@ class ImmudbClient { this.client.logout(req, this._metadata, (err, res) => { if (err) { console.error('Logout error', err); - throw new Error(err.message); + reject(err.message); } resolve(res); @@ -961,7 +961,7 @@ class ImmudbClient { refReq.setBoundref(attx > 0) req.setReferencerequest(refReq) - req.setProvesincetx(state.getTxid()) + req.setProvesincetx(txid) return new Promise((resolve, reject) => this.client.verifiableSetReference(req, this._metadata, (err, res) => { if (err) { diff --git a/src/proto/schema_grpc_pb.d.ts b/src/proto/schema_grpc_pb.d.ts index 74031ee..d543c6d 100644 --- a/src/proto/schema_grpc_pb.d.ts +++ b/src/proto/schema_grpc_pb.d.ts @@ -7,6 +7,7 @@ import * as grpc from "grpc"; import * as schema_pb from "./schema_pb"; import * as google_protobuf_empty_pb from "google-protobuf/google/protobuf/empty_pb"; +import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; interface IImmuServiceService extends grpc.ServiceDefinition { listUsers: IImmuServiceService_IListUsers; @@ -42,6 +43,20 @@ interface IImmuServiceService extends grpc.ServiceDefinition { @@ -341,6 +356,132 @@ interface IImmuServiceService_ISetActiveUser extends grpc.MethodDefinition; responseDeserialize: grpc.deserialize; } +interface IImmuServiceService_IstreamGet extends grpc.MethodDefinition { + path: "/immudb.schema.ImmuService/streamGet"; + requestStream: false; + responseStream: true; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IImmuServiceService_IstreamSet extends grpc.MethodDefinition { + path: "/immudb.schema.ImmuService/streamSet"; + requestStream: true; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IImmuServiceService_IstreamVerifiableGet extends grpc.MethodDefinition { + path: "/immudb.schema.ImmuService/streamVerifiableGet"; + requestStream: false; + responseStream: true; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IImmuServiceService_IstreamVerifiableSet extends grpc.MethodDefinition { + path: "/immudb.schema.ImmuService/streamVerifiableSet"; + requestStream: true; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IImmuServiceService_IstreamScan extends grpc.MethodDefinition { + path: "/immudb.schema.ImmuService/streamScan"; + requestStream: false; + responseStream: true; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IImmuServiceService_IstreamZScan extends grpc.MethodDefinition { + path: "/immudb.schema.ImmuService/streamZScan"; + requestStream: false; + responseStream: true; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IImmuServiceService_IstreamHistory extends grpc.MethodDefinition { + path: "/immudb.schema.ImmuService/streamHistory"; + requestStream: false; + responseStream: true; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IImmuServiceService_IstreamExecAll extends grpc.MethodDefinition { + path: "/immudb.schema.ImmuService/streamExecAll"; + requestStream: true; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IImmuServiceService_IUseSnapshot extends grpc.MethodDefinition { + path: "/immudb.schema.ImmuService/UseSnapshot"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IImmuServiceService_ISQLExec extends grpc.MethodDefinition { + path: "/immudb.schema.ImmuService/SQLExec"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IImmuServiceService_ISQLQuery extends grpc.MethodDefinition { + path: "/immudb.schema.ImmuService/SQLQuery"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IImmuServiceService_IListTables extends grpc.MethodDefinition { + path: "/immudb.schema.ImmuService/ListTables"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IImmuServiceService_IDescribeTable extends grpc.MethodDefinition { + path: "/immudb.schema.ImmuService/DescribeTable"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IImmuServiceService_IVerifiableSQLGet extends grpc.MethodDefinition { + path: "/immudb.schema.ImmuService/VerifiableSQLGet"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} export const ImmuServiceService: IImmuServiceService; @@ -378,6 +519,20 @@ export interface IImmuServiceServer { cleanIndex: grpc.handleUnaryCall; changePermission: grpc.handleUnaryCall; setActiveUser: grpc.handleUnaryCall; + streamGet: grpc.handleServerStreamingCall; + streamSet: grpc.handleClientStreamingCall; + streamVerifiableGet: grpc.handleServerStreamingCall; + streamVerifiableSet: grpc.handleClientStreamingCall; + streamScan: grpc.handleServerStreamingCall; + streamZScan: grpc.handleServerStreamingCall; + streamHistory: grpc.handleServerStreamingCall; + streamExecAll: grpc.handleClientStreamingCall; + useSnapshot: grpc.handleUnaryCall; + sQLExec: grpc.handleUnaryCall; + sQLQuery: grpc.handleUnaryCall; + listTables: grpc.handleUnaryCall; + describeTable: grpc.handleUnaryCall; + verifiableSQLGet: grpc.handleUnaryCall; } export interface IImmuServiceClient { @@ -480,6 +635,46 @@ export interface IImmuServiceClient { setActiveUser(request: schema_pb.SetActiveUserRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; setActiveUser(request: schema_pb.SetActiveUserRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; setActiveUser(request: schema_pb.SetActiveUserRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + streamGet(request: schema_pb.KeyRequest, options?: Partial): grpc.ClientReadableStream; + streamGet(request: schema_pb.KeyRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; + streamSet(callback: (error: grpc.ServiceError | null, response: schema_pb.TxMetadata) => void): grpc.ClientWritableStream; + streamSet(metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: schema_pb.TxMetadata) => void): grpc.ClientWritableStream; + streamSet(options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.TxMetadata) => void): grpc.ClientWritableStream; + streamSet(metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.TxMetadata) => void): grpc.ClientWritableStream; + streamVerifiableGet(request: schema_pb.VerifiableGetRequest, options?: Partial): grpc.ClientReadableStream; + streamVerifiableGet(request: schema_pb.VerifiableGetRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; + streamVerifiableSet(callback: (error: grpc.ServiceError | null, response: schema_pb.VerifiableTx) => void): grpc.ClientWritableStream; + streamVerifiableSet(metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: schema_pb.VerifiableTx) => void): grpc.ClientWritableStream; + streamVerifiableSet(options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.VerifiableTx) => void): grpc.ClientWritableStream; + streamVerifiableSet(metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.VerifiableTx) => void): grpc.ClientWritableStream; + streamScan(request: schema_pb.ScanRequest, options?: Partial): grpc.ClientReadableStream; + streamScan(request: schema_pb.ScanRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; + streamZScan(request: schema_pb.ZScanRequest, options?: Partial): grpc.ClientReadableStream; + streamZScan(request: schema_pb.ZScanRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; + streamHistory(request: schema_pb.HistoryRequest, options?: Partial): grpc.ClientReadableStream; + streamHistory(request: schema_pb.HistoryRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; + streamExecAll(callback: (error: grpc.ServiceError | null, response: schema_pb.TxMetadata) => void): grpc.ClientWritableStream; + streamExecAll(metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: schema_pb.TxMetadata) => void): grpc.ClientWritableStream; + streamExecAll(options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.TxMetadata) => void): grpc.ClientWritableStream; + streamExecAll(metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.TxMetadata) => void): grpc.ClientWritableStream; + useSnapshot(request: schema_pb.UseSnapshotRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + useSnapshot(request: schema_pb.UseSnapshotRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + useSnapshot(request: schema_pb.UseSnapshotRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + sQLExec(request: schema_pb.SQLExecRequest, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLExecResult) => void): grpc.ClientUnaryCall; + sQLExec(request: schema_pb.SQLExecRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLExecResult) => void): grpc.ClientUnaryCall; + sQLExec(request: schema_pb.SQLExecRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLExecResult) => void): grpc.ClientUnaryCall; + sQLQuery(request: schema_pb.SQLQueryRequest, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLQueryResult) => void): grpc.ClientUnaryCall; + sQLQuery(request: schema_pb.SQLQueryRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLQueryResult) => void): grpc.ClientUnaryCall; + sQLQuery(request: schema_pb.SQLQueryRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLQueryResult) => void): grpc.ClientUnaryCall; + listTables(request: google_protobuf_empty_pb.Empty, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLQueryResult) => void): grpc.ClientUnaryCall; + listTables(request: google_protobuf_empty_pb.Empty, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLQueryResult) => void): grpc.ClientUnaryCall; + listTables(request: google_protobuf_empty_pb.Empty, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLQueryResult) => void): grpc.ClientUnaryCall; + describeTable(request: schema_pb.Table, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLQueryResult) => void): grpc.ClientUnaryCall; + describeTable(request: schema_pb.Table, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLQueryResult) => void): grpc.ClientUnaryCall; + describeTable(request: schema_pb.Table, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLQueryResult) => void): grpc.ClientUnaryCall; + verifiableSQLGet(request: schema_pb.VerifiableSQLGetRequest, callback: (error: grpc.ServiceError | null, response: schema_pb.VerifiableSQLEntry) => void): grpc.ClientUnaryCall; + verifiableSQLGet(request: schema_pb.VerifiableSQLGetRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: schema_pb.VerifiableSQLEntry) => void): grpc.ClientUnaryCall; + verifiableSQLGet(request: schema_pb.VerifiableSQLGetRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.VerifiableSQLEntry) => void): grpc.ClientUnaryCall; } export class ImmuServiceClient extends grpc.Client implements IImmuServiceClient { @@ -583,4 +778,44 @@ export class ImmuServiceClient extends grpc.Client implements IImmuServiceClient public setActiveUser(request: schema_pb.SetActiveUserRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; public setActiveUser(request: schema_pb.SetActiveUserRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; public setActiveUser(request: schema_pb.SetActiveUserRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public streamGet(request: schema_pb.KeyRequest, options?: Partial): grpc.ClientReadableStream; + public streamGet(request: schema_pb.KeyRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; + public streamSet(callback: (error: grpc.ServiceError | null, response: schema_pb.TxMetadata) => void): grpc.ClientWritableStream; + public streamSet(metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: schema_pb.TxMetadata) => void): grpc.ClientWritableStream; + public streamSet(options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.TxMetadata) => void): grpc.ClientWritableStream; + public streamSet(metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.TxMetadata) => void): grpc.ClientWritableStream; + public streamVerifiableGet(request: schema_pb.VerifiableGetRequest, options?: Partial): grpc.ClientReadableStream; + public streamVerifiableGet(request: schema_pb.VerifiableGetRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; + public streamVerifiableSet(callback: (error: grpc.ServiceError | null, response: schema_pb.VerifiableTx) => void): grpc.ClientWritableStream; + public streamVerifiableSet(metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: schema_pb.VerifiableTx) => void): grpc.ClientWritableStream; + public streamVerifiableSet(options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.VerifiableTx) => void): grpc.ClientWritableStream; + public streamVerifiableSet(metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.VerifiableTx) => void): grpc.ClientWritableStream; + public streamScan(request: schema_pb.ScanRequest, options?: Partial): grpc.ClientReadableStream; + public streamScan(request: schema_pb.ScanRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; + public streamZScan(request: schema_pb.ZScanRequest, options?: Partial): grpc.ClientReadableStream; + public streamZScan(request: schema_pb.ZScanRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; + public streamHistory(request: schema_pb.HistoryRequest, options?: Partial): grpc.ClientReadableStream; + public streamHistory(request: schema_pb.HistoryRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; + public streamExecAll(callback: (error: grpc.ServiceError | null, response: schema_pb.TxMetadata) => void): grpc.ClientWritableStream; + public streamExecAll(metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: schema_pb.TxMetadata) => void): grpc.ClientWritableStream; + public streamExecAll(options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.TxMetadata) => void): grpc.ClientWritableStream; + public streamExecAll(metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.TxMetadata) => void): grpc.ClientWritableStream; + public useSnapshot(request: schema_pb.UseSnapshotRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public useSnapshot(request: schema_pb.UseSnapshotRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public useSnapshot(request: schema_pb.UseSnapshotRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public sQLExec(request: schema_pb.SQLExecRequest, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLExecResult) => void): grpc.ClientUnaryCall; + public sQLExec(request: schema_pb.SQLExecRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLExecResult) => void): grpc.ClientUnaryCall; + public sQLExec(request: schema_pb.SQLExecRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLExecResult) => void): grpc.ClientUnaryCall; + public sQLQuery(request: schema_pb.SQLQueryRequest, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLQueryResult) => void): grpc.ClientUnaryCall; + public sQLQuery(request: schema_pb.SQLQueryRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLQueryResult) => void): grpc.ClientUnaryCall; + public sQLQuery(request: schema_pb.SQLQueryRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLQueryResult) => void): grpc.ClientUnaryCall; + public listTables(request: google_protobuf_empty_pb.Empty, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLQueryResult) => void): grpc.ClientUnaryCall; + public listTables(request: google_protobuf_empty_pb.Empty, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLQueryResult) => void): grpc.ClientUnaryCall; + public listTables(request: google_protobuf_empty_pb.Empty, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLQueryResult) => void): grpc.ClientUnaryCall; + public describeTable(request: schema_pb.Table, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLQueryResult) => void): grpc.ClientUnaryCall; + public describeTable(request: schema_pb.Table, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLQueryResult) => void): grpc.ClientUnaryCall; + public describeTable(request: schema_pb.Table, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.SQLQueryResult) => void): grpc.ClientUnaryCall; + public verifiableSQLGet(request: schema_pb.VerifiableSQLGetRequest, callback: (error: grpc.ServiceError | null, response: schema_pb.VerifiableSQLEntry) => void): grpc.ClientUnaryCall; + public verifiableSQLGet(request: schema_pb.VerifiableSQLGetRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: schema_pb.VerifiableSQLEntry) => void): grpc.ClientUnaryCall; + public verifiableSQLGet(request: schema_pb.VerifiableSQLGetRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: schema_pb.VerifiableSQLEntry) => void): grpc.ClientUnaryCall; } diff --git a/src/proto/schema_grpc_pb.js b/src/proto/schema_grpc_pb.js index 74eab7e..0f0fc72 100644 --- a/src/proto/schema_grpc_pb.js +++ b/src/proto/schema_grpc_pb.js @@ -2,14 +2,11 @@ // Original file comments: // -// Copyright 2019-2020 vChain, Inc. -// +// Copyright 2021 CodeNotary, Inc. All rights reserved. // 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 -// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,6 +17,7 @@ var grpc = require('@grpc/grpc-js'); var schema_pb = require('./schema_pb.js'); var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js'); +var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); function serialize_google_protobuf_Empty(arg) { if (!(arg instanceof google_protobuf_empty_pb.Empty)) { @@ -65,6 +63,17 @@ function deserialize_immudb_schema_ChangePermissionRequest(buffer_arg) { return schema_pb.ChangePermissionRequest.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_immudb_schema_Chunk(arg) { + if (!(arg instanceof schema_pb.Chunk)) { + throw new Error('Expected argument of type immudb.schema.Chunk'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_immudb_schema_Chunk(buffer_arg) { + return schema_pb.Chunk.deserializeBinary(new Uint8Array(buffer_arg)); +} + function serialize_immudb_schema_CreateUserRequest(arg) { if (!(arg instanceof schema_pb.CreateUserRequest)) { throw new Error('Expected argument of type immudb.schema.CreateUserRequest'); @@ -252,6 +261,50 @@ function deserialize_immudb_schema_ReferenceRequest(buffer_arg) { return schema_pb.ReferenceRequest.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_immudb_schema_SQLExecRequest(arg) { + if (!(arg instanceof schema_pb.SQLExecRequest)) { + throw new Error('Expected argument of type immudb.schema.SQLExecRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_immudb_schema_SQLExecRequest(buffer_arg) { + return schema_pb.SQLExecRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_immudb_schema_SQLExecResult(arg) { + if (!(arg instanceof schema_pb.SQLExecResult)) { + throw new Error('Expected argument of type immudb.schema.SQLExecResult'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_immudb_schema_SQLExecResult(buffer_arg) { + return schema_pb.SQLExecResult.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_immudb_schema_SQLQueryRequest(arg) { + if (!(arg instanceof schema_pb.SQLQueryRequest)) { + throw new Error('Expected argument of type immudb.schema.SQLQueryRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_immudb_schema_SQLQueryRequest(buffer_arg) { + return schema_pb.SQLQueryRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_immudb_schema_SQLQueryResult(arg) { + if (!(arg instanceof schema_pb.SQLQueryResult)) { + throw new Error('Expected argument of type immudb.schema.SQLQueryResult'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_immudb_schema_SQLQueryResult(buffer_arg) { + return schema_pb.SQLQueryResult.deserializeBinary(new Uint8Array(buffer_arg)); +} + function serialize_immudb_schema_ScanRequest(arg) { if (!(arg instanceof schema_pb.ScanRequest)) { throw new Error('Expected argument of type immudb.schema.ScanRequest'); @@ -285,6 +338,17 @@ function deserialize_immudb_schema_SetRequest(buffer_arg) { return schema_pb.SetRequest.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_immudb_schema_Table(arg) { + if (!(arg instanceof schema_pb.Table)) { + throw new Error('Expected argument of type immudb.schema.Table'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_immudb_schema_Table(buffer_arg) { + return schema_pb.Table.deserializeBinary(new Uint8Array(buffer_arg)); +} + function serialize_immudb_schema_Tx(arg) { if (!(arg instanceof schema_pb.Tx)) { throw new Error('Expected argument of type immudb.schema.Tx'); @@ -351,6 +415,17 @@ function deserialize_immudb_schema_UseDatabaseReply(buffer_arg) { return schema_pb.UseDatabaseReply.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_immudb_schema_UseSnapshotRequest(arg) { + if (!(arg instanceof schema_pb.UseSnapshotRequest)) { + throw new Error('Expected argument of type immudb.schema.UseSnapshotRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_immudb_schema_UseSnapshotRequest(buffer_arg) { + return schema_pb.UseSnapshotRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + function serialize_immudb_schema_UserList(arg) { if (!(arg instanceof schema_pb.UserList)) { throw new Error('Expected argument of type immudb.schema.UserList'); @@ -395,6 +470,28 @@ function deserialize_immudb_schema_VerifiableReferenceRequest(buffer_arg) { return schema_pb.VerifiableReferenceRequest.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_immudb_schema_VerifiableSQLEntry(arg) { + if (!(arg instanceof schema_pb.VerifiableSQLEntry)) { + throw new Error('Expected argument of type immudb.schema.VerifiableSQLEntry'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_immudb_schema_VerifiableSQLEntry(buffer_arg) { + return schema_pb.VerifiableSQLEntry.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_immudb_schema_VerifiableSQLGetRequest(arg) { + if (!(arg instanceof schema_pb.VerifiableSQLGetRequest)) { + throw new Error('Expected argument of type immudb.schema.VerifiableSQLGetRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_immudb_schema_VerifiableSQLGetRequest(buffer_arg) { + return schema_pb.VerifiableSQLGetRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + function serialize_immudb_schema_VerifiableSetRequest(arg) { if (!(arg instanceof schema_pb.VerifiableSetRequest)) { throw new Error('Expected argument of type immudb.schema.VerifiableSetRequest'); @@ -839,6 +936,162 @@ var ImmuServiceService = exports.ImmuServiceService = { responseSerialize: serialize_google_protobuf_Empty, responseDeserialize: deserialize_google_protobuf_Empty, }, + // Streams +streamGet: { + path: '/immudb.schema.ImmuService/streamGet', + requestStream: false, + responseStream: true, + requestType: schema_pb.KeyRequest, + responseType: schema_pb.Chunk, + requestSerialize: serialize_immudb_schema_KeyRequest, + requestDeserialize: deserialize_immudb_schema_KeyRequest, + responseSerialize: serialize_immudb_schema_Chunk, + responseDeserialize: deserialize_immudb_schema_Chunk, + }, + streamSet: { + path: '/immudb.schema.ImmuService/streamSet', + requestStream: true, + responseStream: false, + requestType: schema_pb.Chunk, + responseType: schema_pb.TxMetadata, + requestSerialize: serialize_immudb_schema_Chunk, + requestDeserialize: deserialize_immudb_schema_Chunk, + responseSerialize: serialize_immudb_schema_TxMetadata, + responseDeserialize: deserialize_immudb_schema_TxMetadata, + }, + streamVerifiableGet: { + path: '/immudb.schema.ImmuService/streamVerifiableGet', + requestStream: false, + responseStream: true, + requestType: schema_pb.VerifiableGetRequest, + responseType: schema_pb.Chunk, + requestSerialize: serialize_immudb_schema_VerifiableGetRequest, + requestDeserialize: deserialize_immudb_schema_VerifiableGetRequest, + responseSerialize: serialize_immudb_schema_Chunk, + responseDeserialize: deserialize_immudb_schema_Chunk, + }, + streamVerifiableSet: { + path: '/immudb.schema.ImmuService/streamVerifiableSet', + requestStream: true, + responseStream: false, + requestType: schema_pb.Chunk, + responseType: schema_pb.VerifiableTx, + requestSerialize: serialize_immudb_schema_Chunk, + requestDeserialize: deserialize_immudb_schema_Chunk, + responseSerialize: serialize_immudb_schema_VerifiableTx, + responseDeserialize: deserialize_immudb_schema_VerifiableTx, + }, + streamScan: { + path: '/immudb.schema.ImmuService/streamScan', + requestStream: false, + responseStream: true, + requestType: schema_pb.ScanRequest, + responseType: schema_pb.Chunk, + requestSerialize: serialize_immudb_schema_ScanRequest, + requestDeserialize: deserialize_immudb_schema_ScanRequest, + responseSerialize: serialize_immudb_schema_Chunk, + responseDeserialize: deserialize_immudb_schema_Chunk, + }, + streamZScan: { + path: '/immudb.schema.ImmuService/streamZScan', + requestStream: false, + responseStream: true, + requestType: schema_pb.ZScanRequest, + responseType: schema_pb.Chunk, + requestSerialize: serialize_immudb_schema_ZScanRequest, + requestDeserialize: deserialize_immudb_schema_ZScanRequest, + responseSerialize: serialize_immudb_schema_Chunk, + responseDeserialize: deserialize_immudb_schema_Chunk, + }, + streamHistory: { + path: '/immudb.schema.ImmuService/streamHistory', + requestStream: false, + responseStream: true, + requestType: schema_pb.HistoryRequest, + responseType: schema_pb.Chunk, + requestSerialize: serialize_immudb_schema_HistoryRequest, + requestDeserialize: deserialize_immudb_schema_HistoryRequest, + responseSerialize: serialize_immudb_schema_Chunk, + responseDeserialize: deserialize_immudb_schema_Chunk, + }, + streamExecAll: { + path: '/immudb.schema.ImmuService/streamExecAll', + requestStream: true, + responseStream: false, + requestType: schema_pb.Chunk, + responseType: schema_pb.TxMetadata, + requestSerialize: serialize_immudb_schema_Chunk, + requestDeserialize: deserialize_immudb_schema_Chunk, + responseSerialize: serialize_immudb_schema_TxMetadata, + responseDeserialize: deserialize_immudb_schema_TxMetadata, + }, + // SQL +useSnapshot: { + path: '/immudb.schema.ImmuService/UseSnapshot', + requestStream: false, + responseStream: false, + requestType: schema_pb.UseSnapshotRequest, + responseType: google_protobuf_empty_pb.Empty, + requestSerialize: serialize_immudb_schema_UseSnapshotRequest, + requestDeserialize: deserialize_immudb_schema_UseSnapshotRequest, + responseSerialize: serialize_google_protobuf_Empty, + responseDeserialize: deserialize_google_protobuf_Empty, + }, + sQLExec: { + path: '/immudb.schema.ImmuService/SQLExec', + requestStream: false, + responseStream: false, + requestType: schema_pb.SQLExecRequest, + responseType: schema_pb.SQLExecResult, + requestSerialize: serialize_immudb_schema_SQLExecRequest, + requestDeserialize: deserialize_immudb_schema_SQLExecRequest, + responseSerialize: serialize_immudb_schema_SQLExecResult, + responseDeserialize: deserialize_immudb_schema_SQLExecResult, + }, + sQLQuery: { + path: '/immudb.schema.ImmuService/SQLQuery', + requestStream: false, + responseStream: false, + requestType: schema_pb.SQLQueryRequest, + responseType: schema_pb.SQLQueryResult, + requestSerialize: serialize_immudb_schema_SQLQueryRequest, + requestDeserialize: deserialize_immudb_schema_SQLQueryRequest, + responseSerialize: serialize_immudb_schema_SQLQueryResult, + responseDeserialize: deserialize_immudb_schema_SQLQueryResult, + }, + listTables: { + path: '/immudb.schema.ImmuService/ListTables', + requestStream: false, + responseStream: false, + requestType: google_protobuf_empty_pb.Empty, + responseType: schema_pb.SQLQueryResult, + requestSerialize: serialize_google_protobuf_Empty, + requestDeserialize: deserialize_google_protobuf_Empty, + responseSerialize: serialize_immudb_schema_SQLQueryResult, + responseDeserialize: deserialize_immudb_schema_SQLQueryResult, + }, + describeTable: { + path: '/immudb.schema.ImmuService/DescribeTable', + requestStream: false, + responseStream: false, + requestType: schema_pb.Table, + responseType: schema_pb.SQLQueryResult, + requestSerialize: serialize_immudb_schema_Table, + requestDeserialize: deserialize_immudb_schema_Table, + responseSerialize: serialize_immudb_schema_SQLQueryResult, + responseDeserialize: deserialize_immudb_schema_SQLQueryResult, + }, + verifiableSQLGet: { + path: '/immudb.schema.ImmuService/VerifiableSQLGet', + requestStream: false, + responseStream: false, + requestType: schema_pb.VerifiableSQLGetRequest, + responseType: schema_pb.VerifiableSQLEntry, + requestSerialize: serialize_immudb_schema_VerifiableSQLGetRequest, + requestDeserialize: deserialize_immudb_schema_VerifiableSQLGetRequest, + responseSerialize: serialize_immudb_schema_VerifiableSQLEntry, + responseDeserialize: deserialize_immudb_schema_VerifiableSQLEntry, + }, }; exports.ImmuServiceClient = grpc.makeGenericClientConstructor(ImmuServiceService); diff --git a/src/proto/schema_pb.d.ts b/src/proto/schema_pb.d.ts index 4e8d1b9..d237aec 100644 --- a/src/proto/schema_pb.d.ts +++ b/src/proto/schema_pb.d.ts @@ -6,6 +6,7 @@ import * as jspb from "google-protobuf"; import * as google_protobuf_empty_pb from "google-protobuf/google/protobuf/empty_pb"; +import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; export class Key extends jspb.Message { getKey(): Uint8Array | string; @@ -13,7 +14,6 @@ export class Key extends jspb.Message { getKey_asB64(): string; setKey(value: Uint8Array | string): Key; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Key.AsObject; static toObject(includeInstance: boolean, msg: Key): Key.AsObject; @@ -33,11 +33,9 @@ export namespace Key { export class Permission extends jspb.Message { getDatabase(): string; setDatabase(value: string): Permission; - getPermission(): number; setPermission(value: number): Permission; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Permission.AsObject; static toObject(includeInstance: boolean, msg: Permission): Permission.AsObject; @@ -60,22 +58,17 @@ export class User extends jspb.Message { getUser_asU8(): Uint8Array; getUser_asB64(): string; setUser(value: Uint8Array | string): User; - clearPermissionsList(): void; getPermissionsList(): Array; setPermissionsList(value: Array): User; addPermissions(value?: Permission, index?: number): Permission; - getCreatedby(): string; setCreatedby(value: string): User; - getCreatedat(): string; setCreatedat(value: string): User; - getActive(): boolean; setActive(value: boolean): User; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): User.AsObject; static toObject(includeInstance: boolean, msg: User): User.AsObject; @@ -102,7 +95,6 @@ export class UserList extends jspb.Message { setUsersList(value: Array): UserList; addUsers(value?: User, index?: number): User; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): UserList.AsObject; static toObject(includeInstance: boolean, msg: UserList): UserList.AsObject; @@ -124,19 +116,15 @@ export class CreateUserRequest extends jspb.Message { getUser_asU8(): Uint8Array; getUser_asB64(): string; setUser(value: Uint8Array | string): CreateUserRequest; - getPassword(): Uint8Array | string; getPassword_asU8(): Uint8Array; getPassword_asB64(): string; setPassword(value: Uint8Array | string): CreateUserRequest; - getPermission(): number; setPermission(value: number): CreateUserRequest; - getDatabase(): string; setDatabase(value: string): CreateUserRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): CreateUserRequest.AsObject; static toObject(includeInstance: boolean, msg: CreateUserRequest): CreateUserRequest.AsObject; @@ -162,7 +150,6 @@ export class UserRequest extends jspb.Message { getUser_asB64(): string; setUser(value: Uint8Array | string): UserRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): UserRequest.AsObject; static toObject(includeInstance: boolean, msg: UserRequest): UserRequest.AsObject; @@ -184,18 +171,15 @@ export class ChangePasswordRequest extends jspb.Message { getUser_asU8(): Uint8Array; getUser_asB64(): string; setUser(value: Uint8Array | string): ChangePasswordRequest; - getOldpassword(): Uint8Array | string; getOldpassword_asU8(): Uint8Array; getOldpassword_asB64(): string; setOldpassword(value: Uint8Array | string): ChangePasswordRequest; - getNewpassword(): Uint8Array | string; getNewpassword_asU8(): Uint8Array; getNewpassword_asB64(): string; setNewpassword(value: Uint8Array | string): ChangePasswordRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): ChangePasswordRequest.AsObject; static toObject(includeInstance: boolean, msg: ChangePasswordRequest): ChangePasswordRequest.AsObject; @@ -219,13 +203,11 @@ export class LoginRequest extends jspb.Message { getUser_asU8(): Uint8Array; getUser_asB64(): string; setUser(value: Uint8Array | string): LoginRequest; - getPassword(): Uint8Array | string; getPassword_asU8(): Uint8Array; getPassword_asB64(): string; setPassword(value: Uint8Array | string): LoginRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): LoginRequest.AsObject; static toObject(includeInstance: boolean, msg: LoginRequest): LoginRequest.AsObject; @@ -246,13 +228,11 @@ export namespace LoginRequest { export class LoginResponse extends jspb.Message { getToken(): string; setToken(value: string): LoginResponse; - getWarning(): Uint8Array | string; getWarning_asU8(): Uint8Array; getWarning_asB64(): string; setWarning(value: Uint8Array | string): LoginResponse; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): LoginResponse.AsObject; static toObject(includeInstance: boolean, msg: LoginResponse): LoginResponse.AsObject; @@ -274,7 +254,6 @@ export class AuthConfig extends jspb.Message { getKind(): number; setKind(value: number): AuthConfig; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): AuthConfig.AsObject; static toObject(includeInstance: boolean, msg: AuthConfig): AuthConfig.AsObject; @@ -295,7 +274,6 @@ export class MTLSConfig extends jspb.Message { getEnabled(): boolean; setEnabled(value: boolean): MTLSConfig; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): MTLSConfig.AsObject; static toObject(includeInstance: boolean, msg: MTLSConfig): MTLSConfig.AsObject; @@ -317,13 +295,11 @@ export class KeyValue extends jspb.Message { getKey_asU8(): Uint8Array; getKey_asB64(): string; setKey(value: Uint8Array | string): KeyValue; - getValue(): Uint8Array | string; getValue_asU8(): Uint8Array; getValue_asB64(): string; setValue(value: Uint8Array | string): KeyValue; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): KeyValue.AsObject; static toObject(includeInstance: boolean, msg: KeyValue): KeyValue.AsObject; @@ -344,24 +320,20 @@ export namespace KeyValue { export class Entry extends jspb.Message { getTx(): number; setTx(value: number): Entry; - getKey(): Uint8Array | string; getKey_asU8(): Uint8Array; getKey_asB64(): string; setKey(value: Uint8Array | string): Entry; - getValue(): Uint8Array | string; getValue_asU8(): Uint8Array; getValue_asB64(): string; setValue(value: Uint8Array | string): Entry; - hasReferencedby(): boolean; clearReferencedby(): void; getReferencedby(): Reference | undefined; setReferencedby(value?: Reference): Entry; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Entry.AsObject; static toObject(includeInstance: boolean, msg: Entry): Entry.AsObject; @@ -384,16 +356,13 @@ export namespace Entry { export class Reference extends jspb.Message { getTx(): number; setTx(value: number): Reference; - getKey(): Uint8Array | string; getKey_asU8(): Uint8Array; getKey_asB64(): string; setKey(value: Uint8Array | string): Reference; - getAttx(): number; setAttx(value: number): Reference; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Reference.AsObject; static toObject(includeInstance: boolean, msg: Reference): Reference.AsObject; @@ -419,19 +388,16 @@ export class Op extends jspb.Message { getKv(): KeyValue | undefined; setKv(value?: KeyValue): Op; - hasZadd(): boolean; clearZadd(): void; getZadd(): ZAddRequest | undefined; setZadd(value?: ZAddRequest): Op; - hasRef(): boolean; clearRef(): void; getRef(): ReferenceRequest | undefined; setRef(value?: ReferenceRequest): Op; - getOperationCase(): Op.OperationCase; serializeBinary(): Uint8Array; @@ -453,13 +419,9 @@ export namespace Op { export enum OperationCase { OPERATION_NOT_SET = 0, - - KV = 1, - - ZADD = 2, - - REF = 3, - + KV = 1, + ZADD = 2, + REF = 3, } } @@ -469,7 +431,8 @@ export class ExecAllRequest extends jspb.Message { getOperationsList(): Array; setOperationsList(value: Array): ExecAllRequest; addOperations(value?: Op, index?: number): Op; - + getNowait(): boolean; + setNowait(value: boolean): ExecAllRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): ExecAllRequest.AsObject; @@ -484,6 +447,7 @@ export class ExecAllRequest extends jspb.Message { export namespace ExecAllRequest { export type AsObject = { operationsList: Array, + nowait: boolean, } } @@ -493,7 +457,6 @@ export class Entries extends jspb.Message { setEntriesList(value: Array): Entries; addEntries(value?: Entry, index?: number): Entry; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Entries.AsObject; static toObject(includeInstance: boolean, msg: Entries): Entries.AsObject; @@ -515,25 +478,20 @@ export class ZEntry extends jspb.Message { getSet_asU8(): Uint8Array; getSet_asB64(): string; setSet(value: Uint8Array | string): ZEntry; - getKey(): Uint8Array | string; getKey_asU8(): Uint8Array; getKey_asB64(): string; setKey(value: Uint8Array | string): ZEntry; - hasEntry(): boolean; clearEntry(): void; getEntry(): Entry | undefined; setEntry(value?: Entry): ZEntry; - getScore(): number; setScore(value: number): ZEntry; - getAttx(): number; setAttx(value: number): ZEntry; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): ZEntry.AsObject; static toObject(includeInstance: boolean, msg: ZEntry): ZEntry.AsObject; @@ -560,7 +518,6 @@ export class ZEntries extends jspb.Message { setEntriesList(value: Array): ZEntries; addEntries(value?: ZEntry, index?: number): ZEntry; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): ZEntries.AsObject; static toObject(includeInstance: boolean, msg: ZEntries): ZEntries.AsObject; @@ -582,25 +539,19 @@ export class ScanRequest extends jspb.Message { getSeekkey_asU8(): Uint8Array; getSeekkey_asB64(): string; setSeekkey(value: Uint8Array | string): ScanRequest; - getPrefix(): Uint8Array | string; getPrefix_asU8(): Uint8Array; getPrefix_asB64(): string; setPrefix(value: Uint8Array | string): ScanRequest; - getDesc(): boolean; setDesc(value: boolean): ScanRequest; - getLimit(): number; setLimit(value: number): ScanRequest; - getSincetx(): number; setSincetx(value: number): ScanRequest; - getNowait(): boolean; setNowait(value: boolean): ScanRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): ScanRequest.AsObject; static toObject(includeInstance: boolean, msg: ScanRequest): ScanRequest.AsObject; @@ -628,7 +579,6 @@ export class KeyPrefix extends jspb.Message { getPrefix_asB64(): string; setPrefix(value: Uint8Array | string): KeyPrefix; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): KeyPrefix.AsObject; static toObject(includeInstance: boolean, msg: KeyPrefix): KeyPrefix.AsObject; @@ -649,7 +599,6 @@ export class EntryCount extends jspb.Message { getCount(): number; setCount(value: number): EntryCount; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): EntryCount.AsObject; static toObject(includeInstance: boolean, msg: EntryCount): EntryCount.AsObject; @@ -671,13 +620,11 @@ export class Signature extends jspb.Message { getPublickey_asU8(): Uint8Array; getPublickey_asB64(): string; setPublickey(value: Uint8Array | string): Signature; - getSignature(): Uint8Array | string; getSignature_asU8(): Uint8Array; getSignature_asB64(): string; setSignature(value: Uint8Array | string): Signature; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Signature.AsObject; static toObject(includeInstance: boolean, msg: Signature): Signature.AsObject; @@ -698,32 +645,25 @@ export namespace Signature { export class TxMetadata extends jspb.Message { getId(): number; setId(value: number): TxMetadata; - getPrevalh(): Uint8Array | string; getPrevalh_asU8(): Uint8Array; getPrevalh_asB64(): string; setPrevalh(value: Uint8Array | string): TxMetadata; - getTs(): number; setTs(value: number): TxMetadata; - getNentries(): number; setNentries(value: number): TxMetadata; - getEh(): Uint8Array | string; getEh_asU8(): Uint8Array; getEh_asB64(): string; setEh(value: Uint8Array | string): TxMetadata; - getBltxid(): number; setBltxid(value: number): TxMetadata; - getBlroot(): Uint8Array | string; getBlroot_asU8(): Uint8Array; getBlroot_asB64(): string; setBlroot(value: Uint8Array | string): TxMetadata; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): TxMetadata.AsObject; static toObject(includeInstance: boolean, msg: TxMetadata): TxMetadata.AsObject; @@ -749,10 +689,8 @@ export namespace TxMetadata { export class LinearProof extends jspb.Message { getSourcetxid(): number; setSourcetxid(value: number): LinearProof; - getTargettxid(): number; setTargettxid(value: number): LinearProof; - clearTermsList(): void; getTermsList(): Array; getTermsList_asU8(): Array; @@ -760,7 +698,6 @@ export class LinearProof extends jspb.Message { setTermsList(value: Array): LinearProof; addTerms(value: Uint8Array | string, index?: number): Uint8Array | string; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): LinearProof.AsObject; static toObject(includeInstance: boolean, msg: LinearProof): LinearProof.AsObject; @@ -786,31 +723,26 @@ export class DualProof extends jspb.Message { getSourcetxmetadata(): TxMetadata | undefined; setSourcetxmetadata(value?: TxMetadata): DualProof; - hasTargettxmetadata(): boolean; clearTargettxmetadata(): void; getTargettxmetadata(): TxMetadata | undefined; setTargettxmetadata(value?: TxMetadata): DualProof; - clearInclusionproofList(): void; getInclusionproofList(): Array; getInclusionproofList_asU8(): Array; getInclusionproofList_asB64(): Array; setInclusionproofList(value: Array): DualProof; addInclusionproof(value: Uint8Array | string, index?: number): Uint8Array | string; - clearConsistencyproofList(): void; getConsistencyproofList(): Array; getConsistencyproofList_asU8(): Array; getConsistencyproofList_asB64(): Array; setConsistencyproofList(value: Array): DualProof; addConsistencyproof(value: Uint8Array | string, index?: number): Uint8Array | string; - getTargetbltxalh(): Uint8Array | string; getTargetbltxalh_asU8(): Uint8Array; getTargetbltxalh_asB64(): string; setTargetbltxalh(value: Uint8Array | string): DualProof; - clearLastinclusionproofList(): void; getLastinclusionproofList(): Array; getLastinclusionproofList_asU8(): Array; @@ -818,13 +750,11 @@ export class DualProof extends jspb.Message { setLastinclusionproofList(value: Array): DualProof; addLastinclusionproof(value: Uint8Array | string, index?: number): Uint8Array | string; - hasLinearproof(): boolean; clearLinearproof(): void; getLinearproof(): LinearProof | undefined; setLinearproof(value?: LinearProof): DualProof; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): DualProof.AsObject; static toObject(includeInstance: boolean, msg: DualProof): DualProof.AsObject; @@ -853,13 +783,11 @@ export class Tx extends jspb.Message { clearMetadata(): void; getMetadata(): TxMetadata | undefined; setMetadata(value?: TxMetadata): Tx; - clearEntriesList(): void; getEntriesList(): Array; setEntriesList(value: Array): Tx; addEntries(value?: TxEntry, index?: number): TxEntry; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Tx.AsObject; static toObject(includeInstance: boolean, msg: Tx): Tx.AsObject; @@ -882,19 +810,15 @@ export class TxEntry extends jspb.Message { getKey_asU8(): Uint8Array; getKey_asB64(): string; setKey(value: Uint8Array | string): TxEntry; - getHvalue(): Uint8Array | string; getHvalue_asU8(): Uint8Array; getHvalue_asB64(): string; setHvalue(value: Uint8Array | string): TxEntry; - getVoff(): number; setVoff(value: number): TxEntry; - getVlen(): number; setVlen(value: number): TxEntry; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): TxEntry.AsObject; static toObject(includeInstance: boolean, msg: TxEntry): TxEntry.AsObject; @@ -921,19 +845,16 @@ export class VerifiableTx extends jspb.Message { getTx(): Tx | undefined; setTx(value?: Tx): VerifiableTx; - hasDualproof(): boolean; clearDualproof(): void; getDualproof(): DualProof | undefined; setDualproof(value?: DualProof): VerifiableTx; - hasSignature(): boolean; clearSignature(): void; getSignature(): Signature | undefined; setSignature(value?: Signature): VerifiableTx; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): VerifiableTx.AsObject; static toObject(includeInstance: boolean, msg: VerifiableTx): VerifiableTx.AsObject; @@ -959,19 +880,16 @@ export class VerifiableEntry extends jspb.Message { getEntry(): Entry | undefined; setEntry(value?: Entry): VerifiableEntry; - hasVerifiabletx(): boolean; clearVerifiabletx(): void; getVerifiabletx(): VerifiableTx | undefined; setVerifiabletx(value?: VerifiableTx): VerifiableEntry; - hasInclusionproof(): boolean; clearInclusionproof(): void; getInclusionproof(): InclusionProof | undefined; setInclusionproof(value?: InclusionProof): VerifiableEntry; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): VerifiableEntry.AsObject; static toObject(includeInstance: boolean, msg: VerifiableEntry): VerifiableEntry.AsObject; @@ -993,10 +911,8 @@ export namespace VerifiableEntry { export class InclusionProof extends jspb.Message { getLeaf(): number; setLeaf(value: number): InclusionProof; - getWidth(): number; setWidth(value: number): InclusionProof; - clearTermsList(): void; getTermsList(): Array; getTermsList_asU8(): Array; @@ -1004,7 +920,6 @@ export class InclusionProof extends jspb.Message { setTermsList(value: Array): InclusionProof; addTerms(value: Uint8Array | string, index?: number): Uint8Array | string; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): InclusionProof.AsObject; static toObject(includeInstance: boolean, msg: InclusionProof): InclusionProof.AsObject; @@ -1028,7 +943,8 @@ export class SetRequest extends jspb.Message { getKvsList(): Array; setKvsList(value: Array): SetRequest; addKvs(value?: KeyValue, index?: number): KeyValue; - + getNowait(): boolean; + setNowait(value: boolean): SetRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): SetRequest.AsObject; @@ -1043,6 +959,7 @@ export class SetRequest extends jspb.Message { export namespace SetRequest { export type AsObject = { kvsList: Array, + nowait: boolean, } } @@ -1051,14 +968,11 @@ export class KeyRequest extends jspb.Message { getKey_asU8(): Uint8Array; getKey_asB64(): string; setKey(value: Uint8Array | string): KeyRequest; - getAttx(): number; setAttx(value: number): KeyRequest; - getSincetx(): number; setSincetx(value: number): KeyRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): KeyRequest.AsObject; static toObject(includeInstance: boolean, msg: KeyRequest): KeyRequest.AsObject; @@ -1084,11 +998,9 @@ export class KeyListRequest extends jspb.Message { getKeysList_asB64(): Array; setKeysList(value: Array): KeyListRequest; addKeys(value: Uint8Array | string, index?: number): Uint8Array | string; - getSincetx(): number; setSincetx(value: number): KeyListRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): KeyListRequest.AsObject; static toObject(includeInstance: boolean, msg: KeyListRequest): KeyListRequest.AsObject; @@ -1112,11 +1024,9 @@ export class VerifiableSetRequest extends jspb.Message { clearSetrequest(): void; getSetrequest(): SetRequest | undefined; setSetrequest(value?: SetRequest): VerifiableSetRequest; - getProvesincetx(): number; setProvesincetx(value: number): VerifiableSetRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): VerifiableSetRequest.AsObject; static toObject(includeInstance: boolean, msg: VerifiableSetRequest): VerifiableSetRequest.AsObject; @@ -1140,11 +1050,9 @@ export class VerifiableGetRequest extends jspb.Message { clearKeyrequest(): void; getKeyrequest(): KeyRequest | undefined; setKeyrequest(value?: KeyRequest): VerifiableGetRequest; - getProvesincetx(): number; setProvesincetx(value: number): VerifiableGetRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): VerifiableGetRequest.AsObject; static toObject(includeInstance: boolean, msg: VerifiableGetRequest): VerifiableGetRequest.AsObject; @@ -1165,11 +1073,9 @@ export namespace VerifiableGetRequest { export class HealthResponse extends jspb.Message { getStatus(): boolean; setStatus(value: boolean): HealthResponse; - getVersion(): string; setVersion(value: string): HealthResponse; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): HealthResponse.AsObject; static toObject(includeInstance: boolean, msg: HealthResponse): HealthResponse.AsObject; @@ -1190,22 +1096,18 @@ export namespace HealthResponse { export class ImmutableState extends jspb.Message { getDb(): string; setDb(value: string): ImmutableState; - getTxid(): number; setTxid(value: number): ImmutableState; - getTxhash(): Uint8Array | string; getTxhash_asU8(): Uint8Array; getTxhash_asB64(): string; setTxhash(value: Uint8Array | string): ImmutableState; - hasSignature(): boolean; clearSignature(): void; getSignature(): Signature | undefined; setSignature(value?: Signature): ImmutableState; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): ImmutableState.AsObject; static toObject(includeInstance: boolean, msg: ImmutableState): ImmutableState.AsObject; @@ -1230,18 +1132,16 @@ export class ReferenceRequest extends jspb.Message { getKey_asU8(): Uint8Array; getKey_asB64(): string; setKey(value: Uint8Array | string): ReferenceRequest; - getReferencedkey(): Uint8Array | string; getReferencedkey_asU8(): Uint8Array; getReferencedkey_asB64(): string; setReferencedkey(value: Uint8Array | string): ReferenceRequest; - getAttx(): number; setAttx(value: number): ReferenceRequest; - getBoundref(): boolean; setBoundref(value: boolean): ReferenceRequest; - + getNowait(): boolean; + setNowait(value: boolean): ReferenceRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): ReferenceRequest.AsObject; @@ -1259,6 +1159,7 @@ export namespace ReferenceRequest { referencedkey: Uint8Array | string, attx: number, boundref: boolean, + nowait: boolean, } } @@ -1268,11 +1169,9 @@ export class VerifiableReferenceRequest extends jspb.Message { clearReferencerequest(): void; getReferencerequest(): ReferenceRequest | undefined; setReferencerequest(value?: ReferenceRequest): VerifiableReferenceRequest; - getProvesincetx(): number; setProvesincetx(value: number): VerifiableReferenceRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): VerifiableReferenceRequest.AsObject; static toObject(includeInstance: boolean, msg: VerifiableReferenceRequest): VerifiableReferenceRequest.AsObject; @@ -1295,21 +1194,18 @@ export class ZAddRequest extends jspb.Message { getSet_asU8(): Uint8Array; getSet_asB64(): string; setSet(value: Uint8Array | string): ZAddRequest; - getScore(): number; setScore(value: number): ZAddRequest; - getKey(): Uint8Array | string; getKey_asU8(): Uint8Array; getKey_asB64(): string; setKey(value: Uint8Array | string): ZAddRequest; - getAttx(): number; setAttx(value: number): ZAddRequest; - getBoundref(): boolean; setBoundref(value: boolean): ZAddRequest; - + getNowait(): boolean; + setNowait(value: boolean): ZAddRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): ZAddRequest.AsObject; @@ -1328,6 +1224,7 @@ export namespace ZAddRequest { key: Uint8Array | string, attx: number, boundref: boolean, + nowait: boolean, } } @@ -1335,7 +1232,6 @@ export class Score extends jspb.Message { getScore(): number; setScore(value: number): Score; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Score.AsObject; static toObject(includeInstance: boolean, msg: Score): Score.AsObject; @@ -1357,46 +1253,35 @@ export class ZScanRequest extends jspb.Message { getSet_asU8(): Uint8Array; getSet_asB64(): string; setSet(value: Uint8Array | string): ZScanRequest; - getSeekkey(): Uint8Array | string; getSeekkey_asU8(): Uint8Array; getSeekkey_asB64(): string; setSeekkey(value: Uint8Array | string): ZScanRequest; - getSeekscore(): number; setSeekscore(value: number): ZScanRequest; - getSeekattx(): number; setSeekattx(value: number): ZScanRequest; - getInclusiveseek(): boolean; setInclusiveseek(value: boolean): ZScanRequest; - getLimit(): number; setLimit(value: number): ZScanRequest; - getDesc(): boolean; setDesc(value: boolean): ZScanRequest; - hasMinscore(): boolean; clearMinscore(): void; getMinscore(): Score | undefined; setMinscore(value?: Score): ZScanRequest; - hasMaxscore(): boolean; clearMaxscore(): void; getMaxscore(): Score | undefined; setMaxscore(value?: Score): ZScanRequest; - getSincetx(): number; setSincetx(value: number): ZScanRequest; - getNowait(): boolean; setNowait(value: boolean): ZScanRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): ZScanRequest.AsObject; static toObject(includeInstance: boolean, msg: ZScanRequest): ZScanRequest.AsObject; @@ -1428,20 +1313,15 @@ export class HistoryRequest extends jspb.Message { getKey_asU8(): Uint8Array; getKey_asB64(): string; setKey(value: Uint8Array | string): HistoryRequest; - getOffset(): number; setOffset(value: number): HistoryRequest; - getLimit(): number; setLimit(value: number): HistoryRequest; - getDesc(): boolean; setDesc(value: boolean): HistoryRequest; - getSincetx(): number; setSincetx(value: number): HistoryRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): HistoryRequest.AsObject; static toObject(includeInstance: boolean, msg: HistoryRequest): HistoryRequest.AsObject; @@ -1468,11 +1348,9 @@ export class VerifiableZAddRequest extends jspb.Message { clearZaddrequest(): void; getZaddrequest(): ZAddRequest | undefined; setZaddrequest(value?: ZAddRequest): VerifiableZAddRequest; - getProvesincetx(): number; setProvesincetx(value: number): VerifiableZAddRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): VerifiableZAddRequest.AsObject; static toObject(includeInstance: boolean, msg: VerifiableZAddRequest): VerifiableZAddRequest.AsObject; @@ -1494,7 +1372,6 @@ export class TxRequest extends jspb.Message { getTx(): number; setTx(value: number): TxRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): TxRequest.AsObject; static toObject(includeInstance: boolean, msg: TxRequest): TxRequest.AsObject; @@ -1514,11 +1391,9 @@ export namespace TxRequest { export class VerifiableTxRequest extends jspb.Message { getTx(): number; setTx(value: number): VerifiableTxRequest; - getProvesincetx(): number; setProvesincetx(value: number): VerifiableTxRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): VerifiableTxRequest.AsObject; static toObject(includeInstance: boolean, msg: VerifiableTxRequest): VerifiableTxRequest.AsObject; @@ -1539,14 +1414,11 @@ export namespace VerifiableTxRequest { export class TxScanRequest extends jspb.Message { getInitialtx(): number; setInitialtx(value: number): TxScanRequest; - getLimit(): number; setLimit(value: number): TxScanRequest; - getDesc(): boolean; setDesc(value: boolean): TxScanRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): TxScanRequest.AsObject; static toObject(includeInstance: boolean, msg: TxScanRequest): TxScanRequest.AsObject; @@ -1571,7 +1443,6 @@ export class TxList extends jspb.Message { setTxsList(value: Array): TxList; addTxs(value?: Tx, index?: number): Tx; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): TxList.AsObject; static toObject(includeInstance: boolean, msg: TxList): TxList.AsObject; @@ -1592,7 +1463,6 @@ export class Database extends jspb.Message { getDatabasename(): string; setDatabasename(value: string): Database; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Database.AsObject; static toObject(includeInstance: boolean, msg: Database): Database.AsObject; @@ -1609,11 +1479,177 @@ export namespace Database { } } +export class Table extends jspb.Message { + getTablename(): string; + setTablename(value: string): Table; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Table.AsObject; + static toObject(includeInstance: boolean, msg: Table): Table.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Table, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Table; + static deserializeBinaryFromReader(message: Table, reader: jspb.BinaryReader): Table; +} + +export namespace Table { + export type AsObject = { + tablename: string, + } +} + +export class SQLGetRequest extends jspb.Message { + getTable(): string; + setTable(value: string): SQLGetRequest; + + hasPkvalue(): boolean; + clearPkvalue(): void; + getPkvalue(): SQLValue | undefined; + setPkvalue(value?: SQLValue): SQLGetRequest; + getAttx(): number; + setAttx(value: number): SQLGetRequest; + getSincetx(): number; + setSincetx(value: number): SQLGetRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SQLGetRequest.AsObject; + static toObject(includeInstance: boolean, msg: SQLGetRequest): SQLGetRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SQLGetRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SQLGetRequest; + static deserializeBinaryFromReader(message: SQLGetRequest, reader: jspb.BinaryReader): SQLGetRequest; +} + +export namespace SQLGetRequest { + export type AsObject = { + table: string, + pkvalue?: SQLValue.AsObject, + attx: number, + sincetx: number, + } +} + +export class VerifiableSQLGetRequest extends jspb.Message { + + hasSqlgetrequest(): boolean; + clearSqlgetrequest(): void; + getSqlgetrequest(): SQLGetRequest | undefined; + setSqlgetrequest(value?: SQLGetRequest): VerifiableSQLGetRequest; + getProvesincetx(): number; + setProvesincetx(value: number): VerifiableSQLGetRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): VerifiableSQLGetRequest.AsObject; + static toObject(includeInstance: boolean, msg: VerifiableSQLGetRequest): VerifiableSQLGetRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: VerifiableSQLGetRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): VerifiableSQLGetRequest; + static deserializeBinaryFromReader(message: VerifiableSQLGetRequest, reader: jspb.BinaryReader): VerifiableSQLGetRequest; +} + +export namespace VerifiableSQLGetRequest { + export type AsObject = { + sqlgetrequest?: SQLGetRequest.AsObject, + provesincetx: number, + } +} + +export class SQLEntry extends jspb.Message { + getTx(): number; + setTx(value: number): SQLEntry; + getKey(): Uint8Array | string; + getKey_asU8(): Uint8Array; + getKey_asB64(): string; + setKey(value: Uint8Array | string): SQLEntry; + getValue(): Uint8Array | string; + getValue_asU8(): Uint8Array; + getValue_asB64(): string; + setValue(value: Uint8Array | string): SQLEntry; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SQLEntry.AsObject; + static toObject(includeInstance: boolean, msg: SQLEntry): SQLEntry.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SQLEntry, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SQLEntry; + static deserializeBinaryFromReader(message: SQLEntry, reader: jspb.BinaryReader): SQLEntry; +} + +export namespace SQLEntry { + export type AsObject = { + tx: number, + key: Uint8Array | string, + value: Uint8Array | string, + } +} + +export class VerifiableSQLEntry extends jspb.Message { + + hasSqlentry(): boolean; + clearSqlentry(): void; + getSqlentry(): SQLEntry | undefined; + setSqlentry(value?: SQLEntry): VerifiableSQLEntry; + + hasVerifiabletx(): boolean; + clearVerifiabletx(): void; + getVerifiabletx(): VerifiableTx | undefined; + setVerifiabletx(value?: VerifiableTx): VerifiableSQLEntry; + + hasInclusionproof(): boolean; + clearInclusionproof(): void; + getInclusionproof(): InclusionProof | undefined; + setInclusionproof(value?: InclusionProof): VerifiableSQLEntry; + getDatabaseid(): number; + setDatabaseid(value: number): VerifiableSQLEntry; + getTableid(): number; + setTableid(value: number): VerifiableSQLEntry; + getPkname(): string; + setPkname(value: string): VerifiableSQLEntry; + + getColidsbyidMap(): jspb.Map; + clearColidsbyidMap(): void; + + getColidsbynameMap(): jspb.Map; + clearColidsbynameMap(): void; + + getColtypesbyidMap(): jspb.Map; + clearColtypesbyidMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): VerifiableSQLEntry.AsObject; + static toObject(includeInstance: boolean, msg: VerifiableSQLEntry): VerifiableSQLEntry.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: VerifiableSQLEntry, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): VerifiableSQLEntry; + static deserializeBinaryFromReader(message: VerifiableSQLEntry, reader: jspb.BinaryReader): VerifiableSQLEntry; +} + +export namespace VerifiableSQLEntry { + export type AsObject = { + sqlentry?: SQLEntry.AsObject, + verifiabletx?: VerifiableTx.AsObject, + inclusionproof?: InclusionProof.AsObject, + databaseid: number, + tableid: number, + pkname: string, + + colidsbyidMap: Array<[number, string]>, + + colidsbynameMap: Array<[string, number]>, + + coltypesbyidMap: Array<[number, string]>, + } +} + export class UseDatabaseReply extends jspb.Message { getToken(): string; setToken(value: string): UseDatabaseReply; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): UseDatabaseReply.AsObject; static toObject(includeInstance: boolean, msg: UseDatabaseReply): UseDatabaseReply.AsObject; @@ -1633,17 +1669,13 @@ export namespace UseDatabaseReply { export class ChangePermissionRequest extends jspb.Message { getAction(): PermissionAction; setAction(value: PermissionAction): ChangePermissionRequest; - getUsername(): string; setUsername(value: string): ChangePermissionRequest; - getDatabase(): string; setDatabase(value: string): ChangePermissionRequest; - getPermission(): number; setPermission(value: number): ChangePermissionRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): ChangePermissionRequest.AsObject; static toObject(includeInstance: boolean, msg: ChangePermissionRequest): ChangePermissionRequest.AsObject; @@ -1666,11 +1698,9 @@ export namespace ChangePermissionRequest { export class SetActiveUserRequest extends jspb.Message { getActive(): boolean; setActive(value: boolean): SetActiveUserRequest; - getUsername(): string; setUsername(value: string): SetActiveUserRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): SetActiveUserRequest.AsObject; static toObject(includeInstance: boolean, msg: SetActiveUserRequest): SetActiveUserRequest.AsObject; @@ -1694,7 +1724,6 @@ export class DatabaseListResponse extends jspb.Message { setDatabasesList(value: Array): DatabaseListResponse; addDatabases(value?: Database, index?: number): Database; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): DatabaseListResponse.AsObject; static toObject(includeInstance: boolean, msg: DatabaseListResponse): DatabaseListResponse.AsObject; @@ -1711,6 +1740,298 @@ export namespace DatabaseListResponse { } } +export class Chunk extends jspb.Message { + getContent(): Uint8Array | string; + getContent_asU8(): Uint8Array; + getContent_asB64(): string; + setContent(value: Uint8Array | string): Chunk; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Chunk.AsObject; + static toObject(includeInstance: boolean, msg: Chunk): Chunk.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Chunk, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Chunk; + static deserializeBinaryFromReader(message: Chunk, reader: jspb.BinaryReader): Chunk; +} + +export namespace Chunk { + export type AsObject = { + content: Uint8Array | string, + } +} + +export class UseSnapshotRequest extends jspb.Message { + getSincetx(): number; + setSincetx(value: number): UseSnapshotRequest; + getAsbeforetx(): number; + setAsbeforetx(value: number): UseSnapshotRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): UseSnapshotRequest.AsObject; + static toObject(includeInstance: boolean, msg: UseSnapshotRequest): UseSnapshotRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: UseSnapshotRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): UseSnapshotRequest; + static deserializeBinaryFromReader(message: UseSnapshotRequest, reader: jspb.BinaryReader): UseSnapshotRequest; +} + +export namespace UseSnapshotRequest { + export type AsObject = { + sincetx: number, + asbeforetx: number, + } +} + +export class SQLExecRequest extends jspb.Message { + getSql(): string; + setSql(value: string): SQLExecRequest; + clearParamsList(): void; + getParamsList(): Array; + setParamsList(value: Array): SQLExecRequest; + addParams(value?: NamedParam, index?: number): NamedParam; + getNowait(): boolean; + setNowait(value: boolean): SQLExecRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SQLExecRequest.AsObject; + static toObject(includeInstance: boolean, msg: SQLExecRequest): SQLExecRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SQLExecRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SQLExecRequest; + static deserializeBinaryFromReader(message: SQLExecRequest, reader: jspb.BinaryReader): SQLExecRequest; +} + +export namespace SQLExecRequest { + export type AsObject = { + sql: string, + paramsList: Array, + nowait: boolean, + } +} + +export class SQLQueryRequest extends jspb.Message { + getSql(): string; + setSql(value: string): SQLQueryRequest; + clearParamsList(): void; + getParamsList(): Array; + setParamsList(value: Array): SQLQueryRequest; + addParams(value?: NamedParam, index?: number): NamedParam; + getReusesnapshot(): boolean; + setReusesnapshot(value: boolean): SQLQueryRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SQLQueryRequest.AsObject; + static toObject(includeInstance: boolean, msg: SQLQueryRequest): SQLQueryRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SQLQueryRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SQLQueryRequest; + static deserializeBinaryFromReader(message: SQLQueryRequest, reader: jspb.BinaryReader): SQLQueryRequest; +} + +export namespace SQLQueryRequest { + export type AsObject = { + sql: string, + paramsList: Array, + reusesnapshot: boolean, + } +} + +export class NamedParam extends jspb.Message { + getName(): string; + setName(value: string): NamedParam; + + hasValue(): boolean; + clearValue(): void; + getValue(): SQLValue | undefined; + setValue(value?: SQLValue): NamedParam; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): NamedParam.AsObject; + static toObject(includeInstance: boolean, msg: NamedParam): NamedParam.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: NamedParam, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): NamedParam; + static deserializeBinaryFromReader(message: NamedParam, reader: jspb.BinaryReader): NamedParam; +} + +export namespace NamedParam { + export type AsObject = { + name: string, + value?: SQLValue.AsObject, + } +} + +export class SQLExecResult extends jspb.Message { + clearCtxsList(): void; + getCtxsList(): Array; + setCtxsList(value: Array): SQLExecResult; + addCtxs(value?: TxMetadata, index?: number): TxMetadata; + clearDtxsList(): void; + getDtxsList(): Array; + setDtxsList(value: Array): SQLExecResult; + addDtxs(value?: TxMetadata, index?: number): TxMetadata; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SQLExecResult.AsObject; + static toObject(includeInstance: boolean, msg: SQLExecResult): SQLExecResult.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SQLExecResult, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SQLExecResult; + static deserializeBinaryFromReader(message: SQLExecResult, reader: jspb.BinaryReader): SQLExecResult; +} + +export namespace SQLExecResult { + export type AsObject = { + ctxsList: Array, + dtxsList: Array, + } +} + +export class SQLQueryResult extends jspb.Message { + clearColumnsList(): void; + getColumnsList(): Array; + setColumnsList(value: Array): SQLQueryResult; + addColumns(value?: Column, index?: number): Column; + clearRowsList(): void; + getRowsList(): Array; + setRowsList(value: Array): SQLQueryResult; + addRows(value?: Row, index?: number): Row; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SQLQueryResult.AsObject; + static toObject(includeInstance: boolean, msg: SQLQueryResult): SQLQueryResult.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SQLQueryResult, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SQLQueryResult; + static deserializeBinaryFromReader(message: SQLQueryResult, reader: jspb.BinaryReader): SQLQueryResult; +} + +export namespace SQLQueryResult { + export type AsObject = { + columnsList: Array, + rowsList: Array, + } +} + +export class Column extends jspb.Message { + getName(): string; + setName(value: string): Column; + getType(): string; + setType(value: string): Column; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Column.AsObject; + static toObject(includeInstance: boolean, msg: Column): Column.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Column, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Column; + static deserializeBinaryFromReader(message: Column, reader: jspb.BinaryReader): Column; +} + +export namespace Column { + export type AsObject = { + name: string, + type: string, + } +} + +export class Row extends jspb.Message { + clearColumnsList(): void; + getColumnsList(): Array; + setColumnsList(value: Array): Row; + addColumns(value: string, index?: number): string; + clearValuesList(): void; + getValuesList(): Array; + setValuesList(value: Array): Row; + addValues(value?: SQLValue, index?: number): SQLValue; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Row.AsObject; + static toObject(includeInstance: boolean, msg: Row): Row.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Row, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Row; + static deserializeBinaryFromReader(message: Row, reader: jspb.BinaryReader): Row; +} + +export namespace Row { + export type AsObject = { + columnsList: Array, + valuesList: Array, + } +} + +export class SQLValue extends jspb.Message { + + hasNull(): boolean; + clearNull(): void; + getNull(): google_protobuf_struct_pb.NullValue; + setNull(value: google_protobuf_struct_pb.NullValue): SQLValue; + + hasN(): boolean; + clearN(): void; + getN(): number; + setN(value: number): SQLValue; + + hasS(): boolean; + clearS(): void; + getS(): string; + setS(value: string): SQLValue; + + hasB(): boolean; + clearB(): void; + getB(): boolean; + setB(value: boolean): SQLValue; + + hasBs(): boolean; + clearBs(): void; + getBs(): Uint8Array | string; + getBs_asU8(): Uint8Array; + getBs_asB64(): string; + setBs(value: Uint8Array | string): SQLValue; + + getValueCase(): SQLValue.ValueCase; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SQLValue.AsObject; + static toObject(includeInstance: boolean, msg: SQLValue): SQLValue.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SQLValue, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SQLValue; + static deserializeBinaryFromReader(message: SQLValue, reader: jspb.BinaryReader): SQLValue; +} + +export namespace SQLValue { + export type AsObject = { + pb_null: google_protobuf_struct_pb.NullValue, + n: number, + s: string, + b: boolean, + bs: Uint8Array | string, + } + + export enum ValueCase { + VALUE_NOT_SET = 0, + NULL = 1, + N = 2, + S = 3, + B = 4, + BS = 5, + } + +} + export enum PermissionAction { GRANT = 0, REVOKE = 1, diff --git a/src/proto/schema_pb.js b/src/proto/schema_pb.js index 0779fce..d19825a 100644 --- a/src/proto/schema_pb.js +++ b/src/proto/schema_pb.js @@ -16,9 +16,13 @@ var global = Function('return this')(); var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js'); goog.object.extend(proto, google_protobuf_empty_pb); +var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); +goog.object.extend(proto, google_protobuf_struct_pb); goog.exportSymbol('proto.immudb.schema.AuthConfig', null, global); goog.exportSymbol('proto.immudb.schema.ChangePasswordRequest', null, global); goog.exportSymbol('proto.immudb.schema.ChangePermissionRequest', null, global); +goog.exportSymbol('proto.immudb.schema.Chunk', null, global); +goog.exportSymbol('proto.immudb.schema.Column', null, global); goog.exportSymbol('proto.immudb.schema.CreateUserRequest', null, global); goog.exportSymbol('proto.immudb.schema.Database', null, global); goog.exportSymbol('proto.immudb.schema.DatabaseListResponse', null, global); @@ -40,17 +44,28 @@ goog.exportSymbol('proto.immudb.schema.LinearProof', null, global); goog.exportSymbol('proto.immudb.schema.LoginRequest', null, global); goog.exportSymbol('proto.immudb.schema.LoginResponse', null, global); goog.exportSymbol('proto.immudb.schema.MTLSConfig', null, global); +goog.exportSymbol('proto.immudb.schema.NamedParam', null, global); goog.exportSymbol('proto.immudb.schema.Op', null, global); goog.exportSymbol('proto.immudb.schema.Op.OperationCase', null, global); goog.exportSymbol('proto.immudb.schema.Permission', null, global); goog.exportSymbol('proto.immudb.schema.PermissionAction', null, global); goog.exportSymbol('proto.immudb.schema.Reference', null, global); goog.exportSymbol('proto.immudb.schema.ReferenceRequest', null, global); +goog.exportSymbol('proto.immudb.schema.Row', null, global); +goog.exportSymbol('proto.immudb.schema.SQLEntry', null, global); +goog.exportSymbol('proto.immudb.schema.SQLExecRequest', null, global); +goog.exportSymbol('proto.immudb.schema.SQLExecResult', null, global); +goog.exportSymbol('proto.immudb.schema.SQLGetRequest', null, global); +goog.exportSymbol('proto.immudb.schema.SQLQueryRequest', null, global); +goog.exportSymbol('proto.immudb.schema.SQLQueryResult', null, global); +goog.exportSymbol('proto.immudb.schema.SQLValue', null, global); +goog.exportSymbol('proto.immudb.schema.SQLValue.ValueCase', null, global); goog.exportSymbol('proto.immudb.schema.ScanRequest', null, global); goog.exportSymbol('proto.immudb.schema.Score', null, global); goog.exportSymbol('proto.immudb.schema.SetActiveUserRequest', null, global); goog.exportSymbol('proto.immudb.schema.SetRequest', null, global); goog.exportSymbol('proto.immudb.schema.Signature', null, global); +goog.exportSymbol('proto.immudb.schema.Table', null, global); goog.exportSymbol('proto.immudb.schema.Tx', null, global); goog.exportSymbol('proto.immudb.schema.TxEntry', null, global); goog.exportSymbol('proto.immudb.schema.TxList', null, global); @@ -58,12 +73,15 @@ goog.exportSymbol('proto.immudb.schema.TxMetadata', null, global); goog.exportSymbol('proto.immudb.schema.TxRequest', null, global); goog.exportSymbol('proto.immudb.schema.TxScanRequest', null, global); goog.exportSymbol('proto.immudb.schema.UseDatabaseReply', null, global); +goog.exportSymbol('proto.immudb.schema.UseSnapshotRequest', null, global); goog.exportSymbol('proto.immudb.schema.User', null, global); goog.exportSymbol('proto.immudb.schema.UserList', null, global); goog.exportSymbol('proto.immudb.schema.UserRequest', null, global); goog.exportSymbol('proto.immudb.schema.VerifiableEntry', null, global); goog.exportSymbol('proto.immudb.schema.VerifiableGetRequest', null, global); goog.exportSymbol('proto.immudb.schema.VerifiableReferenceRequest', null, global); +goog.exportSymbol('proto.immudb.schema.VerifiableSQLEntry', null, global); +goog.exportSymbol('proto.immudb.schema.VerifiableSQLGetRequest', null, global); goog.exportSymbol('proto.immudb.schema.VerifiableSetRequest', null, global); goog.exportSymbol('proto.immudb.schema.VerifiableTx', null, global); goog.exportSymbol('proto.immudb.schema.VerifiableTxRequest', null, global); @@ -1122,6 +1140,111 @@ if (goog.DEBUG && !COMPILED) { */ proto.immudb.schema.Database.displayName = 'proto.immudb.schema.Database'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.immudb.schema.Table = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.immudb.schema.Table, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.immudb.schema.Table.displayName = 'proto.immudb.schema.Table'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.immudb.schema.SQLGetRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.immudb.schema.SQLGetRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.immudb.schema.SQLGetRequest.displayName = 'proto.immudb.schema.SQLGetRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.immudb.schema.VerifiableSQLGetRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.immudb.schema.VerifiableSQLGetRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.immudb.schema.VerifiableSQLGetRequest.displayName = 'proto.immudb.schema.VerifiableSQLGetRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.immudb.schema.SQLEntry = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.immudb.schema.SQLEntry, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.immudb.schema.SQLEntry.displayName = 'proto.immudb.schema.SQLEntry'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.immudb.schema.VerifiableSQLEntry = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.immudb.schema.VerifiableSQLEntry, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.immudb.schema.VerifiableSQLEntry.displayName = 'proto.immudb.schema.VerifiableSQLEntry'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -1206,110 +1329,320 @@ if (goog.DEBUG && !COMPILED) { */ proto.immudb.schema.DatabaseListResponse.displayName = 'proto.immudb.schema.DatabaseListResponse'; } - - - -if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.immudb.schema.Key.prototype.toObject = function(opt_includeInstance) { - return proto.immudb.schema.Key.toObject(opt_includeInstance, this); +proto.immudb.schema.Chunk = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; - - +goog.inherits(proto.immudb.schema.Chunk, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.immudb.schema.Chunk.displayName = 'proto.immudb.schema.Chunk'; +} /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.immudb.schema.Key} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.immudb.schema.Key.toObject = function(includeInstance, msg) { - var f, obj = { - key: msg.getKey_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; +proto.immudb.schema.UseSnapshotRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; +goog.inherits(proto.immudb.schema.UseSnapshotRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.immudb.schema.UseSnapshotRequest.displayName = 'proto.immudb.schema.UseSnapshotRequest'; } - - /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.immudb.schema.Key} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.immudb.schema.Key.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.immudb.schema.Key; - return proto.immudb.schema.Key.deserializeBinaryFromReader(msg, reader); +proto.immudb.schema.SQLExecRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.immudb.schema.SQLExecRequest.repeatedFields_, null); }; - - +goog.inherits(proto.immudb.schema.SQLExecRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.immudb.schema.SQLExecRequest.displayName = 'proto.immudb.schema.SQLExecRequest'; +} /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.immudb.schema.Key} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.immudb.schema.Key} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.immudb.schema.Key.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setKey(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; +proto.immudb.schema.SQLQueryRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.immudb.schema.SQLQueryRequest.repeatedFields_, null); }; - - +goog.inherits(proto.immudb.schema.SQLQueryRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.immudb.schema.SQLQueryRequest.displayName = 'proto.immudb.schema.SQLQueryRequest'; +} /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.immudb.schema.Key.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.immudb.schema.Key.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.immudb.schema.NamedParam = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; - - +goog.inherits(proto.immudb.schema.NamedParam, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.immudb.schema.NamedParam.displayName = 'proto.immudb.schema.NamedParam'; +} /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.immudb.schema.Key} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.immudb.schema.Key.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getKey_asU8(); - if (f.length > 0) { +proto.immudb.schema.SQLExecResult = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.immudb.schema.SQLExecResult.repeatedFields_, null); +}; +goog.inherits(proto.immudb.schema.SQLExecResult, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.immudb.schema.SQLExecResult.displayName = 'proto.immudb.schema.SQLExecResult'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.immudb.schema.SQLQueryResult = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.immudb.schema.SQLQueryResult.repeatedFields_, null); +}; +goog.inherits(proto.immudb.schema.SQLQueryResult, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.immudb.schema.SQLQueryResult.displayName = 'proto.immudb.schema.SQLQueryResult'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.immudb.schema.Column = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.immudb.schema.Column, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.immudb.schema.Column.displayName = 'proto.immudb.schema.Column'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.immudb.schema.Row = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.immudb.schema.Row.repeatedFields_, null); +}; +goog.inherits(proto.immudb.schema.Row, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.immudb.schema.Row.displayName = 'proto.immudb.schema.Row'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.immudb.schema.SQLValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.immudb.schema.SQLValue.oneofGroups_); +}; +goog.inherits(proto.immudb.schema.SQLValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.immudb.schema.SQLValue.displayName = 'proto.immudb.schema.SQLValue'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.immudb.schema.Key.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.Key.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.immudb.schema.Key} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.Key.toObject = function(includeInstance, msg) { + var f, obj = { + key: msg.getKey_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.immudb.schema.Key} + */ +proto.immudb.schema.Key.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.immudb.schema.Key; + return proto.immudb.schema.Key.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.immudb.schema.Key} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.immudb.schema.Key} + */ +proto.immudb.schema.Key.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setKey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.immudb.schema.Key.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.immudb.schema.Key.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.immudb.schema.Key} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.Key.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKey_asU8(); + if (f.length > 0) { writer.writeBytes( 1, f @@ -4351,7 +4684,8 @@ proto.immudb.schema.ExecAllRequest.prototype.toObject = function(opt_includeInst proto.immudb.schema.ExecAllRequest.toObject = function(includeInstance, msg) { var f, obj = { operationsList: jspb.Message.toObjectList(msg.getOperationsList(), - proto.immudb.schema.Op.toObject, includeInstance) + proto.immudb.schema.Op.toObject, includeInstance), + nowait: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) }; if (includeInstance) { @@ -4393,6 +4727,10 @@ proto.immudb.schema.ExecAllRequest.deserializeBinaryFromReader = function(msg, r reader.readMessage(value,proto.immudb.schema.Op.deserializeBinaryFromReader); msg.addOperations(value); break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setNowait(value); + break; default: reader.skipField(); break; @@ -4430,6 +4768,13 @@ proto.immudb.schema.ExecAllRequest.serializeBinaryToWriter = function(message, w proto.immudb.schema.Op.serializeBinaryToWriter ); } + f = message.getNowait(); + if (f) { + writer.writeBool( + 2, + f + ); + } }; @@ -4471,6 +4816,24 @@ proto.immudb.schema.ExecAllRequest.prototype.clearOperationsList = function() { }; +/** + * optional bool noWait = 2; + * @return {boolean} + */ +proto.immudb.schema.ExecAllRequest.prototype.getNowait = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.immudb.schema.ExecAllRequest} returns this + */ +proto.immudb.schema.ExecAllRequest.prototype.setNowait = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + /** * List of repeated fields within this message type. @@ -8350,7 +8713,8 @@ proto.immudb.schema.SetRequest.prototype.toObject = function(opt_includeInstance proto.immudb.schema.SetRequest.toObject = function(includeInstance, msg) { var f, obj = { kvsList: jspb.Message.toObjectList(msg.getKvsList(), - proto.immudb.schema.KeyValue.toObject, includeInstance) + proto.immudb.schema.KeyValue.toObject, includeInstance), + nowait: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) }; if (includeInstance) { @@ -8392,6 +8756,10 @@ proto.immudb.schema.SetRequest.deserializeBinaryFromReader = function(msg, reade reader.readMessage(value,proto.immudb.schema.KeyValue.deserializeBinaryFromReader); msg.addKvs(value); break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setNowait(value); + break; default: reader.skipField(); break; @@ -8429,6 +8797,13 @@ proto.immudb.schema.SetRequest.serializeBinaryToWriter = function(message, write proto.immudb.schema.KeyValue.serializeBinaryToWriter ); } + f = message.getNowait(); + if (f) { + writer.writeBool( + 2, + f + ); + } }; @@ -8470,6 +8845,24 @@ proto.immudb.schema.SetRequest.prototype.clearKvsList = function() { }; +/** + * optional bool noWait = 2; + * @return {boolean} + */ +proto.immudb.schema.SetRequest.prototype.getNowait = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.immudb.schema.SetRequest} returns this + */ +proto.immudb.schema.SetRequest.prototype.setNowait = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + @@ -9716,7 +10109,8 @@ proto.immudb.schema.ReferenceRequest.toObject = function(includeInstance, msg) { key: msg.getKey_asB64(), referencedkey: msg.getReferencedkey_asB64(), attx: jspb.Message.getFieldWithDefault(msg, 3, 0), - boundref: jspb.Message.getBooleanFieldWithDefault(msg, 4, false) + boundref: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), + nowait: jspb.Message.getBooleanFieldWithDefault(msg, 5, false) }; if (includeInstance) { @@ -9769,6 +10163,10 @@ proto.immudb.schema.ReferenceRequest.deserializeBinaryFromReader = function(msg, var value = /** @type {boolean} */ (reader.readBool()); msg.setBoundref(value); break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setNowait(value); + break; default: reader.skipField(); break; @@ -9826,6 +10224,13 @@ proto.immudb.schema.ReferenceRequest.serializeBinaryToWriter = function(message, f ); } + f = message.getNowait(); + if (f) { + writer.writeBool( + 5, + f + ); + } }; @@ -9949,6 +10354,24 @@ proto.immudb.schema.ReferenceRequest.prototype.setBoundref = function(value) { }; +/** + * optional bool noWait = 5; + * @return {boolean} + */ +proto.immudb.schema.ReferenceRequest.prototype.getNowait = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.immudb.schema.ReferenceRequest} returns this + */ +proto.immudb.schema.ReferenceRequest.prototype.setNowait = function(value) { + return jspb.Message.setProto3BooleanField(this, 5, value); +}; + + @@ -10166,7 +10589,8 @@ proto.immudb.schema.ZAddRequest.toObject = function(includeInstance, msg) { score: jspb.Message.getFloatingPointFieldWithDefault(msg, 2, 0.0), key: msg.getKey_asB64(), attx: jspb.Message.getFieldWithDefault(msg, 4, 0), - boundref: jspb.Message.getBooleanFieldWithDefault(msg, 5, false) + boundref: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), + nowait: jspb.Message.getBooleanFieldWithDefault(msg, 6, false) }; if (includeInstance) { @@ -10223,7 +10647,11 @@ proto.immudb.schema.ZAddRequest.deserializeBinaryFromReader = function(msg, read var value = /** @type {boolean} */ (reader.readBool()); msg.setBoundref(value); break; - default: + case 6: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setNowait(value); + break; + default: reader.skipField(); break; } @@ -10287,6 +10715,13 @@ proto.immudb.schema.ZAddRequest.serializeBinaryToWriter = function(message, writ f ); } + f = message.getNowait(); + if (f) { + writer.writeBool( + 6, + f + ); + } }; @@ -10428,6 +10863,24 @@ proto.immudb.schema.ZAddRequest.prototype.setBoundref = function(value) { }; +/** + * optional bool noWait = 6; + * @return {boolean} + */ +proto.immudb.schema.ZAddRequest.prototype.getNowait = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.immudb.schema.ZAddRequest} returns this + */ +proto.immudb.schema.ZAddRequest.prototype.setNowait = function(value) { + return jspb.Message.setProto3BooleanField(this, 6, value); +}; + + @@ -11016,69 +11469,3043 @@ proto.immudb.schema.ZScanRequest.prototype.getMaxscore = function() { /** - * @param {?proto.immudb.schema.Score|undefined} value - * @return {!proto.immudb.schema.ZScanRequest} returns this -*/ -proto.immudb.schema.ZScanRequest.prototype.setMaxscore = function(value) { - return jspb.Message.setWrapperField(this, 9, value); + * @param {?proto.immudb.schema.Score|undefined} value + * @return {!proto.immudb.schema.ZScanRequest} returns this +*/ +proto.immudb.schema.ZScanRequest.prototype.setMaxscore = function(value) { + return jspb.Message.setWrapperField(this, 9, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.immudb.schema.ZScanRequest} returns this + */ +proto.immudb.schema.ZScanRequest.prototype.clearMaxscore = function() { + return this.setMaxscore(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.immudb.schema.ZScanRequest.prototype.hasMaxscore = function() { + return jspb.Message.getField(this, 9) != null; +}; + + +/** + * optional uint64 sinceTx = 10; + * @return {number} + */ +proto.immudb.schema.ZScanRequest.prototype.getSincetx = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.immudb.schema.ZScanRequest} returns this + */ +proto.immudb.schema.ZScanRequest.prototype.setSincetx = function(value) { + return jspb.Message.setProto3IntField(this, 10, value); +}; + + +/** + * optional bool noWait = 11; + * @return {boolean} + */ +proto.immudb.schema.ZScanRequest.prototype.getNowait = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 11, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.immudb.schema.ZScanRequest} returns this + */ +proto.immudb.schema.ZScanRequest.prototype.setNowait = function(value) { + return jspb.Message.setProto3BooleanField(this, 11, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.immudb.schema.HistoryRequest.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.HistoryRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.immudb.schema.HistoryRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.HistoryRequest.toObject = function(includeInstance, msg) { + var f, obj = { + key: msg.getKey_asB64(), + offset: jspb.Message.getFieldWithDefault(msg, 2, 0), + limit: jspb.Message.getFieldWithDefault(msg, 3, 0), + desc: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), + sincetx: jspb.Message.getFieldWithDefault(msg, 5, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.immudb.schema.HistoryRequest} + */ +proto.immudb.schema.HistoryRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.immudb.schema.HistoryRequest; + return proto.immudb.schema.HistoryRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.immudb.schema.HistoryRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.immudb.schema.HistoryRequest} + */ +proto.immudb.schema.HistoryRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setKey(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setOffset(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt32()); + msg.setLimit(value); + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDesc(value); + break; + case 5: + var value = /** @type {number} */ (reader.readUint64()); + msg.setSincetx(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.immudb.schema.HistoryRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.immudb.schema.HistoryRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.immudb.schema.HistoryRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.HistoryRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getOffset(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } + f = message.getLimit(); + if (f !== 0) { + writer.writeInt32( + 3, + f + ); + } + f = message.getDesc(); + if (f) { + writer.writeBool( + 4, + f + ); + } + f = message.getSincetx(); + if (f !== 0) { + writer.writeUint64( + 5, + f + ); + } +}; + + +/** + * optional bytes key = 1; + * @return {!(string|Uint8Array)} + */ +proto.immudb.schema.HistoryRequest.prototype.getKey = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes key = 1; + * This is a type-conversion wrapper around `getKey()` + * @return {string} + */ +proto.immudb.schema.HistoryRequest.prototype.getKey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getKey())); +}; + + +/** + * optional bytes key = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getKey()` + * @return {!Uint8Array} + */ +proto.immudb.schema.HistoryRequest.prototype.getKey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getKey())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.immudb.schema.HistoryRequest} returns this + */ +proto.immudb.schema.HistoryRequest.prototype.setKey = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional uint64 offset = 2; + * @return {number} + */ +proto.immudb.schema.HistoryRequest.prototype.getOffset = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.immudb.schema.HistoryRequest} returns this + */ +proto.immudb.schema.HistoryRequest.prototype.setOffset = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional int32 limit = 3; + * @return {number} + */ +proto.immudb.schema.HistoryRequest.prototype.getLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.immudb.schema.HistoryRequest} returns this + */ +proto.immudb.schema.HistoryRequest.prototype.setLimit = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional bool desc = 4; + * @return {boolean} + */ +proto.immudb.schema.HistoryRequest.prototype.getDesc = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.immudb.schema.HistoryRequest} returns this + */ +proto.immudb.schema.HistoryRequest.prototype.setDesc = function(value) { + return jspb.Message.setProto3BooleanField(this, 4, value); +}; + + +/** + * optional uint64 sinceTx = 5; + * @return {number} + */ +proto.immudb.schema.HistoryRequest.prototype.getSincetx = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.immudb.schema.HistoryRequest} returns this + */ +proto.immudb.schema.HistoryRequest.prototype.setSincetx = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.immudb.schema.VerifiableZAddRequest.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.VerifiableZAddRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.immudb.schema.VerifiableZAddRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.VerifiableZAddRequest.toObject = function(includeInstance, msg) { + var f, obj = { + zaddrequest: (f = msg.getZaddrequest()) && proto.immudb.schema.ZAddRequest.toObject(includeInstance, f), + provesincetx: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.immudb.schema.VerifiableZAddRequest} + */ +proto.immudb.schema.VerifiableZAddRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.immudb.schema.VerifiableZAddRequest; + return proto.immudb.schema.VerifiableZAddRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.immudb.schema.VerifiableZAddRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.immudb.schema.VerifiableZAddRequest} + */ +proto.immudb.schema.VerifiableZAddRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.immudb.schema.ZAddRequest; + reader.readMessage(value,proto.immudb.schema.ZAddRequest.deserializeBinaryFromReader); + msg.setZaddrequest(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setProvesincetx(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.immudb.schema.VerifiableZAddRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.immudb.schema.VerifiableZAddRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.immudb.schema.VerifiableZAddRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.VerifiableZAddRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getZaddrequest(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.immudb.schema.ZAddRequest.serializeBinaryToWriter + ); + } + f = message.getProvesincetx(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } +}; + + +/** + * optional ZAddRequest zAddRequest = 1; + * @return {?proto.immudb.schema.ZAddRequest} + */ +proto.immudb.schema.VerifiableZAddRequest.prototype.getZaddrequest = function() { + return /** @type{?proto.immudb.schema.ZAddRequest} */ ( + jspb.Message.getWrapperField(this, proto.immudb.schema.ZAddRequest, 1)); +}; + + +/** + * @param {?proto.immudb.schema.ZAddRequest|undefined} value + * @return {!proto.immudb.schema.VerifiableZAddRequest} returns this +*/ +proto.immudb.schema.VerifiableZAddRequest.prototype.setZaddrequest = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.immudb.schema.VerifiableZAddRequest} returns this + */ +proto.immudb.schema.VerifiableZAddRequest.prototype.clearZaddrequest = function() { + return this.setZaddrequest(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.immudb.schema.VerifiableZAddRequest.prototype.hasZaddrequest = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional uint64 proveSinceTx = 2; + * @return {number} + */ +proto.immudb.schema.VerifiableZAddRequest.prototype.getProvesincetx = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.immudb.schema.VerifiableZAddRequest} returns this + */ +proto.immudb.schema.VerifiableZAddRequest.prototype.setProvesincetx = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.immudb.schema.TxRequest.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.TxRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.immudb.schema.TxRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.TxRequest.toObject = function(includeInstance, msg) { + var f, obj = { + tx: jspb.Message.getFieldWithDefault(msg, 1, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.immudb.schema.TxRequest} + */ +proto.immudb.schema.TxRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.immudb.schema.TxRequest; + return proto.immudb.schema.TxRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.immudb.schema.TxRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.immudb.schema.TxRequest} + */ +proto.immudb.schema.TxRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setTx(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.immudb.schema.TxRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.immudb.schema.TxRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.immudb.schema.TxRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.TxRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTx(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } +}; + + +/** + * optional uint64 tx = 1; + * @return {number} + */ +proto.immudb.schema.TxRequest.prototype.getTx = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.immudb.schema.TxRequest} returns this + */ +proto.immudb.schema.TxRequest.prototype.setTx = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.immudb.schema.VerifiableTxRequest.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.VerifiableTxRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.immudb.schema.VerifiableTxRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.VerifiableTxRequest.toObject = function(includeInstance, msg) { + var f, obj = { + tx: jspb.Message.getFieldWithDefault(msg, 1, 0), + provesincetx: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.immudb.schema.VerifiableTxRequest} + */ +proto.immudb.schema.VerifiableTxRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.immudb.schema.VerifiableTxRequest; + return proto.immudb.schema.VerifiableTxRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.immudb.schema.VerifiableTxRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.immudb.schema.VerifiableTxRequest} + */ +proto.immudb.schema.VerifiableTxRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setTx(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setProvesincetx(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.immudb.schema.VerifiableTxRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.immudb.schema.VerifiableTxRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.immudb.schema.VerifiableTxRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.VerifiableTxRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTx(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getProvesincetx(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } +}; + + +/** + * optional uint64 tx = 1; + * @return {number} + */ +proto.immudb.schema.VerifiableTxRequest.prototype.getTx = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.immudb.schema.VerifiableTxRequest} returns this + */ +proto.immudb.schema.VerifiableTxRequest.prototype.setTx = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint64 proveSinceTx = 2; + * @return {number} + */ +proto.immudb.schema.VerifiableTxRequest.prototype.getProvesincetx = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.immudb.schema.VerifiableTxRequest} returns this + */ +proto.immudb.schema.VerifiableTxRequest.prototype.setProvesincetx = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.immudb.schema.TxScanRequest.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.TxScanRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.immudb.schema.TxScanRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.TxScanRequest.toObject = function(includeInstance, msg) { + var f, obj = { + initialtx: jspb.Message.getFieldWithDefault(msg, 1, 0), + limit: jspb.Message.getFieldWithDefault(msg, 2, 0), + desc: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.immudb.schema.TxScanRequest} + */ +proto.immudb.schema.TxScanRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.immudb.schema.TxScanRequest; + return proto.immudb.schema.TxScanRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.immudb.schema.TxScanRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.immudb.schema.TxScanRequest} + */ +proto.immudb.schema.TxScanRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setInitialtx(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint32()); + msg.setLimit(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDesc(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.immudb.schema.TxScanRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.immudb.schema.TxScanRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.immudb.schema.TxScanRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.TxScanRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getInitialtx(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getLimit(); + if (f !== 0) { + writer.writeUint32( + 2, + f + ); + } + f = message.getDesc(); + if (f) { + writer.writeBool( + 3, + f + ); + } +}; + + +/** + * optional uint64 initialTx = 1; + * @return {number} + */ +proto.immudb.schema.TxScanRequest.prototype.getInitialtx = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.immudb.schema.TxScanRequest} returns this + */ +proto.immudb.schema.TxScanRequest.prototype.setInitialtx = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint32 limit = 2; + * @return {number} + */ +proto.immudb.schema.TxScanRequest.prototype.getLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.immudb.schema.TxScanRequest} returns this + */ +proto.immudb.schema.TxScanRequest.prototype.setLimit = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional bool desc = 3; + * @return {boolean} + */ +proto.immudb.schema.TxScanRequest.prototype.getDesc = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.immudb.schema.TxScanRequest} returns this + */ +proto.immudb.schema.TxScanRequest.prototype.setDesc = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.immudb.schema.TxList.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.immudb.schema.TxList.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.TxList.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.immudb.schema.TxList} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.TxList.toObject = function(includeInstance, msg) { + var f, obj = { + txsList: jspb.Message.toObjectList(msg.getTxsList(), + proto.immudb.schema.Tx.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.immudb.schema.TxList} + */ +proto.immudb.schema.TxList.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.immudb.schema.TxList; + return proto.immudb.schema.TxList.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.immudb.schema.TxList} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.immudb.schema.TxList} + */ +proto.immudb.schema.TxList.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.immudb.schema.Tx; + reader.readMessage(value,proto.immudb.schema.Tx.deserializeBinaryFromReader); + msg.addTxs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.immudb.schema.TxList.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.immudb.schema.TxList.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.immudb.schema.TxList} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.TxList.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTxsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.immudb.schema.Tx.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated Tx txs = 1; + * @return {!Array} + */ +proto.immudb.schema.TxList.prototype.getTxsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.immudb.schema.Tx, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.immudb.schema.TxList} returns this +*/ +proto.immudb.schema.TxList.prototype.setTxsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.immudb.schema.Tx=} opt_value + * @param {number=} opt_index + * @return {!proto.immudb.schema.Tx} + */ +proto.immudb.schema.TxList.prototype.addTxs = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.immudb.schema.Tx, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.immudb.schema.TxList} returns this + */ +proto.immudb.schema.TxList.prototype.clearTxsList = function() { + return this.setTxsList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.immudb.schema.Database.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.Database.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.immudb.schema.Database} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.Database.toObject = function(includeInstance, msg) { + var f, obj = { + databasename: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.immudb.schema.Database} + */ +proto.immudb.schema.Database.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.immudb.schema.Database; + return proto.immudb.schema.Database.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.immudb.schema.Database} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.immudb.schema.Database} + */ +proto.immudb.schema.Database.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setDatabasename(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.immudb.schema.Database.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.immudb.schema.Database.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.immudb.schema.Database} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.Database.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDatabasename(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string databaseName = 1; + * @return {string} + */ +proto.immudb.schema.Database.prototype.getDatabasename = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.immudb.schema.Database} returns this + */ +proto.immudb.schema.Database.prototype.setDatabasename = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.immudb.schema.Table.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.Table.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.immudb.schema.Table} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.Table.toObject = function(includeInstance, msg) { + var f, obj = { + tablename: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.immudb.schema.Table} + */ +proto.immudb.schema.Table.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.immudb.schema.Table; + return proto.immudb.schema.Table.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.immudb.schema.Table} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.immudb.schema.Table} + */ +proto.immudb.schema.Table.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setTablename(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.immudb.schema.Table.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.immudb.schema.Table.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.immudb.schema.Table} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.Table.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTablename(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string tableName = 1; + * @return {string} + */ +proto.immudb.schema.Table.prototype.getTablename = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.immudb.schema.Table} returns this + */ +proto.immudb.schema.Table.prototype.setTablename = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.immudb.schema.SQLGetRequest.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.SQLGetRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.immudb.schema.SQLGetRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.SQLGetRequest.toObject = function(includeInstance, msg) { + var f, obj = { + table: jspb.Message.getFieldWithDefault(msg, 1, ""), + pkvalue: (f = msg.getPkvalue()) && proto.immudb.schema.SQLValue.toObject(includeInstance, f), + attx: jspb.Message.getFieldWithDefault(msg, 3, 0), + sincetx: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.immudb.schema.SQLGetRequest} + */ +proto.immudb.schema.SQLGetRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.immudb.schema.SQLGetRequest; + return proto.immudb.schema.SQLGetRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.immudb.schema.SQLGetRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.immudb.schema.SQLGetRequest} + */ +proto.immudb.schema.SQLGetRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setTable(value); + break; + case 2: + var value = new proto.immudb.schema.SQLValue; + reader.readMessage(value,proto.immudb.schema.SQLValue.deserializeBinaryFromReader); + msg.setPkvalue(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint64()); + msg.setAttx(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint64()); + msg.setSincetx(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.immudb.schema.SQLGetRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.immudb.schema.SQLGetRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.immudb.schema.SQLGetRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.SQLGetRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTable(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getPkvalue(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.immudb.schema.SQLValue.serializeBinaryToWriter + ); + } + f = message.getAttx(); + if (f !== 0) { + writer.writeUint64( + 3, + f + ); + } + f = message.getSincetx(); + if (f !== 0) { + writer.writeUint64( + 4, + f + ); + } +}; + + +/** + * optional string table = 1; + * @return {string} + */ +proto.immudb.schema.SQLGetRequest.prototype.getTable = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.immudb.schema.SQLGetRequest} returns this + */ +proto.immudb.schema.SQLGetRequest.prototype.setTable = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional SQLValue pkValue = 2; + * @return {?proto.immudb.schema.SQLValue} + */ +proto.immudb.schema.SQLGetRequest.prototype.getPkvalue = function() { + return /** @type{?proto.immudb.schema.SQLValue} */ ( + jspb.Message.getWrapperField(this, proto.immudb.schema.SQLValue, 2)); +}; + + +/** + * @param {?proto.immudb.schema.SQLValue|undefined} value + * @return {!proto.immudb.schema.SQLGetRequest} returns this +*/ +proto.immudb.schema.SQLGetRequest.prototype.setPkvalue = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.immudb.schema.SQLGetRequest} returns this + */ +proto.immudb.schema.SQLGetRequest.prototype.clearPkvalue = function() { + return this.setPkvalue(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.immudb.schema.SQLGetRequest.prototype.hasPkvalue = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional uint64 atTx = 3; + * @return {number} + */ +proto.immudb.schema.SQLGetRequest.prototype.getAttx = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.immudb.schema.SQLGetRequest} returns this + */ +proto.immudb.schema.SQLGetRequest.prototype.setAttx = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional uint64 sinceTx = 4; + * @return {number} + */ +proto.immudb.schema.SQLGetRequest.prototype.getSincetx = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.immudb.schema.SQLGetRequest} returns this + */ +proto.immudb.schema.SQLGetRequest.prototype.setSincetx = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.immudb.schema.VerifiableSQLGetRequest.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.VerifiableSQLGetRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.immudb.schema.VerifiableSQLGetRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.VerifiableSQLGetRequest.toObject = function(includeInstance, msg) { + var f, obj = { + sqlgetrequest: (f = msg.getSqlgetrequest()) && proto.immudb.schema.SQLGetRequest.toObject(includeInstance, f), + provesincetx: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.immudb.schema.VerifiableSQLGetRequest} + */ +proto.immudb.schema.VerifiableSQLGetRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.immudb.schema.VerifiableSQLGetRequest; + return proto.immudb.schema.VerifiableSQLGetRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.immudb.schema.VerifiableSQLGetRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.immudb.schema.VerifiableSQLGetRequest} + */ +proto.immudb.schema.VerifiableSQLGetRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.immudb.schema.SQLGetRequest; + reader.readMessage(value,proto.immudb.schema.SQLGetRequest.deserializeBinaryFromReader); + msg.setSqlgetrequest(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setProvesincetx(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.immudb.schema.VerifiableSQLGetRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.immudb.schema.VerifiableSQLGetRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.immudb.schema.VerifiableSQLGetRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.VerifiableSQLGetRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSqlgetrequest(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.immudb.schema.SQLGetRequest.serializeBinaryToWriter + ); + } + f = message.getProvesincetx(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } +}; + + +/** + * optional SQLGetRequest sqlGetRequest = 1; + * @return {?proto.immudb.schema.SQLGetRequest} + */ +proto.immudb.schema.VerifiableSQLGetRequest.prototype.getSqlgetrequest = function() { + return /** @type{?proto.immudb.schema.SQLGetRequest} */ ( + jspb.Message.getWrapperField(this, proto.immudb.schema.SQLGetRequest, 1)); +}; + + +/** + * @param {?proto.immudb.schema.SQLGetRequest|undefined} value + * @return {!proto.immudb.schema.VerifiableSQLGetRequest} returns this +*/ +proto.immudb.schema.VerifiableSQLGetRequest.prototype.setSqlgetrequest = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.immudb.schema.VerifiableSQLGetRequest} returns this + */ +proto.immudb.schema.VerifiableSQLGetRequest.prototype.clearSqlgetrequest = function() { + return this.setSqlgetrequest(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.immudb.schema.VerifiableSQLGetRequest.prototype.hasSqlgetrequest = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional uint64 proveSinceTx = 2; + * @return {number} + */ +proto.immudb.schema.VerifiableSQLGetRequest.prototype.getProvesincetx = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.immudb.schema.VerifiableSQLGetRequest} returns this + */ +proto.immudb.schema.VerifiableSQLGetRequest.prototype.setProvesincetx = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.immudb.schema.SQLEntry.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.SQLEntry.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.immudb.schema.SQLEntry} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.SQLEntry.toObject = function(includeInstance, msg) { + var f, obj = { + tx: jspb.Message.getFieldWithDefault(msg, 1, 0), + key: msg.getKey_asB64(), + value: msg.getValue_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.immudb.schema.SQLEntry} + */ +proto.immudb.schema.SQLEntry.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.immudb.schema.SQLEntry; + return proto.immudb.schema.SQLEntry.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.immudb.schema.SQLEntry} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.immudb.schema.SQLEntry} + */ +proto.immudb.schema.SQLEntry.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setTx(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setKey(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.immudb.schema.SQLEntry.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.immudb.schema.SQLEntry.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.immudb.schema.SQLEntry} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.SQLEntry.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTx(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getKey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getValue_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } +}; + + +/** + * optional uint64 tx = 1; + * @return {number} + */ +proto.immudb.schema.SQLEntry.prototype.getTx = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.immudb.schema.SQLEntry} returns this + */ +proto.immudb.schema.SQLEntry.prototype.setTx = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional bytes key = 2; + * @return {!(string|Uint8Array)} + */ +proto.immudb.schema.SQLEntry.prototype.getKey = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes key = 2; + * This is a type-conversion wrapper around `getKey()` + * @return {string} + */ +proto.immudb.schema.SQLEntry.prototype.getKey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getKey())); +}; + + +/** + * optional bytes key = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getKey()` + * @return {!Uint8Array} + */ +proto.immudb.schema.SQLEntry.prototype.getKey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getKey())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.immudb.schema.SQLEntry} returns this + */ +proto.immudb.schema.SQLEntry.prototype.setKey = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional bytes value = 3; + * @return {!(string|Uint8Array)} + */ +proto.immudb.schema.SQLEntry.prototype.getValue = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes value = 3; + * This is a type-conversion wrapper around `getValue()` + * @return {string} + */ +proto.immudb.schema.SQLEntry.prototype.getValue_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getValue())); +}; + + +/** + * optional bytes value = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getValue()` + * @return {!Uint8Array} + */ +proto.immudb.schema.SQLEntry.prototype.getValue_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getValue())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.immudb.schema.SQLEntry} returns this + */ +proto.immudb.schema.SQLEntry.prototype.setValue = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.VerifiableSQLEntry.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.immudb.schema.VerifiableSQLEntry} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.VerifiableSQLEntry.toObject = function(includeInstance, msg) { + var f, obj = { + sqlentry: (f = msg.getSqlentry()) && proto.immudb.schema.SQLEntry.toObject(includeInstance, f), + verifiabletx: (f = msg.getVerifiabletx()) && proto.immudb.schema.VerifiableTx.toObject(includeInstance, f), + inclusionproof: (f = msg.getInclusionproof()) && proto.immudb.schema.InclusionProof.toObject(includeInstance, f), + databaseid: jspb.Message.getFieldWithDefault(msg, 4, 0), + tableid: jspb.Message.getFieldWithDefault(msg, 5, 0), + pkname: jspb.Message.getFieldWithDefault(msg, 6, ""), + colidsbyidMap: (f = msg.getColidsbyidMap()) ? f.toObject(includeInstance, undefined) : [], + colidsbynameMap: (f = msg.getColidsbynameMap()) ? f.toObject(includeInstance, undefined) : [], + coltypesbyidMap: (f = msg.getColtypesbyidMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.immudb.schema.VerifiableSQLEntry} + */ +proto.immudb.schema.VerifiableSQLEntry.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.immudb.schema.VerifiableSQLEntry; + return proto.immudb.schema.VerifiableSQLEntry.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.immudb.schema.VerifiableSQLEntry} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.immudb.schema.VerifiableSQLEntry} + */ +proto.immudb.schema.VerifiableSQLEntry.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.immudb.schema.SQLEntry; + reader.readMessage(value,proto.immudb.schema.SQLEntry.deserializeBinaryFromReader); + msg.setSqlentry(value); + break; + case 2: + var value = new proto.immudb.schema.VerifiableTx; + reader.readMessage(value,proto.immudb.schema.VerifiableTx.deserializeBinaryFromReader); + msg.setVerifiabletx(value); + break; + case 3: + var value = new proto.immudb.schema.InclusionProof; + reader.readMessage(value,proto.immudb.schema.InclusionProof.deserializeBinaryFromReader); + msg.setInclusionproof(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint64()); + msg.setDatabaseid(value); + break; + case 5: + var value = /** @type {number} */ (reader.readUint64()); + msg.setTableid(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setPkname(value); + break; + case 8: + var value = msg.getColidsbyidMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint64, jspb.BinaryReader.prototype.readString, null, 0, ""); + }); + break; + case 9: + var value = msg.getColidsbynameMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readUint64, null, "", 0); + }); + break; + case 10: + var value = msg.getColtypesbyidMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint64, jspb.BinaryReader.prototype.readString, null, 0, ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.immudb.schema.VerifiableSQLEntry.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.immudb.schema.VerifiableSQLEntry} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.VerifiableSQLEntry.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSqlentry(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.immudb.schema.SQLEntry.serializeBinaryToWriter + ); + } + f = message.getVerifiabletx(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.immudb.schema.VerifiableTx.serializeBinaryToWriter + ); + } + f = message.getInclusionproof(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.immudb.schema.InclusionProof.serializeBinaryToWriter + ); + } + f = message.getDatabaseid(); + if (f !== 0) { + writer.writeUint64( + 4, + f + ); + } + f = message.getTableid(); + if (f !== 0) { + writer.writeUint64( + 5, + f + ); + } + f = message.getPkname(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getColidsbyidMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(8, writer, jspb.BinaryWriter.prototype.writeUint64, jspb.BinaryWriter.prototype.writeString); + } + f = message.getColidsbynameMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(9, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeUint64); + } + f = message.getColtypesbyidMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(10, writer, jspb.BinaryWriter.prototype.writeUint64, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional SQLEntry sqlEntry = 1; + * @return {?proto.immudb.schema.SQLEntry} + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.getSqlentry = function() { + return /** @type{?proto.immudb.schema.SQLEntry} */ ( + jspb.Message.getWrapperField(this, proto.immudb.schema.SQLEntry, 1)); +}; + + +/** + * @param {?proto.immudb.schema.SQLEntry|undefined} value + * @return {!proto.immudb.schema.VerifiableSQLEntry} returns this +*/ +proto.immudb.schema.VerifiableSQLEntry.prototype.setSqlentry = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.immudb.schema.VerifiableSQLEntry} returns this + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.clearSqlentry = function() { + return this.setSqlentry(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.hasSqlentry = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional VerifiableTx verifiableTx = 2; + * @return {?proto.immudb.schema.VerifiableTx} + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.getVerifiabletx = function() { + return /** @type{?proto.immudb.schema.VerifiableTx} */ ( + jspb.Message.getWrapperField(this, proto.immudb.schema.VerifiableTx, 2)); +}; + + +/** + * @param {?proto.immudb.schema.VerifiableTx|undefined} value + * @return {!proto.immudb.schema.VerifiableSQLEntry} returns this +*/ +proto.immudb.schema.VerifiableSQLEntry.prototype.setVerifiabletx = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.immudb.schema.VerifiableSQLEntry} returns this + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.clearVerifiabletx = function() { + return this.setVerifiabletx(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.hasVerifiabletx = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional InclusionProof inclusionProof = 3; + * @return {?proto.immudb.schema.InclusionProof} + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.getInclusionproof = function() { + return /** @type{?proto.immudb.schema.InclusionProof} */ ( + jspb.Message.getWrapperField(this, proto.immudb.schema.InclusionProof, 3)); +}; + + +/** + * @param {?proto.immudb.schema.InclusionProof|undefined} value + * @return {!proto.immudb.schema.VerifiableSQLEntry} returns this +*/ +proto.immudb.schema.VerifiableSQLEntry.prototype.setInclusionproof = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.immudb.schema.VerifiableSQLEntry} returns this + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.clearInclusionproof = function() { + return this.setInclusionproof(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.hasInclusionproof = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional uint64 DatabaseId = 4; + * @return {number} + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.getDatabaseid = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.immudb.schema.VerifiableSQLEntry} returns this + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.setDatabaseid = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional uint64 TableId = 5; + * @return {number} + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.getTableid = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.immudb.schema.VerifiableSQLEntry} returns this + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.setTableid = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); +}; + + +/** + * optional string PKName = 6; + * @return {string} + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.getPkname = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.immudb.schema.VerifiableSQLEntry} returns this + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.setPkname = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * map ColIdsById = 8; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.getColidsbyidMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 8, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.immudb.schema.VerifiableSQLEntry} returns this + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.clearColidsbyidMap = function() { + this.getColidsbyidMap().clear(); + return this;}; + + +/** + * map ColIdsByName = 9; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.getColidsbynameMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 9, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.immudb.schema.VerifiableSQLEntry} returns this + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.clearColidsbynameMap = function() { + this.getColidsbynameMap().clear(); + return this;}; + + +/** + * map ColTypesById = 10; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.getColtypesbyidMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 10, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.immudb.schema.VerifiableSQLEntry} returns this + */ +proto.immudb.schema.VerifiableSQLEntry.prototype.clearColtypesbyidMap = function() { + this.getColtypesbyidMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.immudb.schema.UseDatabaseReply.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.UseDatabaseReply.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.immudb.schema.UseDatabaseReply} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.UseDatabaseReply.toObject = function(includeInstance, msg) { + var f, obj = { + token: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.immudb.schema.UseDatabaseReply} + */ +proto.immudb.schema.UseDatabaseReply.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.immudb.schema.UseDatabaseReply; + return proto.immudb.schema.UseDatabaseReply.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.immudb.schema.UseDatabaseReply} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.immudb.schema.UseDatabaseReply} + */ +proto.immudb.schema.UseDatabaseReply.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setToken(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.immudb.schema.UseDatabaseReply.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.immudb.schema.UseDatabaseReply.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.immudb.schema.UseDatabaseReply} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.UseDatabaseReply.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getToken(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string token = 1; + * @return {string} + */ +proto.immudb.schema.UseDatabaseReply.prototype.getToken = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.immudb.schema.UseDatabaseReply} returns this + */ +proto.immudb.schema.UseDatabaseReply.prototype.setToken = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.immudb.schema.ChangePermissionRequest.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.ChangePermissionRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.immudb.schema.ChangePermissionRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.ChangePermissionRequest.toObject = function(includeInstance, msg) { + var f, obj = { + action: jspb.Message.getFieldWithDefault(msg, 1, 0), + username: jspb.Message.getFieldWithDefault(msg, 2, ""), + database: jspb.Message.getFieldWithDefault(msg, 3, ""), + permission: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.immudb.schema.ChangePermissionRequest} + */ +proto.immudb.schema.ChangePermissionRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.immudb.schema.ChangePermissionRequest; + return proto.immudb.schema.ChangePermissionRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.immudb.schema.ChangePermissionRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.immudb.schema.ChangePermissionRequest} + */ +proto.immudb.schema.ChangePermissionRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.immudb.schema.PermissionAction} */ (reader.readEnum()); + msg.setAction(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setUsername(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setDatabase(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint32()); + msg.setPermission(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.immudb.schema.ChangePermissionRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.immudb.schema.ChangePermissionRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.immudb.schema.ChangePermissionRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.ChangePermissionRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAction(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getUsername(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getDatabase(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getPermission(); + if (f !== 0) { + writer.writeUint32( + 4, + f + ); + } +}; + + +/** + * optional PermissionAction action = 1; + * @return {!proto.immudb.schema.PermissionAction} + */ +proto.immudb.schema.ChangePermissionRequest.prototype.getAction = function() { + return /** @type {!proto.immudb.schema.PermissionAction} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.immudb.schema.PermissionAction} value + * @return {!proto.immudb.schema.ChangePermissionRequest} returns this + */ +proto.immudb.schema.ChangePermissionRequest.prototype.setAction = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional string username = 2; + * @return {string} + */ +proto.immudb.schema.ChangePermissionRequest.prototype.getUsername = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.immudb.schema.ChangePermissionRequest} returns this + */ +proto.immudb.schema.ChangePermissionRequest.prototype.setUsername = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string database = 3; + * @return {string} + */ +proto.immudb.schema.ChangePermissionRequest.prototype.getDatabase = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.immudb.schema.ChangePermissionRequest} returns this + */ +proto.immudb.schema.ChangePermissionRequest.prototype.setDatabase = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional uint32 permission = 4; + * @return {number} + */ +proto.immudb.schema.ChangePermissionRequest.prototype.getPermission = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.immudb.schema.ChangePermissionRequest} returns this + */ +proto.immudb.schema.ChangePermissionRequest.prototype.setPermission = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.immudb.schema.SetActiveUserRequest.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.SetActiveUserRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.immudb.schema.SetActiveUserRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.immudb.schema.SetActiveUserRequest.toObject = function(includeInstance, msg) { + var f, obj = { + active: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), + username: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.immudb.schema.SetActiveUserRequest} + */ +proto.immudb.schema.SetActiveUserRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.immudb.schema.SetActiveUserRequest; + return proto.immudb.schema.SetActiveUserRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.immudb.schema.SetActiveUserRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.immudb.schema.SetActiveUserRequest} + */ +proto.immudb.schema.SetActiveUserRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setActive(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setUsername(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * Clears the message field making it undefined. - * @return {!proto.immudb.schema.ZScanRequest} returns this + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.immudb.schema.ZScanRequest.prototype.clearMaxscore = function() { - return this.setMaxscore(undefined); +proto.immudb.schema.SetActiveUserRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.immudb.schema.SetActiveUserRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * Returns whether this field is set. - * @return {boolean} + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.immudb.schema.SetActiveUserRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.ZScanRequest.prototype.hasMaxscore = function() { - return jspb.Message.getField(this, 9) != null; +proto.immudb.schema.SetActiveUserRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getActive(); + if (f) { + writer.writeBool( + 1, + f + ); + } + f = message.getUsername(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } }; /** - * optional uint64 sinceTx = 10; - * @return {number} + * optional bool active = 1; + * @return {boolean} */ -proto.immudb.schema.ZScanRequest.prototype.getSincetx = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0)); +proto.immudb.schema.SetActiveUserRequest.prototype.getActive = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); }; /** - * @param {number} value - * @return {!proto.immudb.schema.ZScanRequest} returns this + * @param {boolean} value + * @return {!proto.immudb.schema.SetActiveUserRequest} returns this */ -proto.immudb.schema.ZScanRequest.prototype.setSincetx = function(value) { - return jspb.Message.setProto3IntField(this, 10, value); +proto.immudb.schema.SetActiveUserRequest.prototype.setActive = function(value) { + return jspb.Message.setProto3BooleanField(this, 1, value); }; /** - * optional bool noWait = 11; - * @return {boolean} + * optional string username = 2; + * @return {string} */ -proto.immudb.schema.ZScanRequest.prototype.getNowait = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 11, false)); +proto.immudb.schema.SetActiveUserRequest.prototype.getUsername = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** - * @param {boolean} value - * @return {!proto.immudb.schema.ZScanRequest} returns this + * @param {string} value + * @return {!proto.immudb.schema.SetActiveUserRequest} returns this */ -proto.immudb.schema.ZScanRequest.prototype.setNowait = function(value) { - return jspb.Message.setProto3BooleanField(this, 11, value); +proto.immudb.schema.SetActiveUserRequest.prototype.setUsername = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); }; +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.immudb.schema.DatabaseListResponse.repeatedFields_ = [1]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -11094,8 +14521,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.immudb.schema.HistoryRequest.prototype.toObject = function(opt_includeInstance) { - return proto.immudb.schema.HistoryRequest.toObject(opt_includeInstance, this); +proto.immudb.schema.DatabaseListResponse.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.DatabaseListResponse.toObject(opt_includeInstance, this); }; @@ -11104,17 +14531,14 @@ proto.immudb.schema.HistoryRequest.prototype.toObject = function(opt_includeInst * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.immudb.schema.HistoryRequest} msg The msg instance to transform. + * @param {!proto.immudb.schema.DatabaseListResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.HistoryRequest.toObject = function(includeInstance, msg) { +proto.immudb.schema.DatabaseListResponse.toObject = function(includeInstance, msg) { var f, obj = { - key: msg.getKey_asB64(), - offset: jspb.Message.getFieldWithDefault(msg, 2, 0), - limit: jspb.Message.getFieldWithDefault(msg, 3, 0), - desc: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), - sincetx: jspb.Message.getFieldWithDefault(msg, 5, 0) + databasesList: jspb.Message.toObjectList(msg.getDatabasesList(), + proto.immudb.schema.Database.toObject, includeInstance) }; if (includeInstance) { @@ -11128,23 +14552,23 @@ proto.immudb.schema.HistoryRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.immudb.schema.HistoryRequest} + * @return {!proto.immudb.schema.DatabaseListResponse} */ -proto.immudb.schema.HistoryRequest.deserializeBinary = function(bytes) { +proto.immudb.schema.DatabaseListResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.immudb.schema.HistoryRequest; - return proto.immudb.schema.HistoryRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.immudb.schema.DatabaseListResponse; + return proto.immudb.schema.DatabaseListResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.immudb.schema.HistoryRequest} msg The message object to deserialize into. + * @param {!proto.immudb.schema.DatabaseListResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.immudb.schema.HistoryRequest} + * @return {!proto.immudb.schema.DatabaseListResponse} */ -proto.immudb.schema.HistoryRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.immudb.schema.DatabaseListResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -11152,24 +14576,9 @@ proto.immudb.schema.HistoryRequest.deserializeBinaryFromReader = function(msg, r var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setKey(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint64()); - msg.setOffset(value); - break; - case 3: - var value = /** @type {number} */ (reader.readInt32()); - msg.setLimit(value); - break; - case 4: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setDesc(value); - break; - case 5: - var value = /** @type {number} */ (reader.readUint64()); - msg.setSincetx(value); + var value = new proto.immudb.schema.Database; + reader.readMessage(value,proto.immudb.schema.Database.deserializeBinaryFromReader); + msg.addDatabases(value); break; default: reader.skipField(); @@ -11184,9 +14593,9 @@ proto.immudb.schema.HistoryRequest.deserializeBinaryFromReader = function(msg, r * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.immudb.schema.HistoryRequest.prototype.serializeBinary = function() { +proto.immudb.schema.DatabaseListResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.immudb.schema.HistoryRequest.serializeBinaryToWriter(this, writer); + proto.immudb.schema.DatabaseListResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -11194,161 +14603,212 @@ proto.immudb.schema.HistoryRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.immudb.schema.HistoryRequest} message + * @param {!proto.immudb.schema.DatabaseListResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.HistoryRequest.serializeBinaryToWriter = function(message, writer) { +proto.immudb.schema.DatabaseListResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getKey_asU8(); + f = message.getDatabasesList(); if (f.length > 0) { - writer.writeBytes( + writer.writeRepeatedMessage( 1, - f - ); - } - f = message.getOffset(); - if (f !== 0) { - writer.writeUint64( - 2, - f - ); - } - f = message.getLimit(); - if (f !== 0) { - writer.writeInt32( - 3, - f - ); - } - f = message.getDesc(); - if (f) { - writer.writeBool( - 4, - f - ); - } - f = message.getSincetx(); - if (f !== 0) { - writer.writeUint64( - 5, - f + f, + proto.immudb.schema.Database.serializeBinaryToWriter ); } }; /** - * optional bytes key = 1; - * @return {!(string|Uint8Array)} + * repeated Database databases = 1; + * @return {!Array} */ -proto.immudb.schema.HistoryRequest.prototype.getKey = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.immudb.schema.DatabaseListResponse.prototype.getDatabasesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.immudb.schema.Database, 1)); }; /** - * optional bytes key = 1; - * This is a type-conversion wrapper around `getKey()` - * @return {string} + * @param {!Array} value + * @return {!proto.immudb.schema.DatabaseListResponse} returns this +*/ +proto.immudb.schema.DatabaseListResponse.prototype.setDatabasesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.immudb.schema.Database=} opt_value + * @param {number=} opt_index + * @return {!proto.immudb.schema.Database} */ -proto.immudb.schema.HistoryRequest.prototype.getKey_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getKey())); +proto.immudb.schema.DatabaseListResponse.prototype.addDatabases = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.immudb.schema.Database, opt_index); }; /** - * optional bytes key = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getKey()` - * @return {!Uint8Array} + * Clears the list making it empty but non-null. + * @return {!proto.immudb.schema.DatabaseListResponse} returns this + */ +proto.immudb.schema.DatabaseListResponse.prototype.clearDatabasesList = function() { + return this.setDatabasesList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} */ -proto.immudb.schema.HistoryRequest.prototype.getKey_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getKey())); +proto.immudb.schema.Chunk.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.Chunk.toObject(opt_includeInstance, this); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.immudb.schema.HistoryRequest} returns this + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.immudb.schema.Chunk} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.HistoryRequest.prototype.setKey = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); +proto.immudb.schema.Chunk.toObject = function(includeInstance, msg) { + var f, obj = { + content: msg.getContent_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} /** - * optional uint64 offset = 2; - * @return {number} + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.immudb.schema.Chunk} */ -proto.immudb.schema.HistoryRequest.prototype.getOffset = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +proto.immudb.schema.Chunk.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.immudb.schema.Chunk; + return proto.immudb.schema.Chunk.deserializeBinaryFromReader(msg, reader); }; /** - * @param {number} value - * @return {!proto.immudb.schema.HistoryRequest} returns this + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.immudb.schema.Chunk} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.immudb.schema.Chunk} */ -proto.immudb.schema.HistoryRequest.prototype.setOffset = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); +proto.immudb.schema.Chunk.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setContent(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * optional int32 limit = 3; - * @return {number} + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.immudb.schema.HistoryRequest.prototype.getLimit = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +proto.immudb.schema.Chunk.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.immudb.schema.Chunk.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * @param {number} value - * @return {!proto.immudb.schema.HistoryRequest} returns this + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.immudb.schema.Chunk} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.HistoryRequest.prototype.setLimit = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); +proto.immudb.schema.Chunk.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getContent_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } }; /** - * optional bool desc = 4; - * @return {boolean} + * optional bytes content = 1; + * @return {!(string|Uint8Array)} */ -proto.immudb.schema.HistoryRequest.prototype.getDesc = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +proto.immudb.schema.Chunk.prototype.getContent = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {boolean} value - * @return {!proto.immudb.schema.HistoryRequest} returns this + * optional bytes content = 1; + * This is a type-conversion wrapper around `getContent()` + * @return {string} */ -proto.immudb.schema.HistoryRequest.prototype.setDesc = function(value) { - return jspb.Message.setProto3BooleanField(this, 4, value); +proto.immudb.schema.Chunk.prototype.getContent_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getContent())); }; /** - * optional uint64 sinceTx = 5; - * @return {number} + * optional bytes content = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getContent()` + * @return {!Uint8Array} */ -proto.immudb.schema.HistoryRequest.prototype.getSincetx = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +proto.immudb.schema.Chunk.prototype.getContent_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getContent())); }; /** - * @param {number} value - * @return {!proto.immudb.schema.HistoryRequest} returns this + * @param {!(string|Uint8Array)} value + * @return {!proto.immudb.schema.Chunk} returns this */ -proto.immudb.schema.HistoryRequest.prototype.setSincetx = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); +proto.immudb.schema.Chunk.prototype.setContent = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); }; @@ -11368,8 +14828,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.immudb.schema.VerifiableZAddRequest.prototype.toObject = function(opt_includeInstance) { - return proto.immudb.schema.VerifiableZAddRequest.toObject(opt_includeInstance, this); +proto.immudb.schema.UseSnapshotRequest.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.UseSnapshotRequest.toObject(opt_includeInstance, this); }; @@ -11378,14 +14838,14 @@ proto.immudb.schema.VerifiableZAddRequest.prototype.toObject = function(opt_incl * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.immudb.schema.VerifiableZAddRequest} msg The msg instance to transform. + * @param {!proto.immudb.schema.UseSnapshotRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.VerifiableZAddRequest.toObject = function(includeInstance, msg) { +proto.immudb.schema.UseSnapshotRequest.toObject = function(includeInstance, msg) { var f, obj = { - zaddrequest: (f = msg.getZaddrequest()) && proto.immudb.schema.ZAddRequest.toObject(includeInstance, f), - provesincetx: jspb.Message.getFieldWithDefault(msg, 2, 0) + sincetx: jspb.Message.getFieldWithDefault(msg, 1, 0), + asbeforetx: jspb.Message.getFieldWithDefault(msg, 2, 0) }; if (includeInstance) { @@ -11399,23 +14859,23 @@ proto.immudb.schema.VerifiableZAddRequest.toObject = function(includeInstance, m /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.immudb.schema.VerifiableZAddRequest} + * @return {!proto.immudb.schema.UseSnapshotRequest} */ -proto.immudb.schema.VerifiableZAddRequest.deserializeBinary = function(bytes) { +proto.immudb.schema.UseSnapshotRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.immudb.schema.VerifiableZAddRequest; - return proto.immudb.schema.VerifiableZAddRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.immudb.schema.UseSnapshotRequest; + return proto.immudb.schema.UseSnapshotRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.immudb.schema.VerifiableZAddRequest} msg The message object to deserialize into. + * @param {!proto.immudb.schema.UseSnapshotRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.immudb.schema.VerifiableZAddRequest} + * @return {!proto.immudb.schema.UseSnapshotRequest} */ -proto.immudb.schema.VerifiableZAddRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.immudb.schema.UseSnapshotRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -11423,13 +14883,12 @@ proto.immudb.schema.VerifiableZAddRequest.deserializeBinaryFromReader = function var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.immudb.schema.ZAddRequest; - reader.readMessage(value,proto.immudb.schema.ZAddRequest.deserializeBinaryFromReader); - msg.setZaddrequest(value); + var value = /** @type {number} */ (reader.readUint64()); + msg.setSincetx(value); break; case 2: var value = /** @type {number} */ (reader.readUint64()); - msg.setProvesincetx(value); + msg.setAsbeforetx(value); break; default: reader.skipField(); @@ -11444,9 +14903,9 @@ proto.immudb.schema.VerifiableZAddRequest.deserializeBinaryFromReader = function * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.immudb.schema.VerifiableZAddRequest.prototype.serializeBinary = function() { +proto.immudb.schema.UseSnapshotRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.immudb.schema.VerifiableZAddRequest.serializeBinaryToWriter(this, writer); + proto.immudb.schema.UseSnapshotRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -11454,21 +14913,20 @@ proto.immudb.schema.VerifiableZAddRequest.prototype.serializeBinary = function() /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.immudb.schema.VerifiableZAddRequest} message + * @param {!proto.immudb.schema.UseSnapshotRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.VerifiableZAddRequest.serializeBinaryToWriter = function(message, writer) { +proto.immudb.schema.UseSnapshotRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getZaddrequest(); - if (f != null) { - writer.writeMessage( + f = message.getSincetx(); + if (f !== 0) { + writer.writeUint64( 1, - f, - proto.immudb.schema.ZAddRequest.serializeBinaryToWriter + f ); } - f = message.getProvesincetx(); + f = message.getAsbeforetx(); if (f !== 0) { writer.writeUint64( 2, @@ -11479,61 +14937,49 @@ proto.immudb.schema.VerifiableZAddRequest.serializeBinaryToWriter = function(mes /** - * optional ZAddRequest zAddRequest = 1; - * @return {?proto.immudb.schema.ZAddRequest} - */ -proto.immudb.schema.VerifiableZAddRequest.prototype.getZaddrequest = function() { - return /** @type{?proto.immudb.schema.ZAddRequest} */ ( - jspb.Message.getWrapperField(this, proto.immudb.schema.ZAddRequest, 1)); -}; - - -/** - * @param {?proto.immudb.schema.ZAddRequest|undefined} value - * @return {!proto.immudb.schema.VerifiableZAddRequest} returns this -*/ -proto.immudb.schema.VerifiableZAddRequest.prototype.setZaddrequest = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.immudb.schema.VerifiableZAddRequest} returns this + * optional uint64 sinceTx = 1; + * @return {number} */ -proto.immudb.schema.VerifiableZAddRequest.prototype.clearZaddrequest = function() { - return this.setZaddrequest(undefined); +proto.immudb.schema.UseSnapshotRequest.prototype.getSincetx = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** - * Returns whether this field is set. - * @return {boolean} + * @param {number} value + * @return {!proto.immudb.schema.UseSnapshotRequest} returns this */ -proto.immudb.schema.VerifiableZAddRequest.prototype.hasZaddrequest = function() { - return jspb.Message.getField(this, 1) != null; +proto.immudb.schema.UseSnapshotRequest.prototype.setSincetx = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); }; /** - * optional uint64 proveSinceTx = 2; + * optional uint64 asBeforeTx = 2; * @return {number} */ -proto.immudb.schema.VerifiableZAddRequest.prototype.getProvesincetx = function() { +proto.immudb.schema.UseSnapshotRequest.prototype.getAsbeforetx = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value - * @return {!proto.immudb.schema.VerifiableZAddRequest} returns this + * @return {!proto.immudb.schema.UseSnapshotRequest} returns this */ -proto.immudb.schema.VerifiableZAddRequest.prototype.setProvesincetx = function(value) { +proto.immudb.schema.UseSnapshotRequest.prototype.setAsbeforetx = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.immudb.schema.SQLExecRequest.repeatedFields_ = [2]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -11549,8 +14995,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.immudb.schema.TxRequest.prototype.toObject = function(opt_includeInstance) { - return proto.immudb.schema.TxRequest.toObject(opt_includeInstance, this); +proto.immudb.schema.SQLExecRequest.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.SQLExecRequest.toObject(opt_includeInstance, this); }; @@ -11559,13 +15005,16 @@ proto.immudb.schema.TxRequest.prototype.toObject = function(opt_includeInstance) * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.immudb.schema.TxRequest} msg The msg instance to transform. + * @param {!proto.immudb.schema.SQLExecRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.TxRequest.toObject = function(includeInstance, msg) { +proto.immudb.schema.SQLExecRequest.toObject = function(includeInstance, msg) { var f, obj = { - tx: jspb.Message.getFieldWithDefault(msg, 1, 0) + sql: jspb.Message.getFieldWithDefault(msg, 1, ""), + paramsList: jspb.Message.toObjectList(msg.getParamsList(), + proto.immudb.schema.NamedParam.toObject, includeInstance), + nowait: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) }; if (includeInstance) { @@ -11579,23 +15028,23 @@ proto.immudb.schema.TxRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.immudb.schema.TxRequest} + * @return {!proto.immudb.schema.SQLExecRequest} */ -proto.immudb.schema.TxRequest.deserializeBinary = function(bytes) { +proto.immudb.schema.SQLExecRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.immudb.schema.TxRequest; - return proto.immudb.schema.TxRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.immudb.schema.SQLExecRequest; + return proto.immudb.schema.SQLExecRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.immudb.schema.TxRequest} msg The message object to deserialize into. + * @param {!proto.immudb.schema.SQLExecRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.immudb.schema.TxRequest} + * @return {!proto.immudb.schema.SQLExecRequest} */ -proto.immudb.schema.TxRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.immudb.schema.SQLExecRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -11603,8 +15052,17 @@ proto.immudb.schema.TxRequest.deserializeBinaryFromReader = function(msg, reader var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setTx(value); + var value = /** @type {string} */ (reader.readString()); + msg.setSql(value); + break; + case 2: + var value = new proto.immudb.schema.NamedParam; + reader.readMessage(value,proto.immudb.schema.NamedParam.deserializeBinaryFromReader); + msg.addParams(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setNowait(value); break; default: reader.skipField(); @@ -11619,9 +15077,9 @@ proto.immudb.schema.TxRequest.deserializeBinaryFromReader = function(msg, reader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.immudb.schema.TxRequest.prototype.serializeBinary = function() { +proto.immudb.schema.SQLExecRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.immudb.schema.TxRequest.serializeBinaryToWriter(this, writer); + proto.immudb.schema.SQLExecRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -11629,41 +15087,119 @@ proto.immudb.schema.TxRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.immudb.schema.TxRequest} message + * @param {!proto.immudb.schema.SQLExecRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.TxRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTx(); - if (f !== 0) { - writer.writeUint64( - 1, - f - ); - } +proto.immudb.schema.SQLExecRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSql(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getParamsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.immudb.schema.NamedParam.serializeBinaryToWriter + ); + } + f = message.getNowait(); + if (f) { + writer.writeBool( + 3, + f + ); + } +}; + + +/** + * optional string sql = 1; + * @return {string} + */ +proto.immudb.schema.SQLExecRequest.prototype.getSql = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.immudb.schema.SQLExecRequest} returns this + */ +proto.immudb.schema.SQLExecRequest.prototype.setSql = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * repeated NamedParam params = 2; + * @return {!Array} + */ +proto.immudb.schema.SQLExecRequest.prototype.getParamsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.immudb.schema.NamedParam, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.immudb.schema.SQLExecRequest} returns this +*/ +proto.immudb.schema.SQLExecRequest.prototype.setParamsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.immudb.schema.NamedParam=} opt_value + * @param {number=} opt_index + * @return {!proto.immudb.schema.NamedParam} + */ +proto.immudb.schema.SQLExecRequest.prototype.addParams = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.immudb.schema.NamedParam, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.immudb.schema.SQLExecRequest} returns this + */ +proto.immudb.schema.SQLExecRequest.prototype.clearParamsList = function() { + return this.setParamsList([]); }; /** - * optional uint64 tx = 1; - * @return {number} + * optional bool noWait = 3; + * @return {boolean} */ -proto.immudb.schema.TxRequest.prototype.getTx = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +proto.immudb.schema.SQLExecRequest.prototype.getNowait = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); }; /** - * @param {number} value - * @return {!proto.immudb.schema.TxRequest} returns this + * @param {boolean} value + * @return {!proto.immudb.schema.SQLExecRequest} returns this */ -proto.immudb.schema.TxRequest.prototype.setTx = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); +proto.immudb.schema.SQLExecRequest.prototype.setNowait = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, value); }; +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.immudb.schema.SQLQueryRequest.repeatedFields_ = [2]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -11679,8 +15215,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.immudb.schema.VerifiableTxRequest.prototype.toObject = function(opt_includeInstance) { - return proto.immudb.schema.VerifiableTxRequest.toObject(opt_includeInstance, this); +proto.immudb.schema.SQLQueryRequest.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.SQLQueryRequest.toObject(opt_includeInstance, this); }; @@ -11689,14 +15225,16 @@ proto.immudb.schema.VerifiableTxRequest.prototype.toObject = function(opt_includ * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.immudb.schema.VerifiableTxRequest} msg The msg instance to transform. + * @param {!proto.immudb.schema.SQLQueryRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.VerifiableTxRequest.toObject = function(includeInstance, msg) { +proto.immudb.schema.SQLQueryRequest.toObject = function(includeInstance, msg) { var f, obj = { - tx: jspb.Message.getFieldWithDefault(msg, 1, 0), - provesincetx: jspb.Message.getFieldWithDefault(msg, 2, 0) + sql: jspb.Message.getFieldWithDefault(msg, 1, ""), + paramsList: jspb.Message.toObjectList(msg.getParamsList(), + proto.immudb.schema.NamedParam.toObject, includeInstance), + reusesnapshot: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) }; if (includeInstance) { @@ -11710,23 +15248,23 @@ proto.immudb.schema.VerifiableTxRequest.toObject = function(includeInstance, msg /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.immudb.schema.VerifiableTxRequest} + * @return {!proto.immudb.schema.SQLQueryRequest} */ -proto.immudb.schema.VerifiableTxRequest.deserializeBinary = function(bytes) { +proto.immudb.schema.SQLQueryRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.immudb.schema.VerifiableTxRequest; - return proto.immudb.schema.VerifiableTxRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.immudb.schema.SQLQueryRequest; + return proto.immudb.schema.SQLQueryRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.immudb.schema.VerifiableTxRequest} msg The message object to deserialize into. + * @param {!proto.immudb.schema.SQLQueryRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.immudb.schema.VerifiableTxRequest} + * @return {!proto.immudb.schema.SQLQueryRequest} */ -proto.immudb.schema.VerifiableTxRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.immudb.schema.SQLQueryRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -11734,12 +15272,17 @@ proto.immudb.schema.VerifiableTxRequest.deserializeBinaryFromReader = function(m var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setTx(value); + var value = /** @type {string} */ (reader.readString()); + msg.setSql(value); break; case 2: - var value = /** @type {number} */ (reader.readUint64()); - msg.setProvesincetx(value); + var value = new proto.immudb.schema.NamedParam; + reader.readMessage(value,proto.immudb.schema.NamedParam.deserializeBinaryFromReader); + msg.addParams(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setReusesnapshot(value); break; default: reader.skipField(); @@ -11754,9 +15297,9 @@ proto.immudb.schema.VerifiableTxRequest.deserializeBinaryFromReader = function(m * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.immudb.schema.VerifiableTxRequest.prototype.serializeBinary = function() { +proto.immudb.schema.SQLQueryRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.immudb.schema.VerifiableTxRequest.serializeBinaryToWriter(this, writer); + proto.immudb.schema.SQLQueryRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -11764,23 +15307,31 @@ proto.immudb.schema.VerifiableTxRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.immudb.schema.VerifiableTxRequest} message + * @param {!proto.immudb.schema.SQLQueryRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.VerifiableTxRequest.serializeBinaryToWriter = function(message, writer) { +proto.immudb.schema.SQLQueryRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getTx(); - if (f !== 0) { - writer.writeUint64( + f = message.getSql(); + if (f.length > 0) { + writer.writeString( 1, f ); } - f = message.getProvesincetx(); - if (f !== 0) { - writer.writeUint64( + f = message.getParamsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( 2, + f, + proto.immudb.schema.NamedParam.serializeBinaryToWriter + ); + } + f = message.getReusesnapshot(); + if (f) { + writer.writeBool( + 3, f ); } @@ -11788,38 +15339,76 @@ proto.immudb.schema.VerifiableTxRequest.serializeBinaryToWriter = function(messa /** - * optional uint64 tx = 1; - * @return {number} + * optional string sql = 1; + * @return {string} */ -proto.immudb.schema.VerifiableTxRequest.prototype.getTx = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +proto.immudb.schema.SQLQueryRequest.prototype.getSql = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {number} value - * @return {!proto.immudb.schema.VerifiableTxRequest} returns this + * @param {string} value + * @return {!proto.immudb.schema.SQLQueryRequest} returns this */ -proto.immudb.schema.VerifiableTxRequest.prototype.setTx = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); +proto.immudb.schema.SQLQueryRequest.prototype.setSql = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); }; /** - * optional uint64 proveSinceTx = 2; - * @return {number} + * repeated NamedParam params = 2; + * @return {!Array} */ -proto.immudb.schema.VerifiableTxRequest.prototype.getProvesincetx = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +proto.immudb.schema.SQLQueryRequest.prototype.getParamsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.immudb.schema.NamedParam, 2)); }; /** - * @param {number} value - * @return {!proto.immudb.schema.VerifiableTxRequest} returns this + * @param {!Array} value + * @return {!proto.immudb.schema.SQLQueryRequest} returns this +*/ +proto.immudb.schema.SQLQueryRequest.prototype.setParamsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.immudb.schema.NamedParam=} opt_value + * @param {number=} opt_index + * @return {!proto.immudb.schema.NamedParam} */ -proto.immudb.schema.VerifiableTxRequest.prototype.setProvesincetx = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); +proto.immudb.schema.SQLQueryRequest.prototype.addParams = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.immudb.schema.NamedParam, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.immudb.schema.SQLQueryRequest} returns this + */ +proto.immudb.schema.SQLQueryRequest.prototype.clearParamsList = function() { + return this.setParamsList([]); +}; + + +/** + * optional bool reuseSnapshot = 3; + * @return {boolean} + */ +proto.immudb.schema.SQLQueryRequest.prototype.getReusesnapshot = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.immudb.schema.SQLQueryRequest} returns this + */ +proto.immudb.schema.SQLQueryRequest.prototype.setReusesnapshot = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, value); }; @@ -11839,8 +15428,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.immudb.schema.TxScanRequest.prototype.toObject = function(opt_includeInstance) { - return proto.immudb.schema.TxScanRequest.toObject(opt_includeInstance, this); +proto.immudb.schema.NamedParam.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.NamedParam.toObject(opt_includeInstance, this); }; @@ -11849,15 +15438,14 @@ proto.immudb.schema.TxScanRequest.prototype.toObject = function(opt_includeInsta * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.immudb.schema.TxScanRequest} msg The msg instance to transform. + * @param {!proto.immudb.schema.NamedParam} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.TxScanRequest.toObject = function(includeInstance, msg) { +proto.immudb.schema.NamedParam.toObject = function(includeInstance, msg) { var f, obj = { - initialtx: jspb.Message.getFieldWithDefault(msg, 1, 0), - limit: jspb.Message.getFieldWithDefault(msg, 2, 0), - desc: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + value: (f = msg.getValue()) && proto.immudb.schema.SQLValue.toObject(includeInstance, f) }; if (includeInstance) { @@ -11871,23 +15459,23 @@ proto.immudb.schema.TxScanRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.immudb.schema.TxScanRequest} + * @return {!proto.immudb.schema.NamedParam} */ -proto.immudb.schema.TxScanRequest.deserializeBinary = function(bytes) { +proto.immudb.schema.NamedParam.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.immudb.schema.TxScanRequest; - return proto.immudb.schema.TxScanRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.immudb.schema.NamedParam; + return proto.immudb.schema.NamedParam.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.immudb.schema.TxScanRequest} msg The message object to deserialize into. + * @param {!proto.immudb.schema.NamedParam} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.immudb.schema.TxScanRequest} + * @return {!proto.immudb.schema.NamedParam} */ -proto.immudb.schema.TxScanRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.immudb.schema.NamedParam.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -11895,16 +15483,13 @@ proto.immudb.schema.TxScanRequest.deserializeBinaryFromReader = function(msg, re var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setInitialtx(value); + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); break; case 2: - var value = /** @type {number} */ (reader.readUint32()); - msg.setLimit(value); - break; - case 3: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setDesc(value); + var value = new proto.immudb.schema.SQLValue; + reader.readMessage(value,proto.immudb.schema.SQLValue.deserializeBinaryFromReader); + msg.setValue(value); break; default: reader.skipField(); @@ -11919,9 +15504,9 @@ proto.immudb.schema.TxScanRequest.deserializeBinaryFromReader = function(msg, re * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.immudb.schema.TxScanRequest.prototype.serializeBinary = function() { +proto.immudb.schema.NamedParam.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.immudb.schema.TxScanRequest.serializeBinaryToWriter(this, writer); + proto.immudb.schema.NamedParam.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -11929,87 +15514,82 @@ proto.immudb.schema.TxScanRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.immudb.schema.TxScanRequest} message + * @param {!proto.immudb.schema.NamedParam} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.TxScanRequest.serializeBinaryToWriter = function(message, writer) { +proto.immudb.schema.NamedParam.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getInitialtx(); - if (f !== 0) { - writer.writeUint64( + f = message.getName(); + if (f.length > 0) { + writer.writeString( 1, f ); } - f = message.getLimit(); - if (f !== 0) { - writer.writeUint32( + f = message.getValue(); + if (f != null) { + writer.writeMessage( 2, - f - ); - } - f = message.getDesc(); - if (f) { - writer.writeBool( - 3, - f + f, + proto.immudb.schema.SQLValue.serializeBinaryToWriter ); } }; /** - * optional uint64 initialTx = 1; - * @return {number} + * optional string name = 1; + * @return {string} */ -proto.immudb.schema.TxScanRequest.prototype.getInitialtx = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +proto.immudb.schema.NamedParam.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {number} value - * @return {!proto.immudb.schema.TxScanRequest} returns this + * @param {string} value + * @return {!proto.immudb.schema.NamedParam} returns this */ -proto.immudb.schema.TxScanRequest.prototype.setInitialtx = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); +proto.immudb.schema.NamedParam.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); }; /** - * optional uint32 limit = 2; - * @return {number} + * optional SQLValue value = 2; + * @return {?proto.immudb.schema.SQLValue} */ -proto.immudb.schema.TxScanRequest.prototype.getLimit = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +proto.immudb.schema.NamedParam.prototype.getValue = function() { + return /** @type{?proto.immudb.schema.SQLValue} */ ( + jspb.Message.getWrapperField(this, proto.immudb.schema.SQLValue, 2)); }; /** - * @param {number} value - * @return {!proto.immudb.schema.TxScanRequest} returns this - */ -proto.immudb.schema.TxScanRequest.prototype.setLimit = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); + * @param {?proto.immudb.schema.SQLValue|undefined} value + * @return {!proto.immudb.schema.NamedParam} returns this +*/ +proto.immudb.schema.NamedParam.prototype.setValue = function(value) { + return jspb.Message.setWrapperField(this, 2, value); }; /** - * optional bool desc = 3; - * @return {boolean} + * Clears the message field making it undefined. + * @return {!proto.immudb.schema.NamedParam} returns this */ -proto.immudb.schema.TxScanRequest.prototype.getDesc = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +proto.immudb.schema.NamedParam.prototype.clearValue = function() { + return this.setValue(undefined); }; /** - * @param {boolean} value - * @return {!proto.immudb.schema.TxScanRequest} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.immudb.schema.TxScanRequest.prototype.setDesc = function(value) { - return jspb.Message.setProto3BooleanField(this, 3, value); +proto.immudb.schema.NamedParam.prototype.hasValue = function() { + return jspb.Message.getField(this, 2) != null; }; @@ -12019,7 +15599,7 @@ proto.immudb.schema.TxScanRequest.prototype.setDesc = function(value) { * @private {!Array} * @const */ -proto.immudb.schema.TxList.repeatedFields_ = [1]; +proto.immudb.schema.SQLExecResult.repeatedFields_ = [1,2]; @@ -12036,8 +15616,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.immudb.schema.TxList.prototype.toObject = function(opt_includeInstance) { - return proto.immudb.schema.TxList.toObject(opt_includeInstance, this); +proto.immudb.schema.SQLExecResult.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.SQLExecResult.toObject(opt_includeInstance, this); }; @@ -12046,14 +15626,16 @@ proto.immudb.schema.TxList.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.immudb.schema.TxList} msg The msg instance to transform. + * @param {!proto.immudb.schema.SQLExecResult} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.TxList.toObject = function(includeInstance, msg) { +proto.immudb.schema.SQLExecResult.toObject = function(includeInstance, msg) { var f, obj = { - txsList: jspb.Message.toObjectList(msg.getTxsList(), - proto.immudb.schema.Tx.toObject, includeInstance) + ctxsList: jspb.Message.toObjectList(msg.getCtxsList(), + proto.immudb.schema.TxMetadata.toObject, includeInstance), + dtxsList: jspb.Message.toObjectList(msg.getDtxsList(), + proto.immudb.schema.TxMetadata.toObject, includeInstance) }; if (includeInstance) { @@ -12067,23 +15649,23 @@ proto.immudb.schema.TxList.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.immudb.schema.TxList} + * @return {!proto.immudb.schema.SQLExecResult} */ -proto.immudb.schema.TxList.deserializeBinary = function(bytes) { +proto.immudb.schema.SQLExecResult.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.immudb.schema.TxList; - return proto.immudb.schema.TxList.deserializeBinaryFromReader(msg, reader); + var msg = new proto.immudb.schema.SQLExecResult; + return proto.immudb.schema.SQLExecResult.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.immudb.schema.TxList} msg The message object to deserialize into. + * @param {!proto.immudb.schema.SQLExecResult} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.immudb.schema.TxList} + * @return {!proto.immudb.schema.SQLExecResult} */ -proto.immudb.schema.TxList.deserializeBinaryFromReader = function(msg, reader) { +proto.immudb.schema.SQLExecResult.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -12091,9 +15673,14 @@ proto.immudb.schema.TxList.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.immudb.schema.Tx; - reader.readMessage(value,proto.immudb.schema.Tx.deserializeBinaryFromReader); - msg.addTxs(value); + var value = new proto.immudb.schema.TxMetadata; + reader.readMessage(value,proto.immudb.schema.TxMetadata.deserializeBinaryFromReader); + msg.addCtxs(value); + break; + case 2: + var value = new proto.immudb.schema.TxMetadata; + reader.readMessage(value,proto.immudb.schema.TxMetadata.deserializeBinaryFromReader); + msg.addDtxs(value); break; default: reader.skipField(); @@ -12108,9 +15695,9 @@ proto.immudb.schema.TxList.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.immudb.schema.TxList.prototype.serializeBinary = function() { +proto.immudb.schema.SQLExecResult.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.immudb.schema.TxList.serializeBinaryToWriter(this, writer); + proto.immudb.schema.SQLExecResult.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -12118,62 +15705,115 @@ proto.immudb.schema.TxList.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.immudb.schema.TxList} message + * @param {!proto.immudb.schema.SQLExecResult} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.TxList.serializeBinaryToWriter = function(message, writer) { +proto.immudb.schema.SQLExecResult.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getTxsList(); + f = message.getCtxsList(); if (f.length > 0) { writer.writeRepeatedMessage( 1, f, - proto.immudb.schema.Tx.serializeBinaryToWriter + proto.immudb.schema.TxMetadata.serializeBinaryToWriter + ); + } + f = message.getDtxsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.immudb.schema.TxMetadata.serializeBinaryToWriter ); } }; /** - * repeated Tx txs = 1; - * @return {!Array} + * repeated TxMetadata ctxs = 1; + * @return {!Array} + */ +proto.immudb.schema.SQLExecResult.prototype.getCtxsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.immudb.schema.TxMetadata, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.immudb.schema.SQLExecResult} returns this +*/ +proto.immudb.schema.SQLExecResult.prototype.setCtxsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.immudb.schema.TxMetadata=} opt_value + * @param {number=} opt_index + * @return {!proto.immudb.schema.TxMetadata} + */ +proto.immudb.schema.SQLExecResult.prototype.addCtxs = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.immudb.schema.TxMetadata, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.immudb.schema.SQLExecResult} returns this + */ +proto.immudb.schema.SQLExecResult.prototype.clearCtxsList = function() { + return this.setCtxsList([]); +}; + + +/** + * repeated TxMetadata dtxs = 2; + * @return {!Array} */ -proto.immudb.schema.TxList.prototype.getTxsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.immudb.schema.Tx, 1)); +proto.immudb.schema.SQLExecResult.prototype.getDtxsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.immudb.schema.TxMetadata, 2)); }; /** - * @param {!Array} value - * @return {!proto.immudb.schema.TxList} returns this + * @param {!Array} value + * @return {!proto.immudb.schema.SQLExecResult} returns this */ -proto.immudb.schema.TxList.prototype.setTxsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); +proto.immudb.schema.SQLExecResult.prototype.setDtxsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); }; /** - * @param {!proto.immudb.schema.Tx=} opt_value + * @param {!proto.immudb.schema.TxMetadata=} opt_value * @param {number=} opt_index - * @return {!proto.immudb.schema.Tx} + * @return {!proto.immudb.schema.TxMetadata} */ -proto.immudb.schema.TxList.prototype.addTxs = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.immudb.schema.Tx, opt_index); +proto.immudb.schema.SQLExecResult.prototype.addDtxs = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.immudb.schema.TxMetadata, opt_index); }; /** * Clears the list making it empty but non-null. - * @return {!proto.immudb.schema.TxList} returns this + * @return {!proto.immudb.schema.SQLExecResult} returns this */ -proto.immudb.schema.TxList.prototype.clearTxsList = function() { - return this.setTxsList([]); +proto.immudb.schema.SQLExecResult.prototype.clearDtxsList = function() { + return this.setDtxsList([]); }; +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.immudb.schema.SQLQueryResult.repeatedFields_ = [2,1]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -12189,8 +15829,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.immudb.schema.Database.prototype.toObject = function(opt_includeInstance) { - return proto.immudb.schema.Database.toObject(opt_includeInstance, this); +proto.immudb.schema.SQLQueryResult.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.SQLQueryResult.toObject(opt_includeInstance, this); }; @@ -12199,13 +15839,16 @@ proto.immudb.schema.Database.prototype.toObject = function(opt_includeInstance) * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.immudb.schema.Database} msg The msg instance to transform. + * @param {!proto.immudb.schema.SQLQueryResult} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.Database.toObject = function(includeInstance, msg) { +proto.immudb.schema.SQLQueryResult.toObject = function(includeInstance, msg) { var f, obj = { - databasename: jspb.Message.getFieldWithDefault(msg, 1, "") + columnsList: jspb.Message.toObjectList(msg.getColumnsList(), + proto.immudb.schema.Column.toObject, includeInstance), + rowsList: jspb.Message.toObjectList(msg.getRowsList(), + proto.immudb.schema.Row.toObject, includeInstance) }; if (includeInstance) { @@ -12219,32 +15862,38 @@ proto.immudb.schema.Database.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.immudb.schema.Database} + * @return {!proto.immudb.schema.SQLQueryResult} */ -proto.immudb.schema.Database.deserializeBinary = function(bytes) { +proto.immudb.schema.SQLQueryResult.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.immudb.schema.Database; - return proto.immudb.schema.Database.deserializeBinaryFromReader(msg, reader); + var msg = new proto.immudb.schema.SQLQueryResult; + return proto.immudb.schema.SQLQueryResult.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.immudb.schema.Database} msg The message object to deserialize into. + * @param {!proto.immudb.schema.SQLQueryResult} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.immudb.schema.Database} + * @return {!proto.immudb.schema.SQLQueryResult} */ -proto.immudb.schema.Database.deserializeBinaryFromReader = function(msg, reader) { +proto.immudb.schema.SQLQueryResult.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { + case 2: + var value = new proto.immudb.schema.Column; + reader.readMessage(value,proto.immudb.schema.Column.deserializeBinaryFromReader); + msg.addColumns(value); + break; case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setDatabasename(value); + var value = new proto.immudb.schema.Row; + reader.readMessage(value,proto.immudb.schema.Row.deserializeBinaryFromReader); + msg.addRows(value); break; default: reader.skipField(); @@ -12259,9 +15908,9 @@ proto.immudb.schema.Database.deserializeBinaryFromReader = function(msg, reader) * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.immudb.schema.Database.prototype.serializeBinary = function() { +proto.immudb.schema.SQLQueryResult.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.immudb.schema.Database.serializeBinaryToWriter(this, writer); + proto.immudb.schema.SQLQueryResult.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -12269,37 +15918,104 @@ proto.immudb.schema.Database.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.immudb.schema.Database} message + * @param {!proto.immudb.schema.SQLQueryResult} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.Database.serializeBinaryToWriter = function(message, writer) { +proto.immudb.schema.SQLQueryResult.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getDatabasename(); + f = message.getColumnsList(); if (f.length > 0) { - writer.writeString( + writer.writeRepeatedMessage( + 2, + f, + proto.immudb.schema.Column.serializeBinaryToWriter + ); + } + f = message.getRowsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( 1, - f + f, + proto.immudb.schema.Row.serializeBinaryToWriter ); } }; /** - * optional string databasename = 1; - * @return {string} + * repeated Column columns = 2; + * @return {!Array} */ -proto.immudb.schema.Database.prototype.getDatabasename = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.immudb.schema.SQLQueryResult.prototype.getColumnsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.immudb.schema.Column, 2)); }; /** - * @param {string} value - * @return {!proto.immudb.schema.Database} returns this + * @param {!Array} value + * @return {!proto.immudb.schema.SQLQueryResult} returns this +*/ +proto.immudb.schema.SQLQueryResult.prototype.setColumnsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.immudb.schema.Column=} opt_value + * @param {number=} opt_index + * @return {!proto.immudb.schema.Column} */ -proto.immudb.schema.Database.prototype.setDatabasename = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); +proto.immudb.schema.SQLQueryResult.prototype.addColumns = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.immudb.schema.Column, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.immudb.schema.SQLQueryResult} returns this + */ +proto.immudb.schema.SQLQueryResult.prototype.clearColumnsList = function() { + return this.setColumnsList([]); +}; + + +/** + * repeated Row rows = 1; + * @return {!Array} + */ +proto.immudb.schema.SQLQueryResult.prototype.getRowsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.immudb.schema.Row, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.immudb.schema.SQLQueryResult} returns this +*/ +proto.immudb.schema.SQLQueryResult.prototype.setRowsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.immudb.schema.Row=} opt_value + * @param {number=} opt_index + * @return {!proto.immudb.schema.Row} + */ +proto.immudb.schema.SQLQueryResult.prototype.addRows = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.immudb.schema.Row, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.immudb.schema.SQLQueryResult} returns this + */ +proto.immudb.schema.SQLQueryResult.prototype.clearRowsList = function() { + return this.setRowsList([]); }; @@ -12319,8 +16035,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.immudb.schema.UseDatabaseReply.prototype.toObject = function(opt_includeInstance) { - return proto.immudb.schema.UseDatabaseReply.toObject(opt_includeInstance, this); +proto.immudb.schema.Column.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.Column.toObject(opt_includeInstance, this); }; @@ -12329,13 +16045,14 @@ proto.immudb.schema.UseDatabaseReply.prototype.toObject = function(opt_includeIn * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.immudb.schema.UseDatabaseReply} msg The msg instance to transform. + * @param {!proto.immudb.schema.Column} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.UseDatabaseReply.toObject = function(includeInstance, msg) { +proto.immudb.schema.Column.toObject = function(includeInstance, msg) { var f, obj = { - token: jspb.Message.getFieldWithDefault(msg, 1, "") + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + type: jspb.Message.getFieldWithDefault(msg, 2, "") }; if (includeInstance) { @@ -12349,23 +16066,23 @@ proto.immudb.schema.UseDatabaseReply.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.immudb.schema.UseDatabaseReply} + * @return {!proto.immudb.schema.Column} */ -proto.immudb.schema.UseDatabaseReply.deserializeBinary = function(bytes) { +proto.immudb.schema.Column.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.immudb.schema.UseDatabaseReply; - return proto.immudb.schema.UseDatabaseReply.deserializeBinaryFromReader(msg, reader); + var msg = new proto.immudb.schema.Column; + return proto.immudb.schema.Column.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.immudb.schema.UseDatabaseReply} msg The message object to deserialize into. + * @param {!proto.immudb.schema.Column} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.immudb.schema.UseDatabaseReply} + * @return {!proto.immudb.schema.Column} */ -proto.immudb.schema.UseDatabaseReply.deserializeBinaryFromReader = function(msg, reader) { +proto.immudb.schema.Column.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -12374,7 +16091,11 @@ proto.immudb.schema.UseDatabaseReply.deserializeBinaryFromReader = function(msg, switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setToken(value); + msg.setName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setType(value); break; default: reader.skipField(); @@ -12389,9 +16110,9 @@ proto.immudb.schema.UseDatabaseReply.deserializeBinaryFromReader = function(msg, * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.immudb.schema.UseDatabaseReply.prototype.serializeBinary = function() { +proto.immudb.schema.Column.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.immudb.schema.UseDatabaseReply.serializeBinaryToWriter(this, writer); + proto.immudb.schema.Column.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -12399,40 +16120,72 @@ proto.immudb.schema.UseDatabaseReply.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.immudb.schema.UseDatabaseReply} message + * @param {!proto.immudb.schema.Column} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.UseDatabaseReply.serializeBinaryToWriter = function(message, writer) { +proto.immudb.schema.Column.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getToken(); + f = message.getName(); if (f.length > 0) { writer.writeString( 1, f ); } + f = message.getType(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } }; /** - * optional string token = 1; + * optional string name = 1; * @return {string} */ -proto.immudb.schema.UseDatabaseReply.prototype.getToken = function() { +proto.immudb.schema.Column.prototype.getName = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.immudb.schema.UseDatabaseReply} returns this + * @return {!proto.immudb.schema.Column} returns this */ -proto.immudb.schema.UseDatabaseReply.prototype.setToken = function(value) { +proto.immudb.schema.Column.prototype.setName = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; +/** + * optional string type = 2; + * @return {string} + */ +proto.immudb.schema.Column.prototype.getType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.immudb.schema.Column} returns this + */ +proto.immudb.schema.Column.prototype.setType = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.immudb.schema.Row.repeatedFields_ = [1,2]; @@ -12449,8 +16202,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.immudb.schema.ChangePermissionRequest.prototype.toObject = function(opt_includeInstance) { - return proto.immudb.schema.ChangePermissionRequest.toObject(opt_includeInstance, this); +proto.immudb.schema.Row.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.Row.toObject(opt_includeInstance, this); }; @@ -12459,16 +16212,15 @@ proto.immudb.schema.ChangePermissionRequest.prototype.toObject = function(opt_in * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.immudb.schema.ChangePermissionRequest} msg The msg instance to transform. + * @param {!proto.immudb.schema.Row} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.ChangePermissionRequest.toObject = function(includeInstance, msg) { +proto.immudb.schema.Row.toObject = function(includeInstance, msg) { var f, obj = { - action: jspb.Message.getFieldWithDefault(msg, 1, 0), - username: jspb.Message.getFieldWithDefault(msg, 2, ""), - database: jspb.Message.getFieldWithDefault(msg, 3, ""), - permission: jspb.Message.getFieldWithDefault(msg, 4, 0) + columnsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, + valuesList: jspb.Message.toObjectList(msg.getValuesList(), + proto.immudb.schema.SQLValue.toObject, includeInstance) }; if (includeInstance) { @@ -12482,23 +16234,23 @@ proto.immudb.schema.ChangePermissionRequest.toObject = function(includeInstance, /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.immudb.schema.ChangePermissionRequest} + * @return {!proto.immudb.schema.Row} */ -proto.immudb.schema.ChangePermissionRequest.deserializeBinary = function(bytes) { +proto.immudb.schema.Row.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.immudb.schema.ChangePermissionRequest; - return proto.immudb.schema.ChangePermissionRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.immudb.schema.Row; + return proto.immudb.schema.Row.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.immudb.schema.ChangePermissionRequest} msg The message object to deserialize into. + * @param {!proto.immudb.schema.Row} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.immudb.schema.ChangePermissionRequest} + * @return {!proto.immudb.schema.Row} */ -proto.immudb.schema.ChangePermissionRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.immudb.schema.Row.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -12506,20 +16258,13 @@ proto.immudb.schema.ChangePermissionRequest.deserializeBinaryFromReader = functi var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {!proto.immudb.schema.PermissionAction} */ (reader.readEnum()); - msg.setAction(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setUsername(value); - break; - case 3: var value = /** @type {string} */ (reader.readString()); - msg.setDatabase(value); + msg.addColumns(value); break; - case 4: - var value = /** @type {number} */ (reader.readUint32()); - msg.setPermission(value); + case 2: + var value = new proto.immudb.schema.SQLValue; + reader.readMessage(value,proto.immudb.schema.SQLValue.deserializeBinaryFromReader); + msg.addValues(value); break; default: reader.skipField(); @@ -12534,9 +16279,9 @@ proto.immudb.schema.ChangePermissionRequest.deserializeBinaryFromReader = functi * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.immudb.schema.ChangePermissionRequest.prototype.serializeBinary = function() { +proto.immudb.schema.Row.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.immudb.schema.ChangePermissionRequest.serializeBinaryToWriter(this, writer); + proto.immudb.schema.Row.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -12544,118 +16289,137 @@ proto.immudb.schema.ChangePermissionRequest.prototype.serializeBinary = function /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.immudb.schema.ChangePermissionRequest} message + * @param {!proto.immudb.schema.Row} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.ChangePermissionRequest.serializeBinaryToWriter = function(message, writer) { +proto.immudb.schema.Row.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getAction(); - if (f !== 0.0) { - writer.writeEnum( + f = message.getColumnsList(); + if (f.length > 0) { + writer.writeRepeatedString( 1, f ); } - f = message.getUsername(); + f = message.getValuesList(); if (f.length > 0) { - writer.writeString( + writer.writeRepeatedMessage( 2, - f - ); - } - f = message.getDatabase(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getPermission(); - if (f !== 0) { - writer.writeUint32( - 4, - f + f, + proto.immudb.schema.SQLValue.serializeBinaryToWriter ); } }; /** - * optional PermissionAction action = 1; - * @return {!proto.immudb.schema.PermissionAction} + * repeated string columns = 1; + * @return {!Array} */ -proto.immudb.schema.ChangePermissionRequest.prototype.getAction = function() { - return /** @type {!proto.immudb.schema.PermissionAction} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +proto.immudb.schema.Row.prototype.getColumnsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); }; /** - * @param {!proto.immudb.schema.PermissionAction} value - * @return {!proto.immudb.schema.ChangePermissionRequest} returns this + * @param {!Array} value + * @return {!proto.immudb.schema.Row} returns this */ -proto.immudb.schema.ChangePermissionRequest.prototype.setAction = function(value) { - return jspb.Message.setProto3EnumField(this, 1, value); +proto.immudb.schema.Row.prototype.setColumnsList = function(value) { + return jspb.Message.setField(this, 1, value || []); }; /** - * optional string username = 2; - * @return {string} + * @param {string} value + * @param {number=} opt_index + * @return {!proto.immudb.schema.Row} returns this */ -proto.immudb.schema.ChangePermissionRequest.prototype.getUsername = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.immudb.schema.Row.prototype.addColumns = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** - * @param {string} value - * @return {!proto.immudb.schema.ChangePermissionRequest} returns this + * Clears the list making it empty but non-null. + * @return {!proto.immudb.schema.Row} returns this */ -proto.immudb.schema.ChangePermissionRequest.prototype.setUsername = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); +proto.immudb.schema.Row.prototype.clearColumnsList = function() { + return this.setColumnsList([]); }; /** - * optional string database = 3; - * @return {string} + * repeated SQLValue values = 2; + * @return {!Array} */ -proto.immudb.schema.ChangePermissionRequest.prototype.getDatabase = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +proto.immudb.schema.Row.prototype.getValuesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.immudb.schema.SQLValue, 2)); }; /** - * @param {string} value - * @return {!proto.immudb.schema.ChangePermissionRequest} returns this + * @param {!Array} value + * @return {!proto.immudb.schema.Row} returns this +*/ +proto.immudb.schema.Row.prototype.setValuesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.immudb.schema.SQLValue=} opt_value + * @param {number=} opt_index + * @return {!proto.immudb.schema.SQLValue} */ -proto.immudb.schema.ChangePermissionRequest.prototype.setDatabase = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); +proto.immudb.schema.Row.prototype.addValues = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.immudb.schema.SQLValue, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.immudb.schema.Row} returns this + */ +proto.immudb.schema.Row.prototype.clearValuesList = function() { + return this.setValuesList([]); }; + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.immudb.schema.SQLValue.oneofGroups_ = [[1,2,3,4,5]]; + /** - * optional uint32 permission = 4; - * @return {number} + * @enum {number} */ -proto.immudb.schema.ChangePermissionRequest.prototype.getPermission = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +proto.immudb.schema.SQLValue.ValueCase = { + VALUE_NOT_SET: 0, + NULL: 1, + N: 2, + S: 3, + B: 4, + BS: 5 }; - /** - * @param {number} value - * @return {!proto.immudb.schema.ChangePermissionRequest} returns this + * @return {proto.immudb.schema.SQLValue.ValueCase} */ -proto.immudb.schema.ChangePermissionRequest.prototype.setPermission = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); +proto.immudb.schema.SQLValue.prototype.getValueCase = function() { + return /** @type {proto.immudb.schema.SQLValue.ValueCase} */(jspb.Message.computeOneofCase(this, proto.immudb.schema.SQLValue.oneofGroups_[0])); }; - - if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. @@ -12669,8 +16433,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.immudb.schema.SetActiveUserRequest.prototype.toObject = function(opt_includeInstance) { - return proto.immudb.schema.SetActiveUserRequest.toObject(opt_includeInstance, this); +proto.immudb.schema.SQLValue.prototype.toObject = function(opt_includeInstance) { + return proto.immudb.schema.SQLValue.toObject(opt_includeInstance, this); }; @@ -12679,14 +16443,17 @@ proto.immudb.schema.SetActiveUserRequest.prototype.toObject = function(opt_inclu * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.immudb.schema.SetActiveUserRequest} msg The msg instance to transform. + * @param {!proto.immudb.schema.SQLValue} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.SetActiveUserRequest.toObject = function(includeInstance, msg) { +proto.immudb.schema.SQLValue.toObject = function(includeInstance, msg) { var f, obj = { - active: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), - username: jspb.Message.getFieldWithDefault(msg, 2, "") + pb_null: jspb.Message.getFieldWithDefault(msg, 1, 0), + n: jspb.Message.getFieldWithDefault(msg, 2, 0), + s: jspb.Message.getFieldWithDefault(msg, 3, ""), + b: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), + bs: msg.getBs_asB64() }; if (includeInstance) { @@ -12700,23 +16467,23 @@ proto.immudb.schema.SetActiveUserRequest.toObject = function(includeInstance, ms /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.immudb.schema.SetActiveUserRequest} + * @return {!proto.immudb.schema.SQLValue} */ -proto.immudb.schema.SetActiveUserRequest.deserializeBinary = function(bytes) { +proto.immudb.schema.SQLValue.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.immudb.schema.SetActiveUserRequest; - return proto.immudb.schema.SetActiveUserRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.immudb.schema.SQLValue; + return proto.immudb.schema.SQLValue.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.immudb.schema.SetActiveUserRequest} msg The message object to deserialize into. + * @param {!proto.immudb.schema.SQLValue} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.immudb.schema.SetActiveUserRequest} + * @return {!proto.immudb.schema.SQLValue} */ -proto.immudb.schema.SetActiveUserRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.immudb.schema.SQLValue.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -12724,12 +16491,24 @@ proto.immudb.schema.SetActiveUserRequest.deserializeBinaryFromReader = function( var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setActive(value); + var value = /** @type {!proto.google.protobuf.NullValue} */ (reader.readEnum()); + msg.setNull(value); break; case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setN(value); + break; + case 3: var value = /** @type {string} */ (reader.readString()); - msg.setUsername(value); + msg.setS(value); + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setB(value); + break; + case 5: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setBs(value); break; default: reader.skipField(); @@ -12744,9 +16523,9 @@ proto.immudb.schema.SetActiveUserRequest.deserializeBinaryFromReader = function( * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.immudb.schema.SetActiveUserRequest.prototype.serializeBinary = function() { +proto.immudb.schema.SQLValue.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.immudb.schema.SetActiveUserRequest.serializeBinaryToWriter(this, writer); + proto.immudb.schema.SQLValue.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -12754,222 +16533,251 @@ proto.immudb.schema.SetActiveUserRequest.prototype.serializeBinary = function() /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.immudb.schema.SetActiveUserRequest} message + * @param {!proto.immudb.schema.SQLValue} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.immudb.schema.SetActiveUserRequest.serializeBinaryToWriter = function(message, writer) { +proto.immudb.schema.SQLValue.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getActive(); - if (f) { - writer.writeBool( + f = /** @type {!proto.google.protobuf.NullValue} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeEnum( 1, f ); } - f = message.getUsername(); - if (f.length > 0) { - writer.writeString( + f = /** @type {number} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeUint64( 2, f ); } + f = /** @type {string} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeString( + 3, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeBool( + 4, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 5)); + if (f != null) { + writer.writeBytes( + 5, + f + ); + } }; /** - * optional bool active = 1; + * optional google.protobuf.NullValue null = 1; + * @return {!proto.google.protobuf.NullValue} + */ +proto.immudb.schema.SQLValue.prototype.getNull = function() { + return /** @type {!proto.google.protobuf.NullValue} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.google.protobuf.NullValue} value + * @return {!proto.immudb.schema.SQLValue} returns this + */ +proto.immudb.schema.SQLValue.prototype.setNull = function(value) { + return jspb.Message.setOneofField(this, 1, proto.immudb.schema.SQLValue.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.immudb.schema.SQLValue} returns this + */ +proto.immudb.schema.SQLValue.prototype.clearNull = function() { + return jspb.Message.setOneofField(this, 1, proto.immudb.schema.SQLValue.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. * @return {boolean} */ -proto.immudb.schema.SetActiveUserRequest.prototype.getActive = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); +proto.immudb.schema.SQLValue.prototype.hasNull = function() { + return jspb.Message.getField(this, 1) != null; }; /** - * @param {boolean} value - * @return {!proto.immudb.schema.SetActiveUserRequest} returns this + * optional uint64 n = 2; + * @return {number} */ -proto.immudb.schema.SetActiveUserRequest.prototype.setActive = function(value) { - return jspb.Message.setProto3BooleanField(this, 1, value); +proto.immudb.schema.SQLValue.prototype.getN = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** - * optional string username = 2; - * @return {string} + * @param {number} value + * @return {!proto.immudb.schema.SQLValue} returns this */ -proto.immudb.schema.SetActiveUserRequest.prototype.getUsername = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.immudb.schema.SQLValue.prototype.setN = function(value) { + return jspb.Message.setOneofField(this, 2, proto.immudb.schema.SQLValue.oneofGroups_[0], value); }; /** - * @param {string} value - * @return {!proto.immudb.schema.SetActiveUserRequest} returns this + * Clears the field making it undefined. + * @return {!proto.immudb.schema.SQLValue} returns this */ -proto.immudb.schema.SetActiveUserRequest.prototype.setUsername = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); +proto.immudb.schema.SQLValue.prototype.clearN = function() { + return jspb.Message.setOneofField(this, 2, proto.immudb.schema.SQLValue.oneofGroups_[0], undefined); }; +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.immudb.schema.SQLValue.prototype.hasN = function() { + return jspb.Message.getField(this, 2) != null; +}; + /** - * List of repeated fields within this message type. - * @private {!Array} - * @const + * optional string s = 3; + * @return {string} */ -proto.immudb.schema.DatabaseListResponse.repeatedFields_ = [1]; +proto.immudb.schema.SQLValue.prototype.getS = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + +/** + * @param {string} value + * @return {!proto.immudb.schema.SQLValue} returns this + */ +proto.immudb.schema.SQLValue.prototype.setS = function(value) { + return jspb.Message.setOneofField(this, 3, proto.immudb.schema.SQLValue.oneofGroups_[0], value); +}; -if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} + * Clears the field making it undefined. + * @return {!proto.immudb.schema.SQLValue} returns this */ -proto.immudb.schema.DatabaseListResponse.prototype.toObject = function(opt_includeInstance) { - return proto.immudb.schema.DatabaseListResponse.toObject(opt_includeInstance, this); +proto.immudb.schema.SQLValue.prototype.clearS = function() { + return jspb.Message.setOneofField(this, 3, proto.immudb.schema.SQLValue.oneofGroups_[0], undefined); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.immudb.schema.DatabaseListResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * Returns whether this field is set. + * @return {boolean} */ -proto.immudb.schema.DatabaseListResponse.toObject = function(includeInstance, msg) { - var f, obj = { - databasesList: jspb.Message.toObjectList(msg.getDatabasesList(), - proto.immudb.schema.Database.toObject, includeInstance) - }; +proto.immudb.schema.SQLValue.prototype.hasS = function() { + return jspb.Message.getField(this, 3) != null; +}; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; + +/** + * optional bool b = 4; + * @return {boolean} + */ +proto.immudb.schema.SQLValue.prototype.getB = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); }; -} /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.immudb.schema.DatabaseListResponse} + * @param {boolean} value + * @return {!proto.immudb.schema.SQLValue} returns this */ -proto.immudb.schema.DatabaseListResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.immudb.schema.DatabaseListResponse; - return proto.immudb.schema.DatabaseListResponse.deserializeBinaryFromReader(msg, reader); +proto.immudb.schema.SQLValue.prototype.setB = function(value) { + return jspb.Message.setOneofField(this, 4, proto.immudb.schema.SQLValue.oneofGroups_[0], value); }; /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.immudb.schema.DatabaseListResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.immudb.schema.DatabaseListResponse} + * Clears the field making it undefined. + * @return {!proto.immudb.schema.SQLValue} returns this */ -proto.immudb.schema.DatabaseListResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.immudb.schema.Database; - reader.readMessage(value,proto.immudb.schema.Database.deserializeBinaryFromReader); - msg.addDatabases(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; +proto.immudb.schema.SQLValue.prototype.clearB = function() { + return jspb.Message.setOneofField(this, 4, proto.immudb.schema.SQLValue.oneofGroups_[0], undefined); }; /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * Returns whether this field is set. + * @return {boolean} */ -proto.immudb.schema.DatabaseListResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.immudb.schema.DatabaseListResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.immudb.schema.SQLValue.prototype.hasB = function() { + return jspb.Message.getField(this, 4) != null; }; /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.immudb.schema.DatabaseListResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * optional bytes bs = 5; + * @return {!(string|Uint8Array)} */ -proto.immudb.schema.DatabaseListResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDatabasesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.immudb.schema.Database.serializeBinaryToWriter - ); - } +proto.immudb.schema.SQLValue.prototype.getBs = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 5, "")); }; /** - * repeated Database databases = 1; - * @return {!Array} + * optional bytes bs = 5; + * This is a type-conversion wrapper around `getBs()` + * @return {string} */ -proto.immudb.schema.DatabaseListResponse.prototype.getDatabasesList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.immudb.schema.Database, 1)); +proto.immudb.schema.SQLValue.prototype.getBs_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getBs())); }; /** - * @param {!Array} value - * @return {!proto.immudb.schema.DatabaseListResponse} returns this -*/ -proto.immudb.schema.DatabaseListResponse.prototype.setDatabasesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); + * optional bytes bs = 5; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getBs()` + * @return {!Uint8Array} + */ +proto.immudb.schema.SQLValue.prototype.getBs_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getBs())); }; /** - * @param {!proto.immudb.schema.Database=} opt_value - * @param {number=} opt_index - * @return {!proto.immudb.schema.Database} + * @param {!(string|Uint8Array)} value + * @return {!proto.immudb.schema.SQLValue} returns this */ -proto.immudb.schema.DatabaseListResponse.prototype.addDatabases = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.immudb.schema.Database, opt_index); +proto.immudb.schema.SQLValue.prototype.setBs = function(value) { + return jspb.Message.setOneofField(this, 5, proto.immudb.schema.SQLValue.oneofGroups_[0], value); }; /** - * Clears the list making it empty but non-null. - * @return {!proto.immudb.schema.DatabaseListResponse} returns this + * Clears the field making it undefined. + * @return {!proto.immudb.schema.SQLValue} returns this */ -proto.immudb.schema.DatabaseListResponse.prototype.clearDatabasesList = function() { - return this.setDatabasesList([]); +proto.immudb.schema.SQLValue.prototype.clearBs = function() { + return jspb.Message.setOneofField(this, 5, proto.immudb.schema.SQLValue.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.immudb.schema.SQLValue.prototype.hasBs = function() { + return jspb.Message.getField(this, 5) != null; }; diff --git a/src/state.ts b/src/state.ts index bad3943..33b7276 100644 --- a/src/state.ts +++ b/src/state.ts @@ -117,6 +117,8 @@ class State { server[databaseName] = state this.servers[serverName] = server + + this.commit(); } getInitialState(): Servers { diff --git a/tests/client.ts b/tests/tap-parallel-not-ok/client.ts similarity index 82% rename from tests/client.ts rename to tests/tap-parallel-not-ok/client.ts index 9a11c33..c9b38da 100644 --- a/tests/client.ts +++ b/tests/tap-parallel-not-ok/client.ts @@ -1,10 +1,10 @@ import tap from 'tap'; -import ImmudbClient from '../src/client'; +import ImmudbClient from '../../src/client'; -import { Config } from '../src/interfaces'; -import { USER_PERMISSION, USER_ACTION } from '../types/user'; -import Parameters from '../types/parameters'; +import { Config } from '../../src/interfaces'; +import { USER_PERMISSION, USER_ACTION } from '../../types/user'; +import Parameters from '../../types/parameters'; const { IMMUDB_HOST = '127.0.0.1', @@ -44,7 +44,7 @@ tap.test('database management', async t => { // test: use database just created const thirdRequestData: Parameters.UseDatabase = { databasename: 'db1' }; - const secondResponse = await immudbClient.useDatabase(thirdRequestData); + await immudbClient.useDatabase(thirdRequestData); // if (secondResponse) { // t.type(secondResponse.token, 'string') // } @@ -77,7 +77,7 @@ tap.test('database management', async t => { // test: check immudb health status const seventhResponse = await immudbClient.health(); if (seventhResponse) { - t.true(seventhResponse.status); + t.ok(seventhResponse.status); } else { t.fail('Failed to get health'); } @@ -123,7 +123,7 @@ tap.test('user management', async t => { } // test: list all users - const listUsersResponse = await immudbClient.listUsers(); + await immudbClient.listUsers(); // test: change user permission const changeUserPermissionRequest: Parameters.ChangePermission = { @@ -177,7 +177,7 @@ tap.test('operations', async t => { user: IMMUDB_USER, password: IMMUDB_PWD, }; - const loginResponse = await immudbClient.login( + await immudbClient.login( loginRequest ); @@ -185,33 +185,26 @@ tap.test('operations', async t => { if (listDatabasesResponse) { const { databasesList } = listDatabasesResponse - let dbExists = false - - databasesList.forEach(({ databasename }) => { - if (databasename === testDB) { - dbExists = true - } - }) + // let dbExists = false + const dbExists = databasesList.some(({ databasename }) => databasename === testDB) if (!dbExists) { // test: create database const createDatabaseRequest: Parameters.CreateDatabase = { databasename: testDB }; - const createDatabaseResponse = await immudbClient.createDatabase(createDatabaseRequest); + + await immudbClient.createDatabase(createDatabaseRequest); } } // test: use database just created const useDatabaseRequest: Parameters.UseDatabase = { databasename: testDB }; - const useDatabaseResponse = await immudbClient.useDatabase(useDatabaseRequest); + await immudbClient.useDatabase(useDatabaseRequest); // test: add new item having the specified key // and value const key = 'hello' const value = 'world' - let setRequest = { - key, - value: 'world', - }; + let setRequest = { key, value }; let setResponse = await immudbClient.set(setRequest); const id = setResponse && setResponse.id; // used in txById test @@ -221,28 +214,28 @@ tap.test('operations', async t => { // test: get item by key const getRequest = { key }; - const getResponse = await immudbClient.get(getRequest); + await immudbClient.get(getRequest); //test: set a reference to an inserted key const referenceKey = 'refHello' const setReferenceRequest = { key: referenceKey, referencedKey: key } - const setReferenceResponse = await immudbClient.setReference(setReferenceRequest) + await immudbClient.setReference(setReferenceRequest) // test: get item by reference const getRefRequest = { key: referenceKey }; - const getRefResponse = await immudbClient.get(getRefRequest); + await immudbClient.get(getRefRequest); // test: set a reference to an inserted key const setReferenceAtRequest = { key: referenceKey, referencedKey: key, attx: 0 } - const setReferenceAtResponse = await immudbClient.setReferenceAt(setReferenceAtRequest) + await immudbClient.setReferenceAt(setReferenceAtRequest) // test: safely set a reference to an inserted key const verifiedSetReferenceRequest = { key: referenceKey, referencedKey: key } - const verifiedSetReferenceResponse = await immudbClient.verifiedSetReference(verifiedSetReferenceRequest) + await immudbClient.verifiedSetReference(verifiedSetReferenceRequest) // test: safely set a reference to an inserted key const verifiedSetReferenceAtRequest = { key: referenceKey, referencedKey: key, attx: 1 } - const verifiedSetReferenceAtResponse = await immudbClient.verifiedSetReference(verifiedSetReferenceAtRequest) + await immudbClient.verifiedSetReferenceAt(verifiedSetReferenceAtRequest) // // test: count keys having the specified value // // in the database in use @@ -259,15 +252,15 @@ tap.test('operations', async t => { sincetx: rand, nowait: true }; - const seventhResponse = await immudbClient.scan(scanRequest); + await immudbClient.scan(scanRequest); // test: return an element by txId const txByIdRequest: Parameters.TxById = { tx: id as number } - const txByIdResponse = await immudbClient.txById(txByIdRequest); + await immudbClient.txById(txByIdRequest); // test: safely get an element by txId const verifiedTxByIdRequest: Parameters.VerifiedTxById = { tx: id as number } - const verifiedTxByIdResponse = await immudbClient.verifiedTxById(verifiedTxByIdRequest); + await immudbClient.verifiedTxById(verifiedTxByIdRequest); // history: fetch history for the item having the // specified key @@ -278,7 +271,7 @@ tap.test('operations', async t => { // desc: false, // sincetx: rand }; - const historyResponse = await immudbClient.history(historyRequest); + await immudbClient.history(historyRequest); // test: iterate over a sorted set const zScanRequest = { @@ -292,14 +285,14 @@ tap.test('operations', async t => { sincetx: 0, nowait: true }; - const tenthResponse = await immudbClient.zScan(zScanRequest); + await immudbClient.zScan(zScanRequest); // test: execute a getAll read const getAllRequest: Parameters.GetAll = { keysList: [key], sincetx: 1 }; - const getAllResponse = await immudbClient.getAll(getAllRequest); + await immudbClient.getAll(getAllRequest); // test: add new item having the specified key // and value @@ -357,7 +350,7 @@ tap.test('operations', async t => { key } try { - const verifiedGetResponse = await immudbClient.verifiedGet(verifiedGetRequest); + await immudbClient.verifiedGet(verifiedGetRequest); } catch(err) { t.fail(err) } @@ -368,7 +361,7 @@ tap.test('operations', async t => { attx: 0 } try { - const verifiedGetAtResponse = await immudbClient.verifiedGetAt(verifiedGetAtRequest); + await immudbClient.verifiedGetAt(verifiedGetAtRequest); } catch(err) { t.fail(err) } @@ -379,26 +372,26 @@ tap.test('operations', async t => { sincetx: 2 } try { - const verifiedGetSinceResponse = await immudbClient.verifiedGetSince(verifiedGetSinceRequest); + await immudbClient.verifiedGetSince(verifiedGetSinceRequest); } catch(err) { t.fail(err) } // test: set a secondary index on a key const zAddRequest = { set: 'test', score: 23, key } - const zAddResponse = await immudbClient.zAdd(zAddRequest) + await immudbClient.zAdd(zAddRequest) // test: set a secondary index on a key at a specific transaction const zAddAtRequest = { set: 'test', score: 23, key, attx: 0 } - const zAddAtResponse = await immudbClient.zAddAt(zAddAtRequest) + await immudbClient.zAddAt(zAddAtRequest) // test: safely set a secondary index on a key at a specific transaction const verifiedZAddRequest = { set: 'test', score: 32, key } - const verifiedZAddResponse = await immudbClient.zAdd(verifiedZAddRequest) + await immudbClient.zAdd(verifiedZAddRequest) // test: safely set a secondary index on a key at a specific transaction const verifiedZAddAtRequest = { set: 'test', score: 32, key, attx: 1 } - const verifiedZAddAtResponse = await immudbClient.zAddAt(verifiedZAddAtRequest) + await immudbClient.zAddAt(verifiedZAddAtRequest) t.end(); } catch (err) { @@ -426,7 +419,7 @@ tap.test('batches', async t => { const useDatabaseResponse = await immudbClient.useDatabase(useDatabaseRequest); // test: execute setAll - const setAllRequest: Parameters.SetAll = { kvsList: [] }; + const setAllRequest: Parameters.SetAll = { kvsList: [], nowait: true }; for (let i = 0; i < 2; i++) { const kv = { key: `test${i}`, value: `world${i}` } diff --git a/tests/tap-parallel-not-ok/state.ts b/tests/tap-parallel-not-ok/state.ts new file mode 100644 index 0000000..6451f2a --- /dev/null +++ b/tests/tap-parallel-not-ok/state.ts @@ -0,0 +1,75 @@ +import tap from 'tap'; +import { isEqual } from 'lodash'; + +import ImmudbClient from '../../src/client'; + +import { Config } from '../../src/interfaces'; +import Parameters from '../../types/parameters'; + +const { + IMMUDB_HOST = '127.0.0.1', + IMMUDB_TEST_PORT: IMMUDB_PORT = '56789', + IMMUDB_USER = 'immudb', + IMMUDB_PWD = 'immudb', +} = process.env; + +tap.test('state persistence', async t => { + const config: Config = { + host: IMMUDB_HOST, + port: IMMUDB_PORT, + autoLogin: false, + }; + const immudbClient1 = await ImmudbClient.getInstance(config); + try { + // const rand = '' + Math.floor(Math.random() + // * Math.floor(100000)) + + const testDB = 'testdb'; + + // test: login using the specified username and password + const loginRequest: Parameters.Login = { + user: IMMUDB_USER, + password: IMMUDB_PWD, + }; + await immudbClient1.login( loginRequest ); + + const listDatabasesResponse = await immudbClient1.listDatabases() + if (listDatabasesResponse) { + const { databasesList } = listDatabasesResponse + + // let dbExists = false + const dbExists = databasesList.some(({ databasename }) => databasename === testDB) + + if (!dbExists) { + // test: create database + const createDatabaseRequest: Parameters.CreateDatabase = { databasename: testDB }; + await immudbClient1.createDatabase(createDatabaseRequest); + } + } + + // test: use database just created + const useDatabaseRequest: Parameters.UseDatabase = { databasename: testDB }; + await immudbClient1.useDatabase(useDatabaseRequest); + + // test: add new item having the specified key + // and value + const key = 'hello' + const value = 'world' + let verifiedSetRequest = { key, value }; + await immudbClient1.set(verifiedSetRequest); + + const state1 = immudbClient1.state; + + const immudbClient2 = await ImmudbClient.getInstance(config); + const state2 = immudbClient2.state; + const statesEqual = isEqual(state1, state2) + + if (!statesEqual) { + t.fail('Failed to instantiate a new client with the same state') + } + + t.end(); + } catch(err) { + t.error(err) + } +}); \ No newline at end of file diff --git a/tests/tx.ts b/tests/tap-parallel-not-ok/tx.ts similarity index 95% rename from tests/tx.ts rename to tests/tap-parallel-not-ok/tx.ts index 2924226..77c855b 100644 --- a/tests/tx.ts +++ b/tests/tap-parallel-not-ok/tx.ts @@ -1,6 +1,6 @@ import tap from 'tap' -import { Tx, digestTXe } from '../src/tx' +import { Tx, digestTXe } from '../../src/tx' tap.test('tx-related functions', async t => { try { diff --git a/tests/util.ts b/tests/tap-parallel-not-ok/util.ts similarity index 96% rename from tests/util.ts rename to tests/tap-parallel-not-ok/util.ts index 028e5cd..6fc4445 100644 --- a/tests/util.ts +++ b/tests/tap-parallel-not-ok/util.ts @@ -1,6 +1,6 @@ // @ts-ignore import tap from 'tap'; -import * as util from '../src/util'; +import * as util from '../../src/util'; tap.test('utf8 encode', t => { const array = new Uint8Array([226, 130, 172]) diff --git a/tests/test.sh b/tests/test.sh index 3a095ee..1b31df4 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -42,7 +42,7 @@ if [ "$DEV" == true ]; then pushd $IMMUDB_DEV_PATH # Clean up - rm -rf test-data roots root.json + rm -rf test-data roots root.json ../root popd # Stop immudb @@ -80,7 +80,7 @@ if [ "$DEV" == false ]; then (cd .. ; ./node_modules/tap/bin/run.js) # Clean up - rm -rf test-data roots root.json + rm -rf test-data roots root.json ../root # Stop immudb npx kill-port $IMMUDB_TEST_PORT diff --git a/tsconfig.json b/tsconfig.json index d63a469..d78874c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,7 @@ "declaration": true, "outDir": "./dist", "rootDir": "./", - // "allowJs": true, + "allowJs": true, "baseUrl": "src", // "moduleResolution": "classic" },