MCPcopy Create free account
hub / github.com/cosdata/cosdata / test_cosql_statement_parser

Function test_cosql_statement_parser

src/cosql/mod.rs:102–452  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

100
101 #[test]
102 fn test_cosql_statement_parser() {
103 let values = [
104 (
105 "define entity person as
106 name: string,
107 age: int,
108 date_of_birth: date;",
109 CosQLStatement::EntityDefinition(EntityDefinition {
110 name: "person".to_string(),
111 attributes: vec![
112 AttributeDefinition {
113 name: "name".to_string(),
114 data_type: DataType::String,
115 },
116 AttributeDefinition {
117 name: "age".to_string(),
118 data_type: DataType::Int,
119 },
120 AttributeDefinition {
121 name: "date_of_birth".to_string(),
122 data_type: DataType::Date,
123 },
124 ],
125 }),
126 ),
127 (
128 "define entity project as
129 name: string,
130 start_date: date,
131 end_date: date;",
132 CosQLStatement::EntityDefinition(EntityDefinition {
133 name: "project".to_string(),
134 attributes: vec![
135 AttributeDefinition {
136 name: "name".to_string(),
137 data_type: DataType::String,
138 },
139 AttributeDefinition {
140 name: "start_date".to_string(),
141 data_type: DataType::Date,
142 },
143 AttributeDefinition {
144 name: "end_date".to_string(),
145 data_type: DataType::Date,
146 },
147 ],
148 }),
149 ),
150 (
151 "define relationship assigned_to as (
152 project: project,
153 assignee: person
154 );",
155 CosQLStatement::RelationshipDefinition(RelationshipDefinition {
156 name: "assigned_to".to_string(),
157 roles: vec![
158 RoleDefinition {
159 name: "project".to_string(),

Callers

nothing calls this directly

Calls 6

parse_cosql_statementFunction · 0.85
QueryClass · 0.70
EntityDefinitionClass · 0.50
EntityInsertionClass · 0.50

Tested by

no test coverage detected