Skip to content

Add variable binding behaviour tests#413

Merged
dmitrii-ubskii merged 11 commits intotypedb:masterfrom
krishnangovindraj:variable-binding-behaviour-tests
Apr 20, 2026
Merged

Add variable binding behaviour tests#413
dmitrii-ubskii merged 11 commits intotypedb:masterfrom
krishnangovindraj:variable-binding-behaviour-tests

Conversation

@krishnangovindraj
Copy link
Copy Markdown
Member

@krishnangovindraj krishnangovindraj commented Apr 1, 2026

Usage and product changes

Tests variable binding behaviour cases ranging disjunctions

@krishnangovindraj krishnangovindraj force-pushed the variable-binding-behaviour-tests branch from 704b17b to 91346eb Compare April 1, 2026 11:53
@krishnangovindraj krishnangovindraj self-assigned this Apr 20, 2026
@krishnangovindraj krishnangovindraj marked this pull request as ready for review April 20, 2026 08:44
Comment on lines +25 to +33
#
# Given connection open write transaction for database: typedb
# When typeql write query
# """
# insert
# $_ isa number 1;
# $_ isa number 11;
# """
# Then transaction commits
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

?


Scenario: Variables which occur in only some branches of a disjunction and are NOT BOUND in a parent conjunction are not available in the root & subsequent stages
Given connection open read transaction for database: typedb
Then typeql read query; fails with a message containing: "The variable 'x' is required to be bound to a value before it's used"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You sometimes have variable x and sometimes variable 'x' (in single quotes). Not very consistent.


Scenario: Variables are not available in subsequent stages if they are aggregated over by a reduce stage
Given connection open read transaction for database: typedb
Then typeql read query; fails with a message containing: "Invalid query containing unbound concept variable x"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think "concept variable" is a useful distinction here. It's a variable.

@dmitrii-ubskii dmitrii-ubskii merged commit 29a68e7 into typedb:master Apr 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants