Skip to content

Commit 5aec62b

Browse files
committed
Update version to 3.0.0-alpha-6. Fix circleCI python dependencies. Update typedb driver dependency. Add a better usage of query types in printing
1 parent c30b96f commit 5aec62b

File tree

6 files changed

+47
-16
lines changed

6 files changed

+47
-16
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ commands:
7272
type: string
7373
steps:
7474
- run: |
75-
brew install python@3.8
75+
brew install python@3.9
7676
curl -OL "https://github.com/bazelbuild/bazelisk/releases/download/v1.17.0/bazelisk-darwin-<<parameters.bazel-arch>>"
7777
sudo mv "bazelisk-darwin-<<parameters.bazel-arch>>" /usr/local/bin/bazel
7878
chmod a+x /usr/local/bin/bazel

RELEASE_NOTES_LATEST.md

+36-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,44 @@
11
## Distribution
22

3-
Download from TypeDB Package Repository: https://cloudsmith.io/~typedb/repos/public-release/packages/?q=name:^typedb-console+version:3.0.0-alpha-4
3+
Download from TypeDB Package Repository: https://cloudsmith.io/~typedb/repos/public-release/packages/?q=name:^typedb-console+version:3.0.0-alpha-6
44

55

66
## New Features
7-
- **Introduce TypeDB 3.0-alpha Console**
8-
Reimagine TypeDB Console for the upcoming 3.0 release of TypeDB. This alpha version of the client lets you interact with the updated server, try out the new, even more elegant version of TypeQL, and get used to the new output format for data queries.
9-
Learn more about TypeDB 3.0 features here: https://typedb.com/blog/typedb-3-roadmap
10-
7+
- **Add fetch queries result printing.** We add `ConceptDocument` printer option to show the results of `fetch`
8+
queries.
9+
10+
That's how we print the `match` and `fetch` queries results now:
11+
```
12+
hi::read> match $x isa! person;
13+
14+
Finished validation and compilation...
15+
Streaming answers...
16+
17+
--------
18+
$x | iid 0x1e00000000000000000000 isa person
19+
--------
20+
21+
Finished. Total answers: 1
22+
hi::read> match $x isa! person; fetch {$x.*};
23+
24+
Finished validation and compilation...
25+
Streaming documents...
26+
27+
{
28+
"age": [ 25 ],
29+
"balance": [ "1234567890.000123456789" ],
30+
"birth-date": [ "2024-09-20" ],
31+
"birth-time": [ "1999-02-26T12:15:05.000000000" ],
32+
"current-time": [ "2024-09-20T16:40:05.000000000 Europe/London" ],
33+
"current-time-off": [ "2024-09-20T16:40:05.028129323+05:45" ],
34+
"expiration": [ "P1Y10M7DT15H44M5.003948920S" ],
35+
"is-new": [ true ],
36+
"name": [ "John" ],
37+
"success": [ 66.6 ]
38+
}
39+
40+
Finished. Total answers: 1
41+
```
1142

1243
## Bugs Fixed
1344

@@ -16,5 +47,3 @@ Download from TypeDB Package Repository: https://cloudsmith.io/~typedb/repos/pub
1647

1748

1849
## Other Improvements
19-
20-

TypeDBConsole.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import com.typedb.console.common.util.Java;
1515
import com.typedb.driver.TypeDB;
1616
import com.typedb.driver.api.Driver;
17+
import com.typedb.driver.api.QueryType;
1718
import com.typedb.driver.api.Transaction;
1819
import com.typedb.driver.api.answer.ConceptRow;
1920
import com.typedb.driver.api.answer.JSON;
@@ -713,20 +714,21 @@ private void runQuery(Transaction tx, String queryString) {
713714

714715
private void runQueryPrintAnswers(Transaction tx, String queryString) {
715716
QueryAnswer answer = tx.query(queryString).resolve();
717+
QueryType queryType = answer.getQueryType();
716718
if (answer.isOk()) {
717719
printer.info(QUERY_SUCCESS);
718720
} else if (answer.isConceptRows()) {
719721
Stream<ConceptRow> resultRows = answer.asConceptRows().stream();
720722
AtomicBoolean first = new AtomicBoolean(true);
721723
printCancellableResult(resultRows, row -> {
722-
printer.conceptRow(row, tx, first.get());
724+
printer.conceptRow(row, queryType, tx, first.get());
723725
first.set(false);
724726
});
725727
} else if (answer.isConceptDocuments()) {
726728
Stream<JSON> resultDocuments = answer.asConceptDocuments().stream();
727729
AtomicBoolean first = new AtomicBoolean(true);
728730
printCancellableResult(resultDocuments, document -> {
729-
printer.conceptDocument(document, first.get());
731+
printer.conceptDocument(document, queryType, first.get());
730732
first.set(false);
731733
});
732734
} else {

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.0-alpha-4
1+
3.0.0-alpha-6

common/Printer.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@ public void error(String s) {
5959
err.println(colorError(s));
6060
}
6161

62-
public void conceptRow(ConceptRow conceptRow, Transaction tx, boolean first) {
62+
public void conceptRow(ConceptRow conceptRow, QueryType queryType, Transaction tx, boolean first) {
6363
List<String> columnNames = conceptRow.columnNames().collect(Collectors.toList());
6464
int columnsWidth = columnNames.stream().map(String::length).max(Comparator.comparingInt(Integer::intValue)).orElse(0);
6565
if (first) {
66-
out.println(conceptRowDisplayStringHeader(conceptRow.getQueryType(), columnsWidth));
66+
out.println(conceptRowDisplayStringHeader(queryType, columnsWidth));
6767
}
6868
out.println(conceptRowDisplayString(conceptRow, columnNames, columnsWidth, tx));
6969
}
7070

71-
public void conceptDocument(JSON conceptDocument, boolean first) {
71+
public void conceptDocument(JSON conceptDocument, QueryType queryType, boolean first) {
7272
if (first) {
73-
out.println(conceptDocumentDisplayHeader(QueryType.READ)); // TODO: Get the query type from the document when available
73+
out.println(conceptDocumentDisplayHeader(queryType));
7474
}
7575
out.println(conceptDocumentDisplay(conceptDocument));
7676
}

dependencies/vaticle/repositories.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ def vaticle_typedb_driver():
1515
git_repository(
1616
name = "vaticle_typedb_driver",
1717
remote = "https://github.com/typedb/typedb-driver",
18-
commit = "32152553cea3e8af6e1ef616ea626693d76e6228", # sync-marker: do not remove this comment, this is used for sync-dependencies by @vaticle_typedb_driver
18+
tag = "3.0.0-alpha-6", # sync-marker: do not remove this comment, this is used for sync-dependencies by @vaticle_typedb_driver
1919
)

0 commit comments

Comments
 (0)