Back to Immudb

Protocol Documentation

pkg/api/schema/docs.md

1.11.080.0 KB
Original Source

Protocol Documentation

<a name="top"></a>

Table of Contents

<a name="schema.proto"></a>

<p align="right"><a href="#top">Top</a></p>

schema.proto

<a name="immudb.schema.AHTNullableSettings"></a>

AHTNullableSettings

FieldTypeLabelDescription
syncThresholdNullableUint32Number of new leaves in the tree between synchronous flush to disk
writeBufferSizeNullableUint32Size of the in-memory write buffer

<a name="immudb.schema.AuthConfig"></a>

AuthConfig

DEPRECATED

FieldTypeLabelDescription
kinduint32

<a name="immudb.schema.ChangePasswordRequest"></a>

ChangePasswordRequest

FieldTypeLabelDescription
userbytesUsername
oldPasswordbytesOld password
newPasswordbytesNew password

<a name="immudb.schema.ChangePermissionRequest"></a>

ChangePermissionRequest

FieldTypeLabelDescription
actionPermissionActionAction to perform
usernamestringName of the user to update
databasestringName of the database
permissionuint32Permission to grant / revoke: 1 - read only, 2 - read/write, 254 - admin

<a name="immudb.schema.ChangeSQLPrivilegesRequest"></a>

ChangeSQLPrivilegesRequest

FieldTypeLabelDescription
actionPermissionActionAction to perform
usernamestringName of the user to update
databasestringName of the database
privilegesstringrepeatedSQL privileges: SELECT, CREATE, INSERT, UPDATE, DELETE, DROP, ALTER

<a name="immudb.schema.ChangeSQLPrivilegesResponse"></a>

ChangeSQLPrivilegesResponse

<a name="immudb.schema.Chunk"></a>

Chunk

FieldTypeLabelDescription
contentbytes
metadataChunk.MetadataEntryrepeated

<a name="immudb.schema.Chunk.MetadataEntry"></a>

Chunk.MetadataEntry

FieldTypeLabelDescription
keystring
valuebytes

<a name="immudb.schema.Column"></a>

Column

FieldTypeLabelDescription
namestringColumn name
typestringColumn type

<a name="immudb.schema.CommittedSQLTx"></a>

CommittedSQLTx

FieldTypeLabelDescription
headerTxHeaderTransaction header
updatedRowsuint32Number of updated rows
lastInsertedPKsCommittedSQLTx.LastInsertedPKsEntryrepeatedThe value of last inserted auto_increment primary key (mapped by table name)
firstInsertedPKsCommittedSQLTx.FirstInsertedPKsEntryrepeatedThe value of first inserted auto_increment primary key (mapped by table name)

<a name="immudb.schema.CommittedSQLTx.FirstInsertedPKsEntry"></a>

CommittedSQLTx.FirstInsertedPKsEntry

FieldTypeLabelDescription
keystring
valueSQLValue

<a name="immudb.schema.CommittedSQLTx.LastInsertedPKsEntry"></a>

CommittedSQLTx.LastInsertedPKsEntry

FieldTypeLabelDescription
keystring
valueSQLValue

<a name="immudb.schema.CreateDatabaseRequest"></a>

CreateDatabaseRequest

FieldTypeLabelDescription
namestringDatabase name
settingsDatabaseNullableSettingsDatabase settings
ifNotExistsboolIf set to true, do not fail if the database already exists

<a name="immudb.schema.CreateDatabaseResponse"></a>

CreateDatabaseResponse

FieldTypeLabelDescription
namestringDatabase name
settingsDatabaseNullableSettingsCurrent database settings
alreadyExistedboolSet to true if given database already existed

<a name="immudb.schema.CreateUserRequest"></a>

CreateUserRequest

FieldTypeLabelDescription
userbytesUsername
passwordbytesLogin password
permissionuint32Permission, 1 - read permission, 2 - read+write permission, 254 - admin
databasestringDatabase name

<a name="immudb.schema.Database"></a>

Database

FieldTypeLabelDescription
databaseNamestringName of the database

<a name="immudb.schema.DatabaseHealthResponse"></a>

DatabaseHealthResponse

FieldTypeLabelDescription
pendingRequestsuint32Number of requests currently being executed
lastRequestCompletedAtint64Timestamp at which the last request was completed

<a name="immudb.schema.DatabaseInfo"></a>

DatabaseInfo

FieldTypeLabelDescription
namestringDatabase name
settingsDatabaseNullableSettingsCurrent database settings
loadedboolIf true, this database is currently loaded into memory
diskSizeuint64database disk size
numTransactionsuint64total number of transactions
created_atuint64the time when the db was created
created_bystringthe user who created the database

<a name="immudb.schema.DatabaseListRequestV2"></a>

DatabaseListRequestV2

<a name="immudb.schema.DatabaseListResponse"></a>

DatabaseListResponse

FieldTypeLabelDescription
databasesDatabaserepeatedDatabase list

<a name="immudb.schema.DatabaseListResponseV2"></a>

DatabaseListResponseV2

FieldTypeLabelDescription
databasesDatabaseInforepeatedDatabase list with current database settings

<a name="immudb.schema.DatabaseNullableSettings"></a>

DatabaseNullableSettings

FieldTypeLabelDescription
replicationSettingsReplicationNullableSettingsReplication settings
fileSizeNullableUint32Max filesize on disk
maxKeyLenNullableUint32Maximum length of keys
maxValueLenNullableUint32Maximum length of values
maxTxEntriesNullableUint32Maximum number of entries in a single transaction
excludeCommitTimeNullableBoolIf set to true, do not include commit timestamp in transaction headers
maxConcurrencyNullableUint32Maximum number of simultaneous commits prepared for write
maxIOConcurrencyNullableUint32Maximum number of simultaneous IO writes
txLogCacheSizeNullableUint32Size of the cache for transaction logs
vLogMaxOpenedFilesNullableUint32Maximum number of simultaneous value files opened
txLogMaxOpenedFilesNullableUint32Maximum number of simultaneous transaction log files opened
commitLogMaxOpenedFilesNullableUint32Maximum number of simultaneous commit log files opened
indexSettingsIndexNullableSettingsIndex settings
writeTxHeaderVersionNullableUint32Version of transaction header to use (limits available features)
autoloadNullableBoolIf set to true, automatically load the database when starting immudb (true by default)
readTxPoolSizeNullableUint32Size of the pool of read buffers
syncFrequencyNullableMillisecondsFsync frequency during commit process
writeBufferSizeNullableUint32Size of the in-memory buffer for write operations
ahtSettingsAHTNullableSettingsSettings of Appendable Hash Tree
maxActiveTransactionsNullableUint32Maximum number of pre-committed transactions
mvccReadSetLimitNullableUint32Limit the number of read entries per transaction
vLogCacheSizeNullableUint32Size of the cache for value logs
truncationSettingsTruncationNullableSettingsTruncation settings
embeddedValuesNullableBoolIf set to true, values are stored together with the transaction header (true by default)
preallocFilesNullableBoolEnable file preallocation

<a name="immudb.schema.DatabaseSettings"></a>

DatabaseSettings

FieldTypeLabelDescription
databaseNamestringName of the database
replicaboolIf set to true, this database is replicating another database
primaryDatabasestringName of the database to replicate
primaryHoststringHostname of the immudb instance with database to replicate
primaryPortuint32Port of the immudb instance with database to replicate
primaryUsernamestringUsername of the user with read access of the database to replicate
primaryPasswordstringPassword of the user with read access of the database to replicate
fileSizeuint32Size of files stored on disk
maxKeyLenuint32Maximum length of keys
maxValueLenuint32Maximum length of values
maxTxEntriesuint32Maximum number of entries in a single transaction
excludeCommitTimeboolIf set to true, do not include commit timestamp in transaction headers

<a name="immudb.schema.DatabaseSettingsRequest"></a>

DatabaseSettingsRequest

<a name="immudb.schema.DatabaseSettingsResponse"></a>

DatabaseSettingsResponse

FieldTypeLabelDescription
databasestringDatabase name
settingsDatabaseNullableSettingsDatabase settings

<a name="immudb.schema.DebugInfo"></a>

DebugInfo

FieldTypeLabelDescription
stackstringStack trace when the error was noticed

<a name="immudb.schema.DeleteDatabaseRequest"></a>

DeleteDatabaseRequest

FieldTypeLabelDescription
databasestringDatabase name

<a name="immudb.schema.DeleteDatabaseResponse"></a>

DeleteDatabaseResponse

FieldTypeLabelDescription
databasestringDatabase name

<a name="immudb.schema.DeleteKeysRequest"></a>

DeleteKeysRequest

FieldTypeLabelDescription
keysbytesrepeatedList of keys to delete logically
sinceTxuint64If 0, wait for index to be up-to-date, If > 0, wait for at least sinceTx transaction to be indexed
noWaitboolIf set to true, do not wait for the indexer to index this operation

<a name="immudb.schema.DualProof"></a>

DualProof

DualProof contains inclusion and consistency proofs for dual Merkle-Tree + Linear proofs

FieldTypeLabelDescription
sourceTxHeaderTxHeaderHeader of the source (earlier) transaction
targetTxHeaderTxHeaderHeader of the target (latter) transaction
inclusionProofbytesrepeatedInclusion proof of the source transaction hash in the main Merkle Tree
consistencyProofbytesrepeatedConsistency proof between Merkle Trees in the source and target transactions
targetBlTxAlhbytesAccumulative hash (Alh) of the last transaction that's part of the target Merkle Tree
lastInclusionProofbytesrepeatedInclusion proof of the targetBlTxAlh in the target Merkle Tree
linearProofLinearProofLinear proof starting from targetBlTxAlh to the final state value
LinearAdvanceProofLinearAdvanceProofProof of consistency between some part of older linear chain and newer Merkle Tree

<a name="immudb.schema.DualProofV2"></a>

DualProofV2

DualProofV2 contains inclusion and consistency proofs

FieldTypeLabelDescription
sourceTxHeaderTxHeaderHeader of the source (earlier) transaction
targetTxHeaderTxHeaderHeader of the target (latter) transaction
inclusionProofbytesrepeatedInclusion proof of the source transaction hash in the main Merkle Tree
consistencyProofbytesrepeatedConsistency proof between Merkle Trees in the source and target transactions

<a name="immudb.schema.Entries"></a>

Entries

FieldTypeLabelDescription
entriesEntryrepeatedList of entries

<a name="immudb.schema.EntriesSpec"></a>

EntriesSpec

FieldTypeLabelDescription
kvEntriesSpecEntryTypeSpecSpecification for parsing KV entries
zEntriesSpecEntryTypeSpecSpecification for parsing sorted set entries
sqlEntriesSpecEntryTypeSpecSpecification for parsing SQL entries

<a name="immudb.schema.Entry"></a>

Entry

FieldTypeLabelDescription
txuint64Transaction id at which the target value was set (i.e. not the reference transaction id)
keybytesKey of the target value (i.e. not the reference entry)
valuebytesValue
referencedByReferenceIf the request was for a reference, this field will keep information about the reference entry
metadataKVMetadataMetadata of the target entry (i.e. not the reference entry)
expiredboolIf set to true, this entry has expired and the value is not retrieved
revisionuint64Key's revision, in case of GetAt it will be 0

<a name="immudb.schema.EntryCount"></a>

EntryCount

FieldTypeLabelDescription
countuint64

<a name="immudb.schema.EntryTypeSpec"></a>

EntryTypeSpec

FieldTypeLabelDescription
actionEntryTypeActionAction to perform on entries

<a name="immudb.schema.ErrorInfo"></a>

ErrorInfo

FieldTypeLabelDescription
codestringError code
causestringError Description

<a name="immudb.schema.ExecAllRequest"></a>

ExecAllRequest

FieldTypeLabelDescription
OperationsOprepeatedList of operations to perform
noWaitboolIf set to true, do not wait for indexing to process this transaction
preconditionsPreconditionrepeatedPreconditions to check

<a name="immudb.schema.Expiration"></a>

Expiration

FieldTypeLabelDescription
expiresAtint64Entry expiration time (unix timestamp in seconds)

<a name="immudb.schema.ExportTxRequest"></a>

ExportTxRequest

FieldTypeLabelDescription
txuint64Id of transaction to export
allowPreCommittedboolIf set to true, non-committed transactions can be exported
replicaStateReplicaStateUsed on synchronous replication to notify the primary about replica state
skipIntegrityCheckboolIf set to true, integrity checks are skipped when reading data

<a name="immudb.schema.FlushIndexRequest"></a>

FlushIndexRequest

FieldTypeLabelDescription
cleanupPercentagefloatPercentage of nodes file to cleanup during flush
syncedboolIf true, do a full disk sync after the flush

<a name="immudb.schema.FlushIndexResponse"></a>

FlushIndexResponse

FieldTypeLabelDescription
databasestringDatabase name

<a name="immudb.schema.HealthResponse"></a>

HealthResponse

FieldTypeLabelDescription
statusboolIf true, server considers itself to be healthy
versionstringThe version of the server instance

<a name="immudb.schema.HistoryRequest"></a>

HistoryRequest

FieldTypeLabelDescription
keybytesName of the key to query for the history
offsetuint64Specify the initial entry to be returned by excluding the initial set of entries
limitint32Maximum number of entries to return
descboolIf true, search in descending order
sinceTxuint64If > 0, do not wait for the indexer to index all entries, only require entries up to sinceTx to be indexed

<a name="immudb.schema.ImmutableState"></a>

ImmutableState

FieldTypeLabelDescription
dbstringThe db name
txIduint64Id of the most recent transaction
txHashbytesState of the most recent transaction
signatureSignatureSignature of the hash
precommittedTxIduint64Id of the most recent precommitted transaction
precommittedTxHashbytesState of the most recent precommitted transaction

<a name="immudb.schema.InclusionProof"></a>

InclusionProof

FieldTypeLabelDescription
leafint32Index of the leaf for which the proof is generated
widthint32Width of the tree at the leaf level
termsbytesrepeatedProof terms (selected hashes from the tree)

<a name="immudb.schema.IndexNullableSettings"></a>

IndexNullableSettings

FieldTypeLabelDescription
flushThresholdNullableUint32Number of new index entries between disk flushes
syncThresholdNullableUint32Number of new index entries between disk flushes with file sync
cacheSizeNullableUint32Size of the Btree node cache in bytes
maxNodeSizeNullableUint32Max size of a single Btree node in bytes
maxActiveSnapshotsNullableUint32Maximum number of active btree snapshots
renewSnapRootAfterNullableUint64Time in milliseconds between the most recent DB snapshot is automatically renewed
compactionThldNullableUint32Minimum number of updates entries in the btree to allow for full compaction
delayDuringCompactionNullableUint32Additional delay added during indexing when full compaction is in progress
nodesLogMaxOpenedFilesNullableUint32Maximum number of simultaneously opened nodes files
historyLogMaxOpenedFilesNullableUint32Maximum number of simultaneously opened node history files
commitLogMaxOpenedFilesNullableUint32Maximum number of simultaneously opened commit log files
flushBufferSizeNullableUint32Size of the in-memory flush buffer (in bytes)
cleanupPercentageNullableFloatPercentage of node files cleaned up during each flush
maxBulkSizeNullableUint32Maximum number of transactions indexed together
bulkPreparationTimeoutNullableMillisecondsMaximum time waiting for more transactions to be committed and included into the same bulk

<a name="immudb.schema.KVMetadata"></a>

KVMetadata

FieldTypeLabelDescription
deletedboolTrue if this entry denotes a logical deletion
expirationExpirationEntry expiration information
nonIndexableboolIf set to true, this entry will not be indexed and will only be accessed through GetAt calls

<a name="immudb.schema.Key"></a>

Key

FieldTypeLabelDescription
keybytes

<a name="immudb.schema.KeyListRequest"></a>

KeyListRequest

FieldTypeLabelDescription
keysbytesrepeatedList of keys to query for
sinceTxuint64If 0, wait for index to be up-to-date, If > 0, wait for at least sinceTx transaction to be indexed

<a name="immudb.schema.KeyPrefix"></a>

KeyPrefix

FieldTypeLabelDescription
prefixbytes

<a name="immudb.schema.KeyRequest"></a>

KeyRequest

FieldTypeLabelDescription
keybytesKey to query for
atTxuint64If > 0, query for the value exactly at given transaction
sinceTxuint64If 0 (and noWait=false), wait for the index to be up-to-date, If > 0 (and noWait=false), wait for at lest the sinceTx transaction to be indexed
noWaitboolIf set to true - do not wait for any indexing update considering only the currently indexed state
atRevisionint64If > 0, get the nth version of the value, 1 being the first version, 2 being the second and so on If < 0, get the historical nth value of the key, -1 being the previous version, -2 being the one before and so on

<a name="immudb.schema.KeyValue"></a>

KeyValue

FieldTypeLabelDescription
keybytes
valuebytes
metadataKVMetadata

<a name="immudb.schema.LinearAdvanceProof"></a>

LinearAdvanceProof

LinearAdvanceProof contains the proof of consistency between the consumed part of the older linear chain and the new Merkle Tree

FieldTypeLabelDescription
linearProofTermsbytesrepeatedterms for the linear chain
inclusionProofsInclusionProofrepeatedinclusion proofs for steps on the linear chain

<a name="immudb.schema.LinearProof"></a>

LinearProof

LinearProof contains the linear part of the proof (outside the main Merkle Tree)

FieldTypeLabelDescription
sourceTxIduint64Starting transaction of the proof
TargetTxIduint64End transaction of the proof
termsbytesrepeatedList of terms (inner hashes of transaction entries)

<a name="immudb.schema.LoadDatabaseRequest"></a>

LoadDatabaseRequest

Database name

FieldTypeLabelDescription
databasestringmay add createIfNotExist

<a name="immudb.schema.LoadDatabaseResponse"></a>

LoadDatabaseResponse

FieldTypeLabelDescription
databasestringDatabase name

may add settings |

<a name="immudb.schema.LoginRequest"></a>

LoginRequest

FieldTypeLabelDescription
userbytesUsername
passwordbytesUser's password

<a name="immudb.schema.LoginResponse"></a>

LoginResponse

FieldTypeLabelDescription
tokenstringDeprecated: use session-based authentication
warningbytesOptional: additional warning message sent to the user (e.g. request to change the password)

<a name="immudb.schema.MTLSConfig"></a>

MTLSConfig

DEPRECATED

FieldTypeLabelDescription
enabledbool

<a name="immudb.schema.NamedParam"></a>

NamedParam

FieldTypeLabelDescription
namestringParameter name
valueSQLValueParameter value

<a name="immudb.schema.NewTxRequest"></a>

NewTxRequest

FieldTypeLabelDescription
modeTxModeTransaction mode
snapshotMustIncludeTxIDNullableUint64An existing snapshot may be reused as long as it includes the specified transaction If not specified it will include up to the latest precommitted transaction
snapshotRenewalPeriodNullableMillisecondsAn existing snapshot may be reused as long as it is not older than the specified timeframe
unsafeMVCCboolIndexing may not be up to date when doing MVCC

<a name="immudb.schema.NewTxResponse"></a>

NewTxResponse

FieldTypeLabelDescription
transactionIDstringInternal transaction ID

<a name="immudb.schema.NullableBool"></a>

NullableBool

FieldTypeLabelDescription
valuebool

<a name="immudb.schema.NullableFloat"></a>

NullableFloat

FieldTypeLabelDescription
valuefloat

<a name="immudb.schema.NullableMilliseconds"></a>

NullableMilliseconds

FieldTypeLabelDescription
valueint64

<a name="immudb.schema.NullableString"></a>

NullableString

FieldTypeLabelDescription
valuestring

<a name="immudb.schema.NullableUint32"></a>

NullableUint32

FieldTypeLabelDescription
valueuint32

<a name="immudb.schema.NullableUint64"></a>

NullableUint64

FieldTypeLabelDescription
valueuint64

<a name="immudb.schema.Op"></a>

Op

FieldTypeLabelDescription
kvKeyValueModify / add simple KV value
zAddZAddRequestModify / add sorted set entry
refReferenceRequestModify / add reference

<a name="immudb.schema.OpenSessionRequest"></a>

OpenSessionRequest

FieldTypeLabelDescription
usernamebytesUsername
passwordbytesPassword
databaseNamestringDatabase name

<a name="immudb.schema.OpenSessionResponse"></a>

OpenSessionResponse

FieldTypeLabelDescription
sessionIDstringId of the new session
serverUUIDstringUUID of the server

<a name="immudb.schema.Permission"></a>

Permission

FieldTypeLabelDescription
databasestringDatabase name
permissionuint32Permission, 1 - read permission, 2 - read+write permission, 254 - admin, 255 - sysadmin

<a name="immudb.schema.Precondition"></a>

Precondition

FieldTypeLabelDescription
keyMustExistPrecondition.KeyMustExistPrecondition
keyMustNotExistPrecondition.KeyMustNotExistPrecondition
keyNotModifiedAfterTXPrecondition.KeyNotModifiedAfterTXPrecondition

<a name="immudb.schema.Precondition.KeyMustExistPrecondition"></a>

Precondition.KeyMustExistPrecondition

Only succeed if given key exists

FieldTypeLabelDescription
keybyteskey to check

<a name="immudb.schema.Precondition.KeyMustNotExistPrecondition"></a>

Precondition.KeyMustNotExistPrecondition

Only succeed if given key does not exists

FieldTypeLabelDescription
keybyteskey to check

<a name="immudb.schema.Precondition.KeyNotModifiedAfterTXPrecondition"></a>

Precondition.KeyNotModifiedAfterTXPrecondition

Only succeed if given key was not modified after given transaction

FieldTypeLabelDescription
keybyteskey to check
txIDuint64transaction id to check against

<a name="immudb.schema.Reference"></a>

Reference

FieldTypeLabelDescription
txuint64Transaction if when the reference key was set
keybytesReference key
atTxuint64At which transaction the key is bound, 0 if reference is not bound and should read the most recent reference
metadataKVMetadataMetadata of the reference entry
revisionuint64Revision of the reference entry

<a name="immudb.schema.ReferenceRequest"></a>

ReferenceRequest

FieldTypeLabelDescription
keybytesKey for the reference
referencedKeybytesKey to be referenced
atTxuint64If boundRef == true, id of transaction to bind with the reference
boundRefboolIf true, bind the reference to particular transaction, if false, use the most recent value of the key
noWaitboolIf true, do not wait for the indexer to index this write operation
preconditionsPreconditionrepeatedPreconditions to be met to perform the write

<a name="immudb.schema.ReplicaState"></a>

ReplicaState

FieldTypeLabelDescription
UUIDstring
committedTxIDuint64
committedAlhbytes
precommittedTxIDuint64
precommittedAlhbytes

<a name="immudb.schema.ReplicationNullableSettings"></a>

ReplicationNullableSettings

FieldTypeLabelDescription
replicaNullableBoolIf set to true, this database is replicating another database
primaryDatabaseNullableStringName of the database to replicate
primaryHostNullableStringHostname of the immudb instance with database to replicate
primaryPortNullableUint32Port of the immudb instance with database to replicate
primaryUsernameNullableStringUsername of the user with read access of the database to replicate
primaryPasswordNullableStringPassword of the user with read access of the database to replicate
syncReplicationNullableBoolEnable synchronous replication
syncAcksNullableUint32Number of confirmations from synchronous replicas required to commit a transaction
prefetchTxBufferSizeNullableUint32Maximum number of prefetched transactions
replicationCommitConcurrencyNullableUint32Number of concurrent replications
allowTxDiscardingNullableBoolAllow precommitted transactions to be discarded if the replica diverges from the primary
skipIntegrityCheckNullableBoolDisable integrity check when reading data during replication
waitForIndexingNullableBoolWait for indexing to be up to date during replication

<a name="immudb.schema.RetryInfo"></a>

RetryInfo

FieldTypeLabelDescription
retry_delayint32Number of milliseconds after which the request can be retried

<a name="immudb.schema.Row"></a>

Row

FieldTypeLabelDescription
columnsstringrepeatedColumn names
valuesSQLValuerepeatedColumn values

<a name="immudb.schema.SQLEntry"></a>

SQLEntry

FieldTypeLabelDescription
txuint64Id of the transaction when the row was added / modified
keybytesRaw key of the row
valuebytesRaw value of the row
metadataKVMetadataMetadata of the raw value

<a name="immudb.schema.SQLExecRequest"></a>

SQLExecRequest

FieldTypeLabelDescription
sqlstringSQL query
paramsNamedParamrepeatedNamed query parameters
noWaitboolIf true, do not wait for the indexer to index written changes

<a name="immudb.schema.SQLExecResult"></a>

SQLExecResult

FieldTypeLabelDescription
txsCommittedSQLTxrepeatedList of committed transactions as a result of the exec operation
ongoingTxboolIf true, there's an ongoing transaction after exec completes

<a name="immudb.schema.SQLGetRequest"></a>

SQLGetRequest

FieldTypeLabelDescription
tablestringTable name
pkValuesSQLValuerepeatedValues of the primary key
atTxuint64Id of the transaction at which the row was added / modified
sinceTxuint64If > 0, do not wait for the indexer to index all entries, only require entries up to sinceTx to be indexed

<a name="immudb.schema.SQLPrivilege"></a>

SQLPrivilege

FieldTypeLabelDescription
databasestringDatabase name
privilegestringPrivilege: SELECT, CREATE, INSERT, UPDATE, DELETE, DROP, ALTER

<a name="immudb.schema.SQLQueryRequest"></a>

SQLQueryRequest

FieldTypeLabelDescription
sqlstringSQL query
paramsNamedParamrepeatedNamed query parameters
reuseSnapshotboolDeprecated. If true, reuse previously opened snapshot
acceptStreamboolWheter the client accepts a streaming response

<a name="immudb.schema.SQLQueryResult"></a>

SQLQueryResult

FieldTypeLabelDescription
columnsColumnrepeatedResult columns description
rowsRowrepeatedResult rows

<a name="immudb.schema.SQLValue"></a>

SQLValue

FieldTypeLabelDescription
nullgoogle.protobuf.NullValue
nint64
sstring
bbool
bsbytes
tsint64
fdouble

<a name="immudb.schema.ScanRequest"></a>

ScanRequest

FieldTypeLabelDescription
seekKeybytesIf not empty, continue scan at (when inclusiveSeek == true) or after (when inclusiveSeek == false) that key
endKeybytesstop at (when inclusiveEnd == true) or before (when inclusiveEnd == false) that key
prefixbytessearch for entries with this prefix only
descboolIf set to true, sort items in descending order
limituint64maximum number of entries to get, if not specified, the default value is used
sinceTxuint64Controls the visibility lower bound of the scan. - If 0 (default): the server captures the latest committed transaction id at call-reception time and blocks until the indexer has processed at least that transaction before taking the snapshot. This gives "read-latest" / read-your-writes semantics without the caller needing to know the latest tx id (useful when multiple client processes write concurrently, see issue #2082). - If > 0: the server only requires transactions up to sinceTx to be indexed; transactions committed after sinceTx may still be pending and may or may not appear in the result.
noWaitboolDeprecated and currently ignored by Scan: the server always waits for the tx id resolved from sinceTx (see above) to be indexed before returning.
inclusiveSeekboolIf set to true, results will include seekKey
inclusiveEndboolIf set to true, results will include endKey if needed
offsetuint64Specify the initial entry to be returned by excluding the initial set of entries

<a name="immudb.schema.Score"></a>

Score

FieldTypeLabelDescription
scoredoubleEntry's score value

<a name="immudb.schema.ServerInfoRequest"></a>

ServerInfoRequest

ServerInfoRequest exists to provide extensibility for rpc ServerInfo.

<a name="immudb.schema.ServerInfoResponse"></a>

ServerInfoResponse

ServerInfoResponse contains information about the server instance.

FieldTypeLabelDescription
versionstringThe version of the server instance.
startedAtint64Unix timestamp (seconds) indicating when the server process has been started.
numTransactionsint64Total number of transactions across all databases.
numDatabasesint32Total number of databases present.
databasesDiskSizeint64Total disk size used by all databases.

<a name="immudb.schema.SetActiveUserRequest"></a>

SetActiveUserRequest

FieldTypeLabelDescription
activeboolIf true, the user is active
usernamestringName of the user to activate / deactivate

<a name="immudb.schema.SetRequest"></a>

SetRequest

FieldTypeLabelDescription
KVsKeyValuerepeatedList of KV entries to set
noWaitboolIf set to true, do not wait for indexer to index ne entries
preconditionsPreconditionrepeatedPreconditions to be met to perform the write

<a name="immudb.schema.Signature"></a>

Signature

FieldTypeLabelDescription
publicKeybytes
signaturebytes

<a name="immudb.schema.Table"></a>

Table

FieldTypeLabelDescription
tableNamestringTable name

<a name="immudb.schema.TruncateDatabaseRequest"></a>

TruncateDatabaseRequest

FieldTypeLabelDescription
databasestringDatabase name
retentionPeriodint64Retention Period of data

<a name="immudb.schema.TruncateDatabaseResponse"></a>

TruncateDatabaseResponse

FieldTypeLabelDescription
databasestringDatabase name

<a name="immudb.schema.TruncationNullableSettings"></a>

TruncationNullableSettings

FieldTypeLabelDescription
retentionPeriodNullableMillisecondsRetention Period for data in the database
truncationFrequencyNullableMillisecondsTruncation Frequency for the database

<a name="immudb.schema.Tx"></a>

Tx

FieldTypeLabelDescription
headerTxHeaderTransaction header
entriesTxEntryrepeatedRaw entry values
kvEntriesEntryrepeatedKV entries in the transaction (parsed)
zEntriesZEntryrepeatedSorted Set entries in the transaction (parsed)

<a name="immudb.schema.TxEntry"></a>

TxEntry

FieldTypeLabelDescription
keybytesRaw key value (contains 1-byte prefix for kind of the key)
hValuebytesValue hash
vLenint32Value length
metadataKVMetadataEntry metadata
valuebytesvalue, must be ignored when len(value) == 0 and vLen > 0. Otherwise sha256(value) must be equal to hValue.

<a name="immudb.schema.TxHeader"></a>

TxHeader

FieldTypeLabelDescription
iduint64Transaction ID
prevAlhbytesState value (Accumulative Hash - Alh) of the previous transaction
tsint64Unix timestamp of the transaction (in seconds)
nentriesint32Number of entries in a transaction
eHbytesEntries Hash - cumulative hash of all entries in the transaction
blTxIduint64Binary linking tree transaction ID (ID of last transaction already in the main Merkle Tree)
blRootbytesBinary linking tree root (Root hash of the Merkle Tree)
versionint32Header version
metadataTxMetadataTransaction metadata

<a name="immudb.schema.TxList"></a>

TxList

FieldTypeLabelDescription
txsTxrepeatedList of transactions

<a name="immudb.schema.TxMetadata"></a>

TxMetadata

TxMetadata contains metadata set to whole transaction

FieldTypeLabelDescription
truncatedTxIDuint64Entry expiration information
extrabytesExtra data

<a name="immudb.schema.TxRequest"></a>

TxRequest

FieldTypeLabelDescription
txuint64Transaction id to query for
entriesSpecEntriesSpecSpecification for parsing entries, if empty, entries are returned in raw form
sinceTxuint64If > 0, do not wait for the indexer to index all entries, only require entries up to sinceTx to be indexed, will affect resolving references
noWaitboolDeprecated: If set to true, do not wait for the indexer to be up to date
keepReferencesUnresolvedboolIf set to true, do not resolve references (avoid looking up final values if not needed)

<a name="immudb.schema.TxScanRequest"></a>

TxScanRequest

FieldTypeLabelDescription
initialTxuint64ID of the transaction where scanning should start
limituint32Maximum number of transactions to scan, when not specified the default limit is used
descboolIf set to true, scan transactions in descending order
entriesSpecEntriesSpecSpecification of how to parse entries
sinceTxuint64If > 0, do not wait for the indexer to index all entries, only require entries up to sinceTx to be indexed, will affect resolving references
noWaitboolDeprecated: If set to true, do not wait for the indexer to be up to date

<a name="immudb.schema.UnloadDatabaseRequest"></a>

UnloadDatabaseRequest

FieldTypeLabelDescription
databasestringDatabase name

<a name="immudb.schema.UnloadDatabaseResponse"></a>

UnloadDatabaseResponse

FieldTypeLabelDescription
databasestringDatabase name

<a name="immudb.schema.UpdateDatabaseRequest"></a>

UpdateDatabaseRequest

FieldTypeLabelDescription
databasestringDatabase name
settingsDatabaseNullableSettingsUpdated settings

<a name="immudb.schema.UpdateDatabaseResponse"></a>

UpdateDatabaseResponse

Reserved to reply with more advanced response later

FieldTypeLabelDescription
databasestringDatabase name
settingsDatabaseNullableSettingsCurrent database settings

<a name="immudb.schema.UseDatabaseReply"></a>

UseDatabaseReply

FieldTypeLabelDescription
tokenstringDeprecated: database access token

<a name="immudb.schema.UseSnapshotRequest"></a>

UseSnapshotRequest

FieldTypeLabelDescription
sinceTxuint64
asBeforeTxuint64

<a name="immudb.schema.User"></a>

User

FieldTypeLabelDescription
userbytesUsername
permissionsPermissionrepeatedList of permissions for the user
createdbystringName of the creator user
createdatstringTime when the user was created
activeboolFlag indicating whether the user is active or not
sqlPrivilegesSQLPrivilegerepeatedList of SQL privileges

<a name="immudb.schema.UserList"></a>

UserList

FieldTypeLabelDescription
usersUserrepeatedList of users

<a name="immudb.schema.UserRequest"></a>

UserRequest

FieldTypeLabelDescription
userbytesUsername

<a name="immudb.schema.VerifiableEntry"></a>

VerifiableEntry

FieldTypeLabelDescription
entryEntryEntry to verify
verifiableTxVerifiableTxTransaction to verify
inclusionProofInclusionProofProof for inclusion of the entry within the transaction

<a name="immudb.schema.VerifiableGetRequest"></a>

VerifiableGetRequest

FieldTypeLabelDescription
keyRequestKeyRequestKey to read
proveSinceTxuint64When generating the proof, generate consistency proof with state from this transaction

<a name="immudb.schema.VerifiableReferenceRequest"></a>

VerifiableReferenceRequest

FieldTypeLabelDescription
referenceRequestReferenceRequestReference data
proveSinceTxuint64When generating the proof, generate consistency proof with state from this transaction

<a name="immudb.schema.VerifiableSQLEntry"></a>

VerifiableSQLEntry

FieldTypeLabelDescription
sqlEntrySQLEntryRaw row entry data
verifiableTxVerifiableTxVerifiable transaction of the row
inclusionProofInclusionProofInclusion proof of the row in the transaction
DatabaseIduint32Internal ID of the database (used to validate raw entry values)
TableIduint32Internal ID of the table (used to validate raw entry values)
PKIDsuint32repeatedInternal IDs of columns for the primary key (used to validate raw entry values)
ColNamesByIdVerifiableSQLEntry.ColNamesByIdEntryrepeatedMapping of used column IDs to their names
ColIdsByNameVerifiableSQLEntry.ColIdsByNameEntryrepeatedMapping of column names to their IDS
ColTypesByIdVerifiableSQLEntry.ColTypesByIdEntryrepeatedMapping of column IDs to their types
ColLenByIdVerifiableSQLEntry.ColLenByIdEntryrepeatedMapping of column IDs to their length constraints
MaxColIduint32Variable is used to assign unique ids to new columns as they are created

<a name="immudb.schema.VerifiableSQLEntry.ColIdsByNameEntry"></a>

VerifiableSQLEntry.ColIdsByNameEntry

FieldTypeLabelDescription
keystring
valueuint32

<a name="immudb.schema.VerifiableSQLEntry.ColLenByIdEntry"></a>

VerifiableSQLEntry.ColLenByIdEntry

FieldTypeLabelDescription
keyuint32
valueint32

<a name="immudb.schema.VerifiableSQLEntry.ColNamesByIdEntry"></a>

VerifiableSQLEntry.ColNamesByIdEntry

FieldTypeLabelDescription
keyuint32
valuestring

<a name="immudb.schema.VerifiableSQLEntry.ColTypesByIdEntry"></a>

VerifiableSQLEntry.ColTypesByIdEntry

FieldTypeLabelDescription
keyuint32
valuestring

<a name="immudb.schema.VerifiableSQLGetRequest"></a>

VerifiableSQLGetRequest

FieldTypeLabelDescription
sqlGetRequestSQLGetRequestData of row to query
proveSinceTxuint64When generating the proof, generate consistency proof with state from this transaction

<a name="immudb.schema.VerifiableSetRequest"></a>

VerifiableSetRequest

FieldTypeLabelDescription
setRequestSetRequestKeys to set
proveSinceTxuint64When generating the proof, generate consistency proof with state from this transaction

<a name="immudb.schema.VerifiableTx"></a>

VerifiableTx

FieldTypeLabelDescription
txTxTransaction to verify
dualProofDualProofProof for the transaction
signatureSignatureSignature for the new state value

<a name="immudb.schema.VerifiableTxRequest"></a>

VerifiableTxRequest

FieldTypeLabelDescription
txuint64Transaction ID
proveSinceTxuint64When generating the proof, generate consistency proof with state from this transaction
entriesSpecEntriesSpecSpecification of how to parse entries
sinceTxuint64If > 0, do not wait for the indexer to index all entries, only require entries up to sinceTx to be indexed, will affect resolving references
noWaitboolDeprecated: If set to true, do not wait for the indexer to be up to date
keepReferencesUnresolvedboolIf set to true, do not resolve references (avoid looking up final values if not needed)

<a name="immudb.schema.VerifiableTxV2"></a>

VerifiableTxV2

FieldTypeLabelDescription
txTxTransaction to verify
dualProofDualProofV2Proof for the transaction
signatureSignatureSignature for the new state value

<a name="immudb.schema.VerifiableZAddRequest"></a>

VerifiableZAddRequest

FieldTypeLabelDescription
zAddRequestZAddRequestData for new sorted set entry
proveSinceTxuint64When generating the proof, generate consistency proof with state from this transaction

<a name="immudb.schema.ZAddRequest"></a>

ZAddRequest

FieldTypeLabelDescription
setbytesName of the sorted set
scoredoubleScore of the new entry
keybytesReferenced key
atTxuint64If boundRef == true, id of the transaction to bind with the reference
boundRefboolIf true, bind the reference to particular transaction, if false, use the most recent value of the key
noWaitboolIf true, do not wait for the indexer to index this write operation

<a name="immudb.schema.ZEntries"></a>

ZEntries

FieldTypeLabelDescription
entriesZEntryrepeated

<a name="immudb.schema.ZEntry"></a>

ZEntry

FieldTypeLabelDescription
setbytesName of the sorted set
keybytesReferenced key
entryEntryReferenced entry
scoredoubleSorted set element's score
atTxuint64At which transaction the key is bound, 0 if reference is not bound and should read the most recent reference

<a name="immudb.schema.ZScanRequest"></a>

ZScanRequest

FieldTypeLabelDescription
setbytesName of the sorted set
seekKeybytesKey to continue the search at
seekScoredoubleScore of the entry to continue the search at
seekAtTxuint64AtTx of the entry to continue the search at
inclusiveSeekboolIf true, include the entry given with the seekXXX attributes, if false, skip the entry and start after that one
limituint64Maximum number of entries to return, if 0, the default limit will be used
descboolIf true, scan entries in descending order
minScoreScoreMinimum score of entries to scan
maxScoreScoreMaximum score of entries to scan
sinceTxuint64If > 0, do not wait for the indexer to index all entries, only require entries up to sinceTx to be indexed
noWaitboolDeprecated: If set to true, do not wait for the indexer to be up to date
offsetuint64Specify the index of initial entry to be returned by excluding the initial set of entries (alternative to seekXXX attributes)

<a name="immudb.schema.EntryTypeAction"></a>

EntryTypeAction

NameNumberDescription
EXCLUDE0Exclude entries from the result
ONLY_DIGEST1Provide keys in raw (unparsed) form and only the digest of the value
RAW_VALUE2Provide keys and values in raw form
RESOLVE3Provide parsed keys and values and resolve values if needed

<a name="immudb.schema.PermissionAction"></a>

PermissionAction

NameNumberDescription
GRANT0Grant permission
REVOKE1Revoke permission

<a name="immudb.schema.TxMode"></a>

TxMode

NameNumberDescription
ReadOnly0Read-only transaction
WriteOnly1Write-only transaction
ReadWrite2Read-write transaction

<a name="immudb.schema.ImmuService"></a>

ImmuService

immudb gRPC & REST service

Method NameRequest TypeResponse TypeDescription
ListUsers.google.protobuf.EmptyUserList
CreateUserCreateUserRequest.google.protobuf.Empty
ChangePasswordChangePasswordRequest.google.protobuf.Empty
ChangePermissionChangePermissionRequest.google.protobuf.Empty
ChangeSQLPrivilegesChangeSQLPrivilegesRequestChangeSQLPrivilegesResponse
SetActiveUserSetActiveUserRequest.google.protobuf.Empty
UpdateAuthConfigAuthConfig.google.protobuf.Empty
UpdateMTLSConfigMTLSConfig.google.protobuf.Empty
OpenSessionOpenSessionRequestOpenSessionResponse
CloseSession.google.protobuf.Empty.google.protobuf.Empty
KeepAlive.google.protobuf.Empty.google.protobuf.Empty
NewTxNewTxRequestNewTxResponse
Commit.google.protobuf.EmptyCommittedSQLTx
Rollback.google.protobuf.Empty.google.protobuf.Empty
TxSQLExecSQLExecRequest.google.protobuf.Empty
TxSQLQuerySQLQueryRequestSQLQueryResult stream
LoginLoginRequestLoginResponse
Logout.google.protobuf.Empty.google.protobuf.Empty
SetSetRequestTxHeader
VerifiableSetVerifiableSetRequestVerifiableTx
GetKeyRequestEntry
VerifiableGetVerifiableGetRequestVerifiableEntry
DeleteDeleteKeysRequestTxHeader
GetAllKeyListRequestEntries
ExecAllExecAllRequestTxHeader
ScanScanRequestEntries
CountKeyPrefixEntryCountNOT YET SUPPORTED
CountAll.google.protobuf.EmptyEntryCountNOT YET SUPPORTED
TxByIdTxRequestTx
VerifiableTxByIdVerifiableTxRequestVerifiableTx
TxScanTxScanRequestTxList
HistoryHistoryRequestEntries
ServerInfoServerInfoRequestServerInfoResponseServerInfo returns information about the server instance. ServerInfoRequest is defined for future extensions.
Health.google.protobuf.EmptyHealthResponseDEPRECATED: Use ServerInfo
DatabaseHealth.google.protobuf.EmptyDatabaseHealthResponse
CurrentState.google.protobuf.EmptyImmutableState
SetReferenceReferenceRequestTxHeader
VerifiableSetReferenceVerifiableReferenceRequestVerifiableTx
ZAddZAddRequestTxHeader
VerifiableZAddVerifiableZAddRequestVerifiableTx
ZScanZScanRequestZEntries
CreateDatabaseDatabase.google.protobuf.EmptyDEPRECATED: Use CreateDatabaseV2
CreateDatabaseWithDatabaseSettings.google.protobuf.EmptyDEPRECATED: Use CreateDatabaseV2
CreateDatabaseV2CreateDatabaseRequestCreateDatabaseResponse
LoadDatabaseLoadDatabaseRequestLoadDatabaseResponse
UnloadDatabaseUnloadDatabaseRequestUnloadDatabaseResponse
DeleteDatabaseDeleteDatabaseRequestDeleteDatabaseResponse
DatabaseList.google.protobuf.EmptyDatabaseListResponseDEPRECATED: Use DatabaseListV2
DatabaseListV2DatabaseListRequestV2DatabaseListResponseV2
UseDatabaseDatabaseUseDatabaseReply
UpdateDatabaseDatabaseSettings.google.protobuf.EmptyDEPRECATED: Use UpdateDatabaseV2
UpdateDatabaseV2UpdateDatabaseRequestUpdateDatabaseResponse
GetDatabaseSettings.google.protobuf.EmptyDatabaseSettingsDEPRECATED: Use GetDatabaseSettingsV2
GetDatabaseSettingsV2DatabaseSettingsRequestDatabaseSettingsResponse
FlushIndexFlushIndexRequestFlushIndexResponse
CompactIndex.google.protobuf.Empty.google.protobuf.Empty
streamGetKeyRequestChunk streamStreams
streamSetChunk streamTxHeader
streamVerifiableGetVerifiableGetRequestChunk stream
streamVerifiableSetChunk streamVerifiableTx
streamScanScanRequestChunk stream
streamZScanZScanRequestChunk stream
streamHistoryHistoryRequestChunk stream
streamExecAllChunk streamTxHeader
exportTxExportTxRequestChunk streamReplication
replicateTxChunk streamTxHeader
streamExportTxExportTxRequest streamChunk stream
SQLExecSQLExecRequestSQLExecResult
UnarySQLQuerySQLQueryRequestSQLQueryResultFor backward compatibility with the grpc-gateway API
SQLQuerySQLQueryRequestSQLQueryResult stream
ListTables.google.protobuf.EmptySQLQueryResult
DescribeTableTableSQLQueryResult
VerifiableSQLGetVerifiableSQLGetRequestVerifiableSQLEntry
TruncateDatabaseTruncateDatabaseRequestTruncateDatabaseResponse

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
<a name="double" /> doubledoubledoublefloatfloat64doublefloatFloat
<a name="float" /> floatfloatfloatfloatfloat32floatfloatFloat
<a name="int32" /> int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
<a name="int64" /> int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
<a name="uint32" /> uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
<a name="uint64" /> uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
<a name="sint32" /> sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
<a name="sint64" /> sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
<a name="fixed32" /> fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
<a name="fixed64" /> fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
<a name="sfixed32" /> sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
<a name="sfixed64" /> sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
<a name="bool" /> boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
<a name="string" /> stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
<a name="bytes" /> bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)