forked from scylladb/scylladb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema_builder.hh
59 lines (51 loc) · 1.7 KB
/
schema_builder.hh
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* Copyright 2015 Cloudius Systems
*/
#pragma once
#include "schema.hh"
#include "database_fwd.hh"
struct schema_builder {
schema::raw_schema _raw;
schema_builder(const schema::raw_schema&);
public:
schema_builder(const sstring& ks_name, const sstring& cf_name,
std::experimental::optional<utils::UUID> = { },
data_type regular_column_name_type = utf8_type);
schema_builder(const schema_ptr);
void set_uuid(const utils::UUID& id) {
_raw._id = id;
}
const utils::UUID& uuid() const {
return _raw._id;
}
void set_regular_column_name_type(const data_type& t) {
_raw._regular_column_name_type = t;
}
const data_type& regular_column_name_type() const {
return _raw._regular_column_name_type;
}
const sstring& ks_name() const {
return _raw._ks_name;
}
const sstring& cf_name() const {
return _raw._cf_name;
}
void set_comment(const sstring& s) {
_raw._comment = s;
}
const sstring& comment() const {
return _raw._comment;
}
void set_default_time_to_live(gc_clock::duration t) {
_raw._default_time_to_live = t;
}
gc_clock::duration default_time_to_live() const {
return _raw._default_time_to_live;
}
column_definition& find_column(const cql3::column_identifier&);
schema_builder& with_column(const column_definition& c);
schema_builder& with_column(bytes name, data_type type, column_kind kind = column_kind::regular_column);
schema_builder& with_column(bytes name, data_type type, index_info info, column_kind kind = column_kind::regular_column);
void add_default_index_names(database&);
schema_ptr build();
};