Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Overhaul query options #98

Merged
merged 12 commits into from
Jun 17, 2020

Conversation

adammitchelldev
Copy link
Contributor

@adammitchelldev adammitchelldev commented Jun 16, 2020

What is the goal of this PR?

We introduce modified infer, and new batch_size, and explain options for queries:

The default (undefined setting of the above options) value means that the server will automatically choose the default value for infer, explain, and batch_size. For reference, the server will default to infer = true, explain = true, and batch_size = 50.

** use explain:true if you want to retrieve explanations from your query ** This was introduced to ensure correct Explanations, without consuming too much Transaction memory when not required.

What are the changes implemented in this PR?

  • Introduce explain query option
  • Include batchSize query option into the query options, instead of iteration options
  • Throw exceptions if the types of parameters are passed in are incorrect.
  • Tests for explain and infer flag

queryMessage.setQuery(query);
if (options) {
if ('infer' in options) {
queryMessage.setInfer(options.infer ? INFER_TRUE_MESSAGE : INFER_FALSE_MESSAGE);
optionsMessage.setInferFlag(options.infer);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably check that these are boolean flags and throw error otherwise?

@@ -73,4 +73,8 @@ describe("Query methods", () => {
const results = await iterator.collect();
expect(results.length).toEqual(128);
})

it("accepts valid options", async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other tests required on explain, batch and infer flags

@flyingsilverfin flyingsilverfin merged commit 70621f2 into typedb:master Jun 17, 2020
dmitrii-ubskii pushed a commit to dmitrii-ubskii/typedb-client-nodejs that referenced this pull request Sep 1, 2023
## What is the goal of this PR?

fix typedb#98 

To fix an issue where getting meta types via concept API causes a cast error. The `MetaType` class should be treated as a `Type` so that it is compatible with regular type instances. This should prevents calls like `subs` on the meta type from incorrectly casting their subs to a `MetaType`.

## What are the changes implemented in this PR?

* `MetaType`s are treated like `Type` for the purposes of casting.
dmitrii-ubskii pushed a commit to dmitrii-ubskii/typedb-client-nodejs that referenced this pull request Sep 1, 2023
## What is the goal of this PR?

As it turns out, we still need to use Python 2 in `deploy-github`, just at a very specific stage of it.

## What are the changes implemented in this PR?

Before executing the actual deployment to GitHub, we switch back to Python 2 and clean the Bazel sandbox such that PyPI dependencies are refetched
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants