Skip to content

Commit

Permalink
feat(cubesql): Join Cubes (#5585)
Browse files Browse the repository at this point in the history
  • Loading branch information
gandronchik committed Nov 11, 2022
1 parent d9e5889 commit c687e42
Show file tree
Hide file tree
Showing 78 changed files with 2,635 additions and 756 deletions.
22 changes: 22 additions & 0 deletions packages/cubejs-api-gateway/openspec.yml
Expand Up @@ -7,6 +7,14 @@ paths:
"/v1/meta":
get:
summary: "Load Metadata"
# TODO: Doesn't work in rust code-gen
# parameters:
# - in: query
# name: extended
# required: true
# schema:
# type: boolean
# description: You will receive extended response if this parameter is true
description: ""
operationId: "metaV1"
responses:
Expand Down Expand Up @@ -65,6 +73,16 @@ components:
scheme: bearer
bearerFormat: JWT
schemas:
V1CubeMetaJoin:
type: "object"
required:
- name
- relationship
properties:
name:
type: "string"
relationship:
type: "string"
V1CubeMetaSegment:
type: "object"
required:
Expand Down Expand Up @@ -126,6 +144,10 @@ components:
type: "array"
items:
$ref: "#/components/schemas/V1CubeMetaSegment"
joins:
type: "array"
items:
$ref: "#/components/schemas/V1CubeMetaJoin"
V1MetaResponse:
type: "object"
properties:
Expand Down
1 change: 1 addition & 0 deletions rust/cubesql/cubeclient/.openapi-generator/FILES
Expand Up @@ -3,6 +3,7 @@ src/lib.rs
src/models/mod.rs
src/models/v1_cube_meta.rs
src/models/v1_cube_meta_dimension.rs
src/models/v1_cube_meta_join.rs
src/models/v1_cube_meta_measure.rs
src/models/v1_cube_meta_segment.rs
src/models/v1_error.rs
Expand Down
2 changes: 1 addition & 1 deletion rust/cubesql/cubeclient/.openapi-generator/VERSION
@@ -1 +1 @@
5.3.1
6.2.1
6 changes: 5 additions & 1 deletion rust/cubesql/cubeclient/src/apis/default_api.rs
Expand Up @@ -110,12 +110,16 @@ pub async fn load_v1(

pub async fn meta_v1(
configuration: &configuration::Configuration,
extended: bool,
) -> Result<crate::models::V1MetaResponse, Error<MetaV1Error>> {
let local_var_configuration = configuration;

let local_var_client = &local_var_configuration.client;

let local_var_uri_str = format!("{}/v1/meta", local_var_configuration.base_path);
let local_var_uri_str = format!(
"{}/v1/meta?extended={}",
local_var_configuration.base_path, extended
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());

Expand Down
2 changes: 2 additions & 0 deletions rust/cubesql/cubeclient/src/models/mod.rs
Expand Up @@ -2,6 +2,8 @@ pub mod v1_cube_meta;
pub use self::v1_cube_meta::V1CubeMeta;
pub mod v1_cube_meta_dimension;
pub use self::v1_cube_meta_dimension::V1CubeMetaDimension;
pub mod v1_cube_meta_join;
pub use self::v1_cube_meta_join::V1CubeMetaJoin;
pub mod v1_cube_meta_measure;
pub use self::v1_cube_meta_measure::V1CubeMetaMeasure;
pub mod v1_cube_meta_segment;
Expand Down
14 changes: 14 additions & 0 deletions rust/cubesql/cubeclient/src/models/v1_cube_meta.rs
@@ -1,3 +1,13 @@
/*
* Cube.js
*
* Cube.js Swagger Schema
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct V1CubeMeta {
#[serde(rename = "name")]
Expand All @@ -10,6 +20,8 @@ pub struct V1CubeMeta {
pub dimensions: Vec<crate::models::V1CubeMetaDimension>,
#[serde(rename = "segments")]
pub segments: Vec<crate::models::V1CubeMetaSegment>,
#[serde(rename = "joins", skip_serializing_if = "Option::is_none")]
pub joins: Option<Vec<crate::models::V1CubeMetaJoin>>,
}

impl V1CubeMeta {
Expand All @@ -18,13 +30,15 @@ impl V1CubeMeta {
measures: Vec<crate::models::V1CubeMetaMeasure>,
dimensions: Vec<crate::models::V1CubeMetaDimension>,
segments: Vec<crate::models::V1CubeMetaSegment>,
joins: Option<Vec<crate::models::V1CubeMetaJoin>>,
) -> V1CubeMeta {
V1CubeMeta {
name,
title: None,
measures,
dimensions,
segments,
joins,
}
}
}
10 changes: 10 additions & 0 deletions rust/cubesql/cubeclient/src/models/v1_cube_meta_dimension.rs
@@ -1,3 +1,13 @@
/*
* Cube.js
*
* Cube.js Swagger Schema
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct V1CubeMetaDimension {
#[serde(rename = "name")]
Expand Down
23 changes: 23 additions & 0 deletions rust/cubesql/cubeclient/src/models/v1_cube_meta_join.rs
@@ -0,0 +1,23 @@
/*
* Cube.js
*
* Cube.js Swagger Schema
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct V1CubeMetaJoin {
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "relationship")]
pub relationship: String,
}

impl V1CubeMetaJoin {
pub fn new(name: String, relationship: String) -> V1CubeMetaJoin {
V1CubeMetaJoin { name, relationship }
}
}
10 changes: 10 additions & 0 deletions rust/cubesql/cubeclient/src/models/v1_cube_meta_measure.rs
@@ -1,3 +1,13 @@
/*
* Cube.js
*
* Cube.js Swagger Schema
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct V1CubeMetaMeasure {
#[serde(rename = "name")]
Expand Down
10 changes: 10 additions & 0 deletions rust/cubesql/cubeclient/src/models/v1_cube_meta_segment.rs
@@ -1,3 +1,13 @@
/*
* Cube.js
*
* Cube.js Swagger Schema
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct V1CubeMetaSegment {
#[serde(rename = "name")]
Expand Down
10 changes: 10 additions & 0 deletions rust/cubesql/cubeclient/src/models/v1_error.rs
@@ -1,3 +1,13 @@
/*
* Cube.js
*
* Cube.js Swagger Schema
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct V1Error {
#[serde(rename = "error")]
Expand Down
10 changes: 10 additions & 0 deletions rust/cubesql/cubeclient/src/models/v1_load_request.rs
@@ -1,3 +1,13 @@
/*
* Cube.js
*
* Cube.js Swagger Schema
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct V1LoadRequest {
#[serde(rename = "queryType", skip_serializing_if = "Option::is_none")]
Expand Down
10 changes: 10 additions & 0 deletions rust/cubesql/cubeclient/src/models/v1_load_request_query.rs
@@ -1,3 +1,13 @@
/*
* Cube.js
*
* Cube.js Swagger Schema
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct V1LoadRequestQuery {
#[serde(rename = "measures", skip_serializing_if = "Option::is_none")]
Expand Down
@@ -1,3 +1,13 @@
/*
* Cube.js
*
* Cube.js Swagger Schema
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct V1LoadRequestQueryFilterBase {
#[serde(rename = "member", skip_serializing_if = "Option::is_none")]
Expand Down
@@ -1,3 +1,13 @@
/*
* Cube.js
*
* Cube.js Swagger Schema
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct V1LoadRequestQueryFilterItem {
#[serde(rename = "member", skip_serializing_if = "Option::is_none")]
Expand Down
@@ -1,3 +1,13 @@
/*
* Cube.js
*
* Cube.js Swagger Schema
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct V1LoadRequestQueryFilterLogicalAnd {
#[serde(rename = "and", skip_serializing_if = "Option::is_none")]
Expand Down
@@ -1,3 +1,13 @@
/*
* Cube.js
*
* Cube.js Swagger Schema
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct V1LoadRequestQueryFilterLogicalOr {
#[serde(rename = "or", skip_serializing_if = "Option::is_none")]
Expand Down
@@ -1,3 +1,13 @@
/*
* Cube.js
*
* Cube.js Swagger Schema
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct V1LoadRequestQueryTimeDimension {
#[serde(rename = "dimension")]
Expand Down
10 changes: 10 additions & 0 deletions rust/cubesql/cubeclient/src/models/v1_load_response.rs
@@ -1,3 +1,13 @@
/*
* Cube.js
*
* Cube.js Swagger Schema
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct V1LoadResponse {
#[serde(rename = "pivotQuery", skip_serializing_if = "Option::is_none")]
Expand Down
10 changes: 10 additions & 0 deletions rust/cubesql/cubeclient/src/models/v1_load_result.rs
@@ -1,3 +1,13 @@
/*
* Cube.js
*
* Cube.js Swagger Schema
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct V1LoadResult {
#[serde(rename = "dataSource", skip_serializing_if = "Option::is_none")]
Expand Down
10 changes: 10 additions & 0 deletions rust/cubesql/cubeclient/src/models/v1_load_result_annotation.rs
@@ -1,3 +1,13 @@
/*
* Cube.js
*
* Cube.js Swagger Schema
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct V1LoadResultAnnotation {
#[serde(rename = "measures")]
Expand Down
10 changes: 10 additions & 0 deletions rust/cubesql/cubeclient/src/models/v1_meta_response.rs
@@ -1,3 +1,13 @@
/*
* Cube.js
*
* Cube.js Swagger Schema
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct V1MetaResponse {
#[serde(rename = "cubes", skip_serializing_if = "Option::is_none")]
Expand Down

0 comments on commit c687e42

Please sign in to comment.