-
Notifications
You must be signed in to change notification settings - Fork 40
/
dataset_kind.rs
39 lines (34 loc) · 1.2 KB
/
dataset_kind.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
use super::impl_enum_type;
use crate::internal_api;
use serde::{Deserialize, Serialize};
use std::io::Write;
impl_enum_type!(
#[derive(SqlType, Debug, QueryId)]
#[diesel(postgres_type(name = "dataset_kind"))]
pub struct DatasetKindEnum;
#[derive(Clone, Debug, AsExpression, FromSqlRow, Serialize, Deserialize, PartialEq)]
#[diesel(sql_type = DatasetKindEnum)]
pub enum DatasetKind;
// Enum values
Crucible => b"crucible"
Cockroach => b"cockroach"
Clickhouse => b"clickhouse"
);
impl From<internal_api::params::DatasetKind> for DatasetKind {
fn from(k: internal_api::params::DatasetKind) -> Self {
match k {
internal_api::params::DatasetKind::Crucible => {
DatasetKind::Crucible
}
internal_api::params::DatasetKind::Cockroach => {
DatasetKind::Cockroach
}
internal_api::params::DatasetKind::Clickhouse => {
DatasetKind::Clickhouse
}
}
}
}