Skip to content

Commit 001113e

Browse files
committed
Migrate to GitQL SDK 0.28.0
1 parent ff36111 commit 001113e

File tree

3 files changed

+20
-63
lines changed

3 files changed

+20
-63
lines changed

Cargo.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ categories = ["command-line-utilities"]
1313
exclude = [".github/**", "docs/**", "media/**", "scripts/**"]
1414

1515
[dependencies]
16-
gitql-core = "0.4.0"
17-
gitql-std = "0.4.1"
18-
gitql-cli = "0.27.0"
19-
gitql-ast = "0.24.0"
20-
gitql-parser = "0.26.0"
21-
gitql-engine = "0.27.0"
16+
gitql-core = "0.5.0"
17+
gitql-std = "0.5.0"
18+
gitql-cli = "0.28.0"
19+
gitql-ast = "0.25.0"
20+
gitql-parser = "0.27.0"
21+
gitql-engine = "0.28.0"
2222
atty = "0.2.14"

src/main.rs

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -186,60 +186,17 @@ fn execute_fileql_query(
186186

187187
// Render the result only if they are selected groups not any other statement
188188
let engine_result = evaluation_result.ok().unwrap();
189-
if let SelectedGroups(mut groups, hidden_selection) = engine_result {
189+
if let SelectedGroups(mut groups) = engine_result {
190190
match arguments.output_format {
191191
OutputFormat::Render => {
192-
render::render_objects(
193-
&mut groups,
194-
&hidden_selection,
195-
arguments.pagination,
196-
arguments.page_size,
197-
);
192+
render::render_objects(&mut groups, arguments.pagination, arguments.page_size);
198193
}
199194
OutputFormat::JSON => {
200-
let mut indexes = vec![];
201-
for (index, title) in groups.titles.iter().enumerate() {
202-
if hidden_selection.contains(title) {
203-
indexes.insert(0, index);
204-
}
205-
}
206-
207-
if groups.len() > 1 {
208-
groups.flat()
209-
}
210-
211-
for index in indexes {
212-
groups.titles.remove(index);
213-
214-
for row in &mut groups.groups[0].rows {
215-
row.values.remove(index);
216-
}
217-
}
218-
219195
if let Ok(json) = groups.as_json() {
220196
println!("{}", json);
221197
}
222198
}
223199
OutputFormat::CSV => {
224-
let mut indexes = vec![];
225-
for (index, title) in groups.titles.iter().enumerate() {
226-
if hidden_selection.contains(title) {
227-
indexes.insert(0, index);
228-
}
229-
}
230-
231-
if groups.len() > 1 {
232-
groups.flat()
233-
}
234-
235-
for index in indexes {
236-
groups.titles.remove(index);
237-
238-
for row in &mut groups.groups[0].rows {
239-
row.values.remove(index);
240-
}
241-
}
242-
243200
if let Ok(csv) = groups.as_csv() {
244201
println!("{}", csv);
245202
}

0 commit comments

Comments
 (0)