mirror of https://github.com/buster-so/buster.git
Merge branch 'dallin/bus-889-align-cli-tooling-with-the-in-app-editor' into big-nate/bus-891-reorganize-and-redo-permissions-tabs
This commit is contained in:
commit
adc0e4e57e
|
@ -36,6 +36,9 @@ pub struct GetDatasetResponse {
|
|||
pub name: String,
|
||||
pub sql: Option<String>,
|
||||
pub yml_file: Option<String>,
|
||||
pub data_source_name: String,
|
||||
pub data_source_type: String,
|
||||
pub data_source_id: Uuid,
|
||||
}
|
||||
|
||||
pub async fn get_dataset(
|
||||
|
@ -88,7 +91,18 @@ async fn get_dataset_handler(dataset_id: &Uuid, user: &User) -> Result<GetDatase
|
|||
));
|
||||
}
|
||||
|
||||
let (dataset_id, name, sql, when_to_use, yml_file) = match datasets::table
|
||||
// TODO: DATASOURCE INFO, name, type, id, etc.
|
||||
let (
|
||||
dataset_id,
|
||||
name,
|
||||
sql,
|
||||
when_to_use,
|
||||
yml_file,
|
||||
data_source_name,
|
||||
data_source_type,
|
||||
data_source_id,
|
||||
) = match datasets::table
|
||||
.inner_join(data_sources::table.on(datasets::data_source_id.eq(data_sources::id)))
|
||||
.filter(datasets::id.eq(dataset_id))
|
||||
.filter(datasets::deleted_at.is_null())
|
||||
.select((
|
||||
|
@ -97,8 +111,20 @@ async fn get_dataset_handler(dataset_id: &Uuid, user: &User) -> Result<GetDatase
|
|||
datasets::definition,
|
||||
datasets::when_to_use,
|
||||
datasets::yml_file,
|
||||
data_sources::name,
|
||||
data_sources::type_,
|
||||
data_sources::id,
|
||||
))
|
||||
.first::<(Uuid, String, String, Option<String>, Option<String>)>(&mut conn)
|
||||
.first::<(
|
||||
Uuid,
|
||||
String,
|
||||
String,
|
||||
Option<String>,
|
||||
Option<String>,
|
||||
String,
|
||||
String,
|
||||
Uuid,
|
||||
)>(&mut conn)
|
||||
.await
|
||||
{
|
||||
Ok(result) => result,
|
||||
|
@ -111,5 +137,8 @@ async fn get_dataset_handler(dataset_id: &Uuid, user: &User) -> Result<GetDatase
|
|||
sql: Some(sql),
|
||||
when_to_use,
|
||||
yml_file,
|
||||
data_source_name,
|
||||
data_source_type,
|
||||
data_source_id,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue