diff --git a/CHANGELOG.md b/CHANGELOG.md index 9aab97d44341e989968d49d902d3f97e8a77bea1..5771512a4610fc107c1cef5f5eab396952406c87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +* Messages for the Result of `SELECT` queries. + ### Changed ### Deprecated diff --git a/proto/caosdb/entity/v1/main.proto b/proto/caosdb/entity/v1/main.proto index 9938882b114fd3e5820240760e87cce1ce6d02f4..11fd82a5361187f76abf0c8adb44cfd162270d85 100644 --- a/proto/caosdb/entity/v1/main.proto +++ b/proto/caosdb/entity/v1/main.proto @@ -539,17 +539,32 @@ message FindQueryResult { } // A single result row of a SELECT query -message SelectQueryRows { - // The cells of the table row. - repeated string cells = 1; +message SelectQueryRow { + // The cells of the table row contain the value of the SELECT'ed fields. The + // order of the cells follows the order of the columns of the + // SelectQueryHeader. + repeated Value cells = 2; +} + +// A single header column of the result of a SELECT query +message SelectQueryColumn { + // The column name. This is one of the SELECT'ed fields. + string name = 1; +} + +// The header line of the result of a SELECT query +message SelectQueryHeader { + // List of columns in this table. The order defines the order of the cells in + // each of the SelectQueryRows. + repeated SelectQueryColumn columns = 1; } // A table which is a result of a SELECT query message SelectQueryResult { - // A single row which contains the SELECT'ed fields - SelectQueryRows header = 1; + // The header contains the SELECT'ed fields + SelectQueryHeader header = 3; // The actual results - repeated SelectQueryRows data_rows = 2; + repeated SelectQueryRow data_rows = 4; } ///////////////////////////////////////////////////////////////////////////