The Prism Protocol

The definition files for the Polypheny Prism API, a multi-model, multi-language query interface.

The Prism Interface uses Protocol Buffer (protobuf) messages to define it’s services. To keep things clear and well-organized, the message definitions are grouped into several files. This simplifies finding specific messages, based on what they do or what part of the system they relate to. The files itself are grouped in categories. Those are expressed in the file names. Two kinds of categories exist:

Request Response Category

The category type contains messages that are used in communication adhering to a request, response scheme. Here the client sends a request message to the server upon which the server sends back a response message.

  • Requests File: This file contains all messages that are sent from the client to the server. The file name adheres to the following pattern: [category]_requests.proto. For example, all the request messages for making or managing connections would be in connection_requests.proto.

  • Responses File: This is the partner file to Requests. It contains all the messages the server sends back to the client. Following the naming pattern, these files end with _responses.proto. The response messages related to connections would thus be in connection_responses.proto.

Other Category

The other kind of category contains messages that are not directly used as a response to a request. An example therefore would be messages representing a specific datatype supported by the DBMS. This category always contains only one file. The filename adheres to the pattern [category].proto.

Doc Generator

Detailed Documentation of the proto files their messages and enums and much more can automatically be created using the doc generator included in this repo. For this to work, the protobuf compiler must be installed. It’s current version can be downloaded here.

To run the doc generator, execute the file generator.py in the doc-generator directory.

This creates a directory called docs containing the generated documentation.

Generate Python files

Generate the Python code:

python -m grpc_tools.protoc -I . --python_out . org/polypheny/prism/*.proto

Remote Procedure Calls

dbms_version_request

default_namespace_request

table_types_request

types_request

procedures_request

functions_request

namespaces_request

entities_request

sql_string_functions_request

sql_system_functions_request

sql_time_date_functions_request

sql_numeric_functions_request

sql_keywords_request

connection_request

connection_check_request

disconnect_request

client_info_properties_request

set_client_info_properties_request

close_statement_request

commit_request

rollback_request

connection_properties_update_request

close_result_request

error_response

statement_response

statement_batch_response

statement_result

prepared_statement_signature

frame

  • Response message: Frame frame

execute_unparameterized_statement_request

execute_unparameterized_statement_batch_request

prepare_indexed_statement_request

execute_indexed_statement_request

execute_indexed_statement_batch_request

prepare_named_statement_request

execute_named_statement_request

fetch_request

Message Categories

Below the available categories of messages and the explicit names of their .proto files are listed below.

namespace_meta_requests

Messages related to describing the metadata of namespaces and their entities.

transaction_requests

Messages concerning the handling of transactions.

namespace_meta_responses

Messages related to describing the metadata of namespaces and their entities.

meta_responses

Messages that are used for querying general metadata.

protointerface

This file contains basic wrapper messages used for the communication between client and server. Examples for such messages are a response and a request wrapper that are used to wrap a specific response or request message. Further messages for error responses are included.

meta_requests

Messages that are used for querying general metadata.

connection_requests

Messages related to establishing and maintaining a connection.

statement_responses

Messages related to statements in a query language and their results.

error

Messages used to send errors to the client.

relational_frame

Messages related to relational frames as used to represent the results form the relational model.

document_frame

Messages pertaining to document frames as used to represent results from the document model.

graph_frame

Messages related to graph frames as used to represent results form the labeled property graph model.

statement_requests

Messages related to statements in a query language and their results.

transaction_responses

Messages concerning the handling of transactions.

value

ProtoValue represents a single value supported by the DBMS. It contains a wide range of fields each corresponding to one supported data type. Only one field can be set at a time.

connection_responses

Messages related to establishing and maintaining a connection.

Protocol Messages

This section provides a comprehensive breakdown of protocol messages used in the communication between clients and the server. The messages are categorized by the files containing them. Starting from connection-related messages and extending to transaction handling and beyond, the documentation delves into the purpose, structure, and usage of each message.

org/polypheny/prism/namespace_meta_requests.proto

NamespacesRequest

The NamespacesRequest message allows querying for namespaces based on specific patterns in their names as well as their types.

  • optional string namespace_pattern: An optional pattern that can be used to filter the returned namespaces based on their names. For example, using a pattern like “user_*” might return all namespaces starting with “user_”.
  • optional string namespace_type: An optional type specifier that can be used to filter namespaces based on their type. This allows clients to request namespaces of a particular type.

EntitiesRequest

The EntitiesRequest message is meant for querying details about entities within a specific namespace, possibly using a pattern to narrow down the results.

  • string namespace_name: The name of the namespace within which entities are to be searched.
  • optional string entity_pattern: An optional pattern for filtering the returned entities. This can help in narrowing down the list of entities based on a naming pattern or other criteria.

org/polypheny/prism/transaction_requests.proto

CommitRequest

Represents a request to commit a transaction. This message is used to signal the system to finalize all changes made during the transaction, making them permanent and visible to other transactions.

RollbackRequest

Represents a request to rollback a transaction. This message is used to signal the system to undo all changes made during the transaction, returning the state of the database to what it was before the transaction began.

org/polypheny/prism/namespace_meta_responses.proto

NamespacesResponse

The NamespacesResponse message delivers a list of namespaces based on the provided criteria in the NamespacesRequest.

  • repeated Namespace namespaces: A list of Namespace messages containing information about each namespace that matches the search criteria.

EntitiesResponse

The EntitiesResponse message returns a list of entities that match the provided criteria from the EntitiesRequest.

  • repeated Entity entities: A list of Entity messages containing information about each entity within the requested namespace.

Namespace

The Namespace message provides detailed information about a specific namespace.

  • string namespace_name: The name of the namespace.
  • bool is_case_sensitive: Indicates if the namespace name is case sensitive.
  • optional string namespace_type: An optional field providing the type of the namespace, if applicable.

Entity

The Entity message acts as a generic wrapper for different of entities metadata messages. Only one of the entities metadata fields can be set for a given message instance. Different entity metadata messages are used to represent the metadata of different entity types. The available entity metadata messages are, Table for relational entities, Graph for labeled property graph entities and Document for entities in the document model.

  • Table table: An entity of type Table.
  • Graph graph: An entity of type Graph.
  • Document document: An entity of type Document.

Table

The Table message provides comprehensive information about a specific table within a database.

  • string namespace_name: The namespace or schema where the table is located.
  • string table_name: The name of the table.
  • string table_type: The type of the table (e.g., BASE TABLE, VIEW).
  • repeated Column columns: A list of Column messages providing information about each column in the table.
  • optional PrimaryKey primary_key: An optional PrimaryKey message, providing details about the primary key of the table.
  • repeated ForeignKey foreign_keys: A list of ForeignKey messages detailing the foreign keys associated with the table.
  • repeated ForeignKey exported_keys: A list of ForeignKey messages detailing the keys in other tables that reference this table.
  • repeated Index indexes: A list of Index messages detailing the indexes defined on the table.

Column

The Column message describes the attributes of a specific column within a table.

  • string namespace_name: The namespace or schema of the column’s table.
  • string table_name: The table to which this column belongs.
  • string column_name: The name of the column.
  • string type_name: The data type of the column.
  • optional int32 type_length: The length or size of the column type, if applicable.
  • optional int32 type_scale: The scale of the column type, if applicable.
  • bool is_nullable: Indicates if the column can contain null values.
  • optional string default_value_as_string: The default value of the column, represented as a string.
  • int32 column_index: The positional index of the column in the table.
  • optional string collation: The collation name for the column, if applicable.
  • bool is_hidden: Indicates if the column is hidden.
  • ColumnType column_type: An enumeration indicating the type of column (e.g., REGULAR, CALCULATED, VERSION).

PrimaryKey

The PrimaryKey message provides details about a table’s primary key.

  • string database_name: The database where the primary key’s table is located.
  • string namespace_name: The namespace or schema of the primary key’s table.
  • string table_name: The table with this primary key.
  • repeated Column columns: The columns that make up the primary key.

ForeignKey

The ForeignKey message details a foreign key relationship between tables, providing information about the linkage between a table’s column(s) and the column(s) of another table it references. This relationship is crucial for maintaining referential integrity within the database.

  • optional string referenced_namespace_name: The namespace or schema of the referenced table. This indicates the specific namespace or schema within the database where the referenced table resides.
  • string referenced_table_name: The table being referenced by the foreign key. This field identifies the target table that contains the referenced columns.
  • repeated Column referenced_columns: The columns in the referenced table. These are the columns in the referenced table that the foreign key points to.
  • repeated Column foreign_columns: The columns in the current table that make up the foreign key. These columns in the table contain the foreign key constraint reference the corresponding columns in the referenced table.
  • int32 update_rule: A numeric representation of the action taken when a referenced row is updated. This rule determines how changes to the referenced columns affect the rows that hold the foreign key.
  • int32 delete_rule: A numeric representation of the action taken when a referenced row is deleted. Similar to the update rule, this defines the behavior of the foreign key relationship when rows in the referenced table are deleted.
  • optional string key_name: An optional name for the foreign key constraint. This allows for the naming of the foreign key constraint for easier reference and management within the database.

Index

The Index message provides details about an index defined on a table. Indexes are crucial for improving the performance of data retrieval operations by effectively organizing the data stored in a database table. This message includes information about the index’s database, namespace (or schema), table, uniqueness, name, columns involved, physical location, and type.

  • string namespace_name: The namespace or schema of the indexed table. This indicates the specific namespace or schema within the database where the indexed table resides.
  • string table_name: The table on which the index is defined. This field identifies the specific table within the namespace that the index belongs to.
  • bool unique: Indicates if the index enforces unique values. A boolean value where true means the index ensures that all values in the index are unique.
  • string index_name: The name of the index. This allows for the naming of the index for easier reference and management within the database.
  • repeated Column columns: The columns that are part of the index. This repeated field lists all the columns included in the index, defining the order and structure of the index.
  • int64 location: A numeric identifier representing the location or storage of the index. This field is used to identify where the index is physically stored within the database system, if applicable.
  • int32 index_type: A numeric representation indicating the type or mechanism of the index. This could represent different types of indexing strategies used by the database system, such as B-tree, hash, etc.

Graph

The Graph message will be used to represent the metadata of a graph entity. As of now, the structure is empty but it is expected to encapsulate various attributes and details about graph entities in the future. As of now, the Graph message is a placeholder and does not contain any fields.

Document

The Document message will be used to encapsulate the metadata related to a document entity. The structure is presently empty, but it’s expected to be expanded with attributes pertinent to documents in future updates. At this moment, the Document message serves as a placeholder and does not possess any fields.

org/polypheny/prism/meta_responses.proto

DbmsVersionResponse

The DbmsVersionResponse message relays details about the version and name of the database management system (DBMS) in response to a DbmsVersionRequest.

  • string dbms_name: The name of the database management system.
  • string version_name: The full version name of the DBMS.
  • int32 major_version: The major version number of the DBMS.
  • int32 minor_version: The minor version number of the DBMS.

DefaultNamespaceResponse

The default namespace

  • string default_namespace

TableTypesResponse

The TableTypesResponse message conveys information about the various table types present in the system.

  • repeated TableType table_types: A list of TableType objects detailing each table type present in the system.

TableType

The TableType message delineates the nature or category of a table.

  • string table_type: A descriptor denoting the type or category of a table, such as “BASE TABLE”, “VIEW”, or any other classification present in the system.

TypesResponse

The TypesResponse message provides a list of native data types supported by the system.

  • repeated Type types: A list of Type objects detailing each native data type supported by the system.

Type

The Type message describes the characteristics and specifications of a particular native data type.

  • string type_name: The name of the data type.
  • int32 precision: The number of total digits for numeric types or the maximum length for string and binary types.
  • optional string literal_prefix: The character(s) used to prefix a literal of this type (e.g., a single quote for strings).
  • optional string literal_suffix: The character(s) used to suffix a literal of this type.
  • bool is_case_sensitive: Indicates whether the data type is case sensitive.
  • int32 is_searchable: Indicates how the data type can be used in WHERE clauses.
  • bool is_auto_increment: Indicates whether columns of this data type auto-increment.
  • int32 min_scale: The minimum scale for this data type.
  • int32 max_scale: The maximum scale for this data type.
  • int32 radix: The base number used in representing numeric values.

UserDefinedType

The UserDefinedType message encapsulates details about a specific user-defined data type.

  • string type_name: The name of the user-defined data type.
  • repeated ValueMeta value_metas: A list of ValueMeta objects detailing the metadata associated with fields of this data type.

ValueMeta

The ValueMeta message offers insights into the metadata of a specific field related to a user-defined type.

  • string value_name: The name or descriptor of the value’s metadata.

MetaStringResponse

The MetaStringResponse message encapsulates a string that represents some specific metadata information.

  • string string: A string representing the requested metadata information.

ProceduresResponse

The ProceduresResponse message provides a list of stored procedures available within the system.

  • repeated Procedure procedures: A list of Procedure objects detailing each stored procedure present in the system.

Procedure

The Procedure message encapsulates details about a specific stored procedure in the system.

  • string trivial_name: The simple name of the procedure.
  • string input_parameters: The input parameters required by the procedure.
  • string description: A brief description or purpose of the procedure.
  • ReturnType return_type: Enum indicating the return type of the procedure. It can be unspecified, unknown, no result, or result.
  • string unique_name: A unique name or identifier for the procedure.

ClientInfoProperties

The ClientInfoProperties message encapsulates key-value pairs representing client-specific information.

  • PropertiesEntry properties: A mapping of property names to their corresponding values, providing insights or settings related to the client.

ClientInfoPropertiesResponse

The ClientInfoPropertyResponse message provides metadata about various client-specific properties.

ClientInfoPropertyMetaResponse

The ClientInfoPropertyMetaResponse message provides metadata about various client-specific properties.

  • repeated ClientInfoPropertyMeta client_info_property_metas: A list of ClientInfoPropertyMeta objects detailing metadata for each client-specific property.

ClientInfoPropertyMeta

The ClientInfoPropertyMeta message encapsulates metadata about a specific client property.

  • string key: The unique key identifier for the client property.
  • string default_value: The default value of the property.
  • int32 maxlength: Maximum length of the property value. Useful for validation purposes.
  • string description: A brief description explaining the purpose or usage of the property.

FunctionsResponse

The FunctionsResponse message provides a list of functions available within the system.

  • repeated Function functions: A list of Function objects detailing each function present in the system.

Function

The Function message encapsulates details about a specific function in the system.

  • string name: The name of the function.
  • string syntax: The expected syntax for using the function.
  • string function_category: The category to which the function belongs. Helps in categorizing functions for better management and understanding.
  • bool is_table_function: Indicates whether the function is a table function. If true, it means the function returns a table; otherwise, it returns a scalar value.

org/polypheny/prism/protointerface.proto

Request

Wrapper message wrapping a specific request message to be sent to the server.

  • uint64 id: The id of the request. Must be strictly greater than 0.
  • DbmsVersionRequest dbms_version_request
  • DefaultNamespaceRequest default_namespace_request
  • TableTypesRequest table_types_request
  • TypesRequest types_request
  • ProceduresRequest procedures_request
  • FunctionsRequest functions_request
  • NamespacesRequest namespaces_request
  • EntitiesRequest entities_request
  • SqlStringFunctionsRequest sql_string_functions_request
  • SqlSystemFunctionsRequest sql_system_functions_request
  • SqlTimeDateFunctionsRequest sql_time_date_functions_request
  • SqlNumericFunctionsRequest sql_numeric_functions_request
  • SqlKeywordsRequest sql_keywords_request
  • ConnectionRequest connection_request
  • ConnectionCheckRequest connection_check_request
  • DisconnectRequest disconnect_request
  • ClientInfoPropertiesRequest client_info_properties_request
  • ClientInfoProperties set_client_info_properties_request
  • ExecuteUnparameterizedStatementRequest execute_unparameterized_statement_request
  • ExecuteUnparameterizedStatementBatchRequest execute_unparameterized_statement_batch_request
  • PrepareStatementRequest prepare_indexed_statement_request
  • ExecuteIndexedStatementRequest execute_indexed_statement_request
  • ExecuteIndexedStatementBatchRequest execute_indexed_statement_batch_request
  • PrepareStatementRequest prepare_named_statement_request
  • ExecuteNamedStatementRequest execute_named_statement_request
  • FetchRequest fetch_request
  • CloseStatementRequest close_statement_request
  • CommitRequest commit_request
  • RollbackRequest rollback_request
  • ConnectionPropertiesUpdateRequest connection_properties_update_request
  • CloseResultRequest close_result_request

ErrorResponse

Response message sent to the client by the server in case of an error.

  • string message: Human readable error message

Response

Wrapper message wrapping a specific response message to be sent to the client.

  • uint64 id: The id of the request this response is related to.
  • bool last: If a request triggers a stream of responses from the server, this flag represents a response to be the end of the stream.
  • ErrorResponse error_response
  • DbmsVersionResponse dbms_version_response
  • DefaultNamespaceResponse default_namespace_response
  • TableTypesResponse table_types_response
  • TypesResponse types_response
  • ProceduresResponse procedures_response
  • FunctionsResponse functions_response
  • NamespacesResponse namespaces_response
  • EntitiesResponse entities_response
  • MetaStringResponse sql_string_functions_response
  • MetaStringResponse sql_system_functions_response
  • MetaStringResponse sql_time_date_functions_response
  • MetaStringResponse sql_numeric_functions_response
  • MetaStringResponse sql_keywords_response
  • ConnectionResponse connection_response
  • ConnectionCheckResponse connection_check_response
  • DisconnectResponse disconnect_response
  • ClientInfoProperties client_info_properties_response
  • ClientInfoPropertiesResponse set_client_info_properties_response
  • StatementResponse statement_response
  • StatementBatchResponse statement_batch_response
  • StatementResult statement_result
  • PreparedStatementSignature prepared_statement_signature
  • Frame frame
  • CloseStatementResponse close_statement_response
  • CommitResponse commit_response
  • RollbackResponse rollback_response
  • ConnectionPropertiesUpdateResponse connection_properties_update_response
  • CloseResultResponse close_result_response

org/polypheny/prism/meta_requests.proto

DbmsVersionRequest

The DbmsVersionRequest message is utilized to request the version information of the database management system (DBMS) in use. It acts as a trigger for the server to respond with the specific version details of the DBMS. This message does not contain any fields. It simply acts as an indicator to prompt the server for DbmsVersionResponse.

DefaultNamespaceRequest

Request the default namespace

TableTypesRequest

The TableTypesRequest message is designed to request information about the different types of tables that are supported or recognized by the DBMS. This message does not contain any fields. It’s a prompt for the server to respond with details about the supported table types in a TableTypesResponse.

TypesRequest

The TypesRequest message is deployed to obtain a list of data types supported by the database management system. This helps clients understand the range of data types they can utilize when defining or querying tables. This message does not contain any fields. It simply prompts the server to return a list of supported data types in a TypesResponse.

SqlStringFunctionsRequest

The SqlStringFunctionsRequest message is used to solicit information about the string functions supported by the SQL implementation of the DBMS. This message is field less and prompts the server to return details of the available string functions in an SqlStringFunctionsResponse.

SqlSystemFunctionsRequest

The SqlSystemFunctionsRequest message aims to retrieve the list of system functions provided by the SQL implementation of the DBMS. Without any fields, this message indicates the server to respond with details about the system functions in an SqlSystemFunctionsResponse.

SqlTimeDateFunctionsRequest

The SqlTimeDateFunctionsRequest message is dispatched to fetch a list of time and date functions supported by the SQL implementation of the DBMS. This message, being field less, acts as a request for the server to list time and date functions in a SqlTimeDateFunctionsResponse.

SqlNumericFunctionsRequest

The SqlNumericFunctionsRequest message endeavors to obtain details about the numeric functions provided by the SQL implementation of the DBMS. This message, devoid of fields, prompts the server to respond with information about numeric functions in an SqlNumericFunctionsResponse.

SqlKeywordsRequest

The SqlKeywordsRequest message is designed to request a list of reserved keywords utilized by the SQL implementation of the DBMS. With no fields, this message acts as an indicator for the server to provide the list of SQL keywords in an SqlKeywordsResponse.

ProceduresRequest

The ProceduresRequest message is employed to retrieve a list of stored procedures in the database for a specified query language. The client can also narrow down the results by specifying a procedure name pattern.

  • string language: The query language for which the procedures are defined. This determines the set of procedures that will be retrieved.
  • optional string procedure_name_pattern: A pattern to filter the names of procedures. For example, providing “get%” might retrieve procedures named getUser, getDetails, etc. If not specified, all procedures for the provided language will be returned. Like in sql, the symbol _ can be used to match a single character.

ClientInfoPropertiesRequest

The ClientInfoPropertiesRequest message facilitates the acquisition of client information properties stored in the database. These properties can offer additional context about the connected client. This message doesn’t possess any fields. It acts as a directive for the server to provide the associated client information properties in a ClientInfoPropertiesResponse.

FunctionsRequest

The FunctionsRequest message is wielded to obtain a list of functions from the database based on the specified query language and function category.

  • string query_language: Defines the query language for which the functions are sought. This field determines the range of functions that will be retrieved.
  • string function_category: Categorizes the function, allowing clients to filter results based on specific categories, such as “NUMERIC”, “STRING”, or “SYSTEM”. This helps in refining the search for specific types of functions.

org/polypheny/prism/connection_requests.proto

ConnectionRequest

The ConnectionRequest message is designed to initiate a connection request from the client to the server. It contains information regarding the API version, client identity, and optional credentials, as well as properties associated with the connection.

  • int32 major_api_version: Specifies the major version of the API that the client is using.
  • int32 minor_api_version: Represents the minor version of the API in use.
  • optional string username: (Optional) The username for authentication when establishing the connection.
  • optional string password: (Optional) The password associated with the specified username for authentication purposes.
  • optional ConnectionProperties connection_properties: (Optional) Contains specific properties related to the connection, such as timeout settings or database preferences.

ConnectionPropertiesUpdateRequest

The ConnectionProperties message defines specific properties related to the client-server connection. It allows clients to specify certain behaviors and settings for the connection, such as transaction auto-commit status and target namespace preference.

  • ConnectionProperties connection_properties: Specifies the new settings for the connection. Contains properties such as transaction auto-commit status and target namespace preference.

ConnectionProperties

The ConnectionProperties message defines specific properties related to the client-server connection. It allows clients to specify certain behaviors and settings for the connection, such as transaction auto-commit status and target namespace preference.

  • optional bool is_auto_commit: (Optional) Indicates whether transactions are automatically committed upon execution or require manual commitment.
  • optional string namespace_name: (Optional) Specifies the preferred namespace within the database or system that the client wants to interact with.

DisconnectRequest

The ConnectionCheckRequest message in combination with the corresponding remote procedure call is utilized to verify the current state of an established connection. It acts as a simple “ping” request, enabling clients to ascertain if the server is responsive and if the connection is still valid. This message does not contain any fields. It simply acts as an indicator to prompt the server for a ConnectionCheckResponse.

ConnectionCheckRequest

The ConnectionCheckRequest message in combination with the corresponding remote procedure call is utilized to verify the current state of an established connection. It acts as a simple “ping” request, enabling clients to ascertain if the server is responsive and if the connection is still valid.

org/polypheny/prism/statement_responses.proto

CloseResultResponse

Response of the server on the request of a client to close the result set of a specific statement. This message has no fields. It merely serves as an acknowledgement.

StatementResponse

Represents the response after executing a statement. This message contains the identifier of the executed statement and optionally, the result of the execution. The result can vary based on the type of statement executed, ranging from scalar values to complex data frames.

  • int32 statement_id: The unique identifier of the executed statement.
  • optional StatementResult result: (Optional) The result of the executed statement. This could be a scalar value or a data frame, depending on the type of statement executed.

StatementResult

Encapsulates the result of an executed statement. This can include scalar values for simple queries or data frames for queries that return multiple rows or complex data.

  • int64 scalar: A scalar result value, often used to represent the number of rows affected by an operation.
  • optional Frame frame: (Optional) A frame of data, which could be a relational table, a graph, or a set of documents.

StatementBatchResponse

Represents the response after executing a batch of statements. This includes the batch identifier and a list of scalar results for each statement in the batch, typically representing the number of rows affected by each operation.

  • int32 batch_id: The unique identifier of the executed batch.
  • repeated int64 scalars: List of scalar results for each statement in the batch.

PreparedStatementSignature

Provides metadata about a prepared statement, including its parameters. This information is crucial for correctly binding parameters to the statement before execution.

  • int32 statement_id: The unique identifier of the prepared statement.
  • repeated ParameterMeta parameter_metas: Metadata about each parameter required by the statement, detailing type, name, and other characteristics.

ParameterMeta

Provides metadata about a single parameter of a prepared statement. This includes details about the parameter’s precision, scale, data type, and names.

  • int32 precision: Precision of the parameter, typically used for numeric types.
  • int32 scale: Scale of the parameter, typically used for decimal types.
  • string type_name: The data type of the parameter.
  • optional string parameter_name: (Optional) The name of the placeholder specified for this value.
  • string name: The name of the parameter, if specified.

CloseStatementResponse

Represents the response after closing a prepared statement. The message is currently empty, serving as a simple acknowledgment of the action. This message does not contain any fields. It simply serves as an acknowledgment.

Frame

Represents a frame of data that could be one of several types, offering flexibility in representing different types of data responses. This structure allows for a more generic interface that can handle various data structures.

  • bool is_last: Indicates if this frame is the last in a series of frames, useful for paginated results.
  • RelationalFrame relational_frame
  • GraphFrame graph_frame
  • DocumentFrame document_frame

org/polypheny/prism/error.proto

ErrorDetails

The ErrorDetails message conveys specific information about an error encountered during the processing of a request. This detailed feedback aids clients in understanding the nature and cause of an issue.

  • optional int32 error_code: A numeric code representing the specific error encountered. This code can be used programmatically to handle specific error cases.
  • optional string state: An optional state description in the form of an identifier that provides further context about the error.
  • optional string message: A human-readable message describing the error in detail. This message offers clients a clear understanding of the issue.

org/polypheny/prism/relational_frame.proto

RelationalFrame

The RelationalFrame message encapsulates the structure of a relational frame, which includes metadata about columns and rows of data within a relational table. This structure is essential for representing the schema and data of a table in a structured format, facilitating data manipulation and query operations.

  • repeated ColumnMeta column_meta: A collection of metadata about each column in the frame. This provides details such as index, nullability, length, precision, and type information, defining the schema of the table represented by the relational frame.
  • repeated Row rows: The rows of data within the frame. Each row consists of a series of ProtoValue objects representing the values in the row, mirroring the actual data stored in the table’s rows according to the schema defined by the column metadata.

ColumnMeta

The ColumnMeta message holds metadata related to a specific column within a relational table.

  • int32 column_index: Index of the column within the table.
  • bool is_nullable: Indicates whether the column can contain null values.
  • int32 length: The length of the column values.
  • string column_label: Label associated with the column, if any.
  • string column_name: Name of the column.
  • int32 precision: Precision of the column, usually for numerical values.
  • string entity_name: Name of the entity that the column represents.
  • string schema_name: Name of the schema that the column belongs to.
  • TypeMeta type_meta: Metadata describing the type of the column.
  • int32 scale: Scale of the column, typically for numerical values.
  • string namespace: Namespace the column resides in.

FieldMeta

The FieldMeta message provides metadata for individual fields, which can be part of complex structures like arrays or structs.

  • int32 field_index: Index of the field within its containing structure.
  • bool is_nullable: Indicates whether the field can contain null values.
  • int32 length: Length of the field’s value.
  • string field_name: Name of the field.
  • int32 precision: Precision of the field, usually for numerical values.
  • TypeMeta type_meta: Metadata describing the type of the field.
  • int32 scale: Scale of the field, typically for numerical values.

TypeMeta

The TypeMeta message is a comprehensive descriptor for the data types used within the system. This message not only defines simple data types but also accommodates complex types such as structures and arrays. Its flexibility allows it to describe a wide range of data types and data structures.

  • ProtoPolyType proto_value_type: Represents the fundamental data type of the value. This can be any basic data type depending on the definitions within ProtoValue.ProtoValueType.
  • optional StructMeta struct_meta: If the proto_value_type indicates a structure, this field provides the metadata for that structure. Contains details about the fields within the structure. This field will be absent for non-structured types.
  • optional ArrayMeta array_meta: If the proto_value_type indicates an array, this field provides metadata about the type of elements within the array. This field will be absent for non-array types.

StructMeta

The StructMeta message provides metadata specific to structured types, giving details about the fields that make up the structure.

  • repeated FieldMeta field_metas: A collection of metadata entries, one for each field within the structure. Each FieldMeta provides details like the field’s name, type, nullability, etc.

ArrayMeta

The ArrayMeta message provides metadata about array types, detailing the kind of elements they can hold.

  • TypeMeta element_type: TypeMeta This field describes the type of elements contained within the array. It uses the TypeMeta message, meaning an array can contain any data type, including nested arrays or structures.

Row

The Row message represents a single row within a relational frame.

  • repeated ProtoValue values: The values within the row, represented as a series of ProtoValue objects.

org/polypheny/prism/document_frame.proto

DocumentFrame

The DocumentFrame message represents a frame containing one or more documents and is used to relay results or data entries structured as documents from the server to the client.

  • repeated ProtoDocument documents: A list of documents contained within this frame. Each entry in this list is an instance of ProtoDocument, representing an individual document.

org/polypheny/prism/graph_frame.proto

GraphFrame

The GraphFrame message is a placeholder intended to represent graph frames as part of the labeled property graph model. As of now, the graph model is not fully implemented, making this message void of fields. It acts as a provision for future developments where fields related to the graph model will be added. Currently, this message does not contain any fields. It is reserved for future use when the graph model is more completely realized.

org/polypheny/prism/statement_requests.proto

CloseResultRequest

Closes the result set of the statement matching the specified statement id. If no such statement exists, or the result is already closed, this request is ignored.

  • int32 statement_id: The id of the statement of which the result set should be closed.

ExecuteUnparameterizedStatementRequest

Represents a request to execute a statement without any parameters. This message includes details about the language in which the statement is written, the statement itself, and optional attributes such as fetch size and namespace name to control how the statement is executed.

  • string language_name: Specifies the query language of the statement being executed.
  • string statement: The statement to be executed.
  • optional int32 fetch_size: (Optional) Number of rows to include into the response message of this call. More rows can be fetched afterwards. If not specified, a default value is used.
  • optional string namespace_name: (Optional) The namespace under which the statement should be executed. If not specified, the namespace specified for the connection is used.

ExecuteUnparameterizedStatementBatchRequest

Encapsulates a batch of unparameterized statements to be executed. This is useful for executing multiple statements in a single call, improving efficiency and performance by reducing the number of round trips to the server.

  • repeated ExecuteUnparameterizedStatementRequest statements: List of statements to be executed. Each statement is an instance of ExecuteUnparameterizedStatementRequest, allowing for individual control over the execution parameters of each statement in the batch.

PrepareStatementRequest

Represents a request to prepare a statement for execution. This message includes the language of the statement, the statement text itself, and optionally, the namespace where the statement should be prepared. Preparing a statement can improve performance for repeated execution.

  • string language_name: Specifies the query language of the statement to be prepared.
  • string statement: The statement to be prepared.
  • optional string namespace_name: (Optional) The namespace under which the statement should be prepared.

ExecuteIndexedStatementRequest

Represents a request to execute a previously prepared statement by its ID, using indexed parameters. his allows for efficient execution of prepared statements with the provided parameters.

  • int32 statement_id: The unique identifier of the prepared statement to be executed.
  • IndexedParameters parameters: The indexed parameters to be used with the statement.
  • optional int32 fetch_size: (Optional) Number of rows to include into the response message of this call. More rows can be fetched afterwards.

ExecuteIndexedStatementBatchRequest

Encapsulates a batch request to execute a prepared statement multiple times with different sets of indexed parameters. This is useful for executing the same statement with various parameter sets in a single operation, enhancing performance and efficiency.

  • int32 statement_id: The unique identifier of the prepared statement to be executed.
  • repeated IndexedParameters parameters: List of sets of indexed parameters for multiple executions of the statement.

ExecuteNamedStatementRequest

Represents a request to execute a previously prepared statement by its ID, using named parameters. This approach allows for parameter values to be associated with specific parameter names in the statement, providing clarity and reducing errors in parameter placement.

  • int32 statement_id: The unique identifier of the prepared statement to be executed.
  • NamedParameters parameters: The named parameters to be used with the statement.
  • optional int32 fetch_size: (Optional) Number of rows to include into the response message of this call. More rows can be fetched afterwards.

IndexedParameters

Encapsulates indexed parameters for a prepared statement. This represents a list of parameter values to be used in the statement, where each parameter’s position in the list corresponds to its position in the statement.

  • repeated ProtoValue parameters: List of values to be used as parameters, indexed by their position in the list.

NamedParameters

Encapsulates named parameters for a prepared statement. This allows for parameters to be specified by name, providing a flexible and clear way to supply parameters to a prepared statement.

  • ParametersEntry parameters: Map of parameter names to their corresponding values.

CloseStatementRequest

Represents a request to close a statement. This operation is used to release resources allocated to the statement on the server. Closing a statement when it is no longer needed is a good practice to manage resources efficiently.

  • int32 statement_id: The unique identifier of the statement to be closed.

FetchRequest

Represents a request to fetch a batch of results for a previously executed statement. This is typically used in conjunction with large result sets, where the results are fetched in multiple batches to manage memory and network resources effectively.

  • int32 statement_id: The unique identifier of the statement whose results are to be fetched.
  • optional int32 fetch_size: (Optional) Number of rows to retrieve in this batch. If no fetch size is specified, a default value is used.

org/polypheny/prism/transaction_responses.proto

CommitResponse

Represents the response after attempting to commit a transaction. This message serves as an acknowledgment that the commit request was received and processed, finalizing all changes made during the transaction. This message does not contain any fields. It simply serves as an acknowledgment of the commit.

RollbackResponse

Represents the response after attempting to rollback a transaction. This message serves as an acknowledgment that the rollback request was received and processed, undoing all changes made during the transaction. This message does not contain any fields. It simply serves as an acknowledgment of the rollback.

org/polypheny/prism/value.proto

ProtoValue

ProtoValue represents a single value supported by the DBMS. It contains a wide range of fields each corresponding to one supported data type. Only one field can be set at a time.

  • ProtoBoolean boolean: Field used to represent a boolean. If set, all other fields must be empty.
  • ProtoInteger integer: Field used to represent an integer of 32 bits.. If set, all other fields must be empty.
  • ProtoLong long: Field used to represent a long integer of 64 bits. If set, all other fields must be empty.
  • ProtoBigDecimal big_decimal: Field used to represent a BigDecimal. The value is represented using an unscaled value (arbitrary length byte string), scale (32bit) and precision (32bit). If set, all other fields must be empty.
  • ProtoFloat float: Field used to represent a floating-point number of 32 bits. If set, all other fields must be empty.
  • ProtoDouble double: Field used to represent a double-precision (64 bit) floating-point number. If set, all other fields must be empty.
  • ProtoDate date: Field used to represent a date. Dates are stored in days since epoch till the start of the specified day. If set, all other fields must be empty.
  • ProtoTime time: Field used to represent a time. The value is specified as milliseconds since midnight of a day. If set, all other fields must be empty.
  • ProtoTimestamp timestamp: Field used to represent a timestamp. The value is specified as milliseconds since epoch. If set, all other fields must be empty.
  • ProtoInterval interval: Field used to represent a time interval. Intervals are either specified in milliseconds or months. The unit is specified along the value. If set, all other fields must be empty.
  • ProtoString string: Field used to represent an string of arbitrary length. If set, all other fields must be empty.
  • ProtoBinary binary: Field used to represent binary data of arbitrary length. If set, all other fields must be empty.
  • ProtoNull null: Field used to represent a null value. If set, all other fields must be empty.
  • ProtoList list: Field used to represent a list of ProtoValues. If set, all other fields must be empty.
  • ProtoDocument document: Field used to represent a document consisting of key value pairs where keys and values are arbitrary ProtoValues. If set, all other fields must be empty.
  • ProtoFile file: Field used to represent a FILE type such as FILE, IMAGE, VIDEO or AUDIO.

ProtoBoolean

Represents a boolean value.

  • bool boolean: A boolean value.

ProtoInteger

Represents a 32-bit integer value.

  • int32 integer: A 32-bit integer value.

ProtoLong

Represents a 64-bit long integer value.

  • int64 long: A 64-bit long integer value.

ProtoBigDecimal

Represents a BigDecimal value with specified precision and scale. The value is reconstructed by calculating unscaled_value * 10 ^ -scale.

  • int32 scale: The scale of the BigDecimal.
  • bytes unscaled_value: The unscaled value of the BigDecimal.

ProtoFloat

Represents a single precision floating point number.

  • float float: A single precision floating point number.

ProtoDouble

Represents a double precision floating point number.

  • double double: A double precision floating point number.

ProtoDate

Represents a date as a 64-bit integer.

  • int64 date: Days since epoch till start of the specified day.

ProtoTime

Represents a time value.

  • int32 time: Milliseconds since midnight of an arbitrary day.

ProtoTimestamp

Represents a timestamp value.

  • int64 timestamp: The timestamp value in milliseconds since epoch.

ProtoInterval

Represents an interval value.

  • int64 milliseconds
  • int64 months

ProtoString

Represents a string value.

  • string string: A string value of arbitrary length.

ProtoBinary

Represents binary data.

  • bytes binary: Binary data of arbitrary length.

ProtoNull

Represents a null value. This message does not contain any fields.

ProtoList

Represents a list of ProtoValue items.

  • repeated ProtoValue values: The list of ProtoValue items.

ProtoEntry

Defines a key-value pair using ProtoValues for both key and value.

  • ProtoValue key: The key of the entry.
  • ProtoValue value: The value of the entry.

ProtoDocument

Represents a document consisting of multiple ProtoEntry items.

  • repeated ProtoEntry entries: The list of ProtoEntry items forming the document.

ProtoFile

Represents a file containing large binary data.

  • bytes binary: The content of the file in binary.

org/polypheny/prism/connection_responses.proto

ConnectionResponse

The ConnectionResponse message is sent by the server in response to a ConnectionRequest from the client. It provides feedback regarding the compatibility of the client’s API version with the server, as well as other important information about the connection.

  • bool is_compatible: Indicates whether the client’s API version is compatible with the server. If true, the connection can proceed; if false, the client should consider updating or downgrading its API version.
  • int32 major_api_version: The major version number of the server’s API. Helps the client ascertain the API level of the server.
  • int32 minor_api_version: The minor version number of the server’s API. Provides finer granularity about the server’s capabilities.

DisconnectResponse

The DisconnectionResponse message is sent by the server in response to a DisconnectRequest from the client. It provides an acknowledgment that the disconnection process has been acknowledged and processed by the server. This message does not contain any fields. It simply serves as an acknowledgment of the disconnection process.

ConnectionCheckResponse

The ConnectionCheckResponse message is sent by the server in response to a ConnectionCheckRequest from the client. It acts as an affirmation that the server is responsive, and the connection is still valid. This message does not contain any fields. Its receipt by the client is an indicator of the server’s responsiveness and the validity of the connection.

ConnectionPropertiesUpdateResponse

The ConnectionPropertiesUpdateResponse message is sent by the server in response to a ConnectionPropertiesUpdateRequest from the client. It acknowledges the success of the requested connection properties update. This message does not contain any fields. It serves as an acknowledgment of the update process for the connection properties.

Enums

This section provides an overview of the enums and their values. Enums are categorized by the files containing them.

org/polypheny/prism/namespace_meta_responses.proto

ColumnType

The PrimaryKey message provides details about a table’s primary key.

  • UNSPECIFIED = 0: The database where the primary key’s table is located.
  • REGULAR = 1: The namespace or schema of the primary key’s table.
  • CALCULATED = 2: The table with this primary key.
  • VERSION = 3: The columns that make up the primary key.

org/polypheny/prism/meta_responses.proto

ReturnType

The return type enum is part of the message Procedure and indicates the possible types of return values for a stored procedure.

  • UNSPECIFIED = 0: Indicates that the return type is unspecified.
  • UNKNOWN = 1: Indicates that the return type is unknown.
  • NO_RESULT = 2: The procedure does not return a result.
  • RESULT = 3: The procedure returns a result.

org/polypheny/prism/value.proto

ProtoPolyType

Specifies the type of a proto value. This enum contains a value for each datatype supported by the DBMS.

  • UNSPECIFIED = 0: Default unspecified type.
  • BOOLEAN = 1: Boolean type, true or false.
  • TINYINT = 2: 8-bit integer.
  • SMALLINT = 3: 16-bit integer.
  • INTEGER = 4: 32-bit integer.
  • BIGINT = 5: 64-bit integer.
  • DECIMAL = 6: Arbitrary precision number.
  • REAL = 7: Single precision floating point.
  • FLOAT = 8: Alias for REAL.
  • DOUBLE = 9: Double precision floating point.
  • DATE = 10: Date value representing a specific day independent of time. Specified in days since epoch till the start of the specified day.
  • TIME = 11: Time value without timezone in milliseconds since midnight.
  • TIMESTAMP = 13: Timestamp without timezone. Specified as milliseconds since epoch.
  • INTERVAL = 15: Interval
  • CHAR = 28: Fixed length character string.
  • VARCHAR = 29: Variable length character string.
  • TEXT = 58: Text data type.
  • BINARY = 30: Binary data as byte string.
  • VARBINARY = 31: Variable length binary data as byte string.
  • NULL = 32: Null type.
  • ARRAY = 33: Array type containing elements of one of the ProtoPolyTypes.
  • MAP = 34: Map type storing key value pairs. Key and value can be arbitrary values of one of the ProtoPolyTypes.
  • DOCUMENT = 35: Document type similar to a map but used in the document model to represent documents returned as a result.
  • GRAPH = 36: Graph type. Returned by a query in the graph data model.
  • NODE = 37: Graph node type. Used inside the graph type to represent a graphs nodes.
  • EDGE = 38: Graph edge type. Used inside the graph type to represent a graphs edges.
  • PATH = 39: Graph path type. Used in results of the graph data model to return a the result of graph queries returning a path.
  • IMAGE = 40: Image data type. Subtype of the file type. Same as binary but containing image data.
  • VIDEO = 41: Video data type. Subtype of the file type. Same as binary but containing video data.
  • AUDIO = 42: Audio data type. Subtype of the file type. Same as binary but containing audio data.
  • FILE = 43: File data type. Same as binary but containing the data of an arbitrary file.
  • DISTINCT = 44: Distinct type (a named scalar type). Not supported yet!
  • STRUCTURED = 45: Structured type. Contains an arbitrary set of other ProtoValues of any of the ProtoValueTypes. Not supported yet!
  • ROW = 46: Row type.
  • OTHER = 47: Other types not specifically listed.
  • CURSOR = 48: Cursor type.
  • COLUMN_LIST = 49: Column list type.
  • DYNAMIC_STAR = 50: Dynamic star type (used for dynamic column projection).
  • GEOMETRY = 51: Geometric data type.
  • SYMBOL = 52: Symbol type.
  • JSON = 53: JSON data type.
  • MULTISET = 54: Multiset type.
  • ANY = 55: Any type (a type that can hold any value).
  • USER_DEFINED_TYPE = 56: User-defined type.
  • ROW_ID = 57: Row identifier type.
© Polypheny GmbH. All Rights Reserved.