Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define queries support in TypeQL Rust #240

Merged
merged 15 commits into from
Oct 26, 2022

Conversation

dmitrii-ubskii
Copy link
Member

@dmitrii-ubskii dmitrii-ubskii commented Oct 24, 2022

What is the goal of this PR?

We add support for schema queries, viz. define/undefine, and schema query concepts such as rules.

What are the changes implemented in this PR?

Implement data structures, builder functions, and parser visitors for:

  • define query;
  • undefine query;
  • rule;
  • abstract.

Misc:

  • factored out common parser boilerplate;
  • polished off the overridden type handling in owns and plays and fixed some bugs related to them;
  • migrated from Grabl to Vaticle Factory.

@typedb-bot
Copy link
Member

typedb-bot commented Oct 24, 2022

PR Review Checklist

Do not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed.


Code

  • Packages, classes, and methods have a single domain of responsibility.
  • Packages, classes, and methods are grouped into cohesive and consistent domain model.
  • The code is canonical and the minimum required to achieve the goal.
  • Modules, libraries, and APIs are easy to use, robust (foolproof and not errorprone), and tested.
  • Logic and naming has clear narrative that communicates the accurate intent and responsibility of each module (e.g. method, class, etc.).
  • The code is algorithmically efficient and scalable for the whole application.

Architecture

  • Any required refactoring is completed, and the architecture does not introduce technical debt incidentally.
  • Any required build and release automations are updated and/or implemented.
  • Any new components follows a consistent style with respect to the pre-existing codebase.
  • The architecture intuitively reflects the application domain, and is easy to understand.
  • The architecture has a well-defined hierarchy of encapsulated components.
  • The architecture is extensible and scalable.

rust/parser/mod.rs Show resolved Hide resolved
rust/builder/mod.rs Show resolved Hide resolved
rust/parser/test/mod.rs Show resolved Hide resolved
rust/parser/test/mod.rs Show resolved Hide resolved
rust/pattern/constraint/type_/owns.rs Show resolved Hide resolved
rust/pattern/schema/rule.rs Outdated Show resolved Hide resolved
rust/pattern/variable/builder/type_.rs Show resolved Hide resolved
rust/pattern/constraint/type_/mod.rs Outdated Show resolved Hide resolved
rust/pattern/variable/type_.rs Show resolved Hide resolved
rust/typeql_lang.rs Show resolved Hide resolved
@dmitrii-ubskii dmitrii-ubskii changed the title Typeql rust Schema queries support in TypeQL Rust Oct 24, 2022
@dmitrii-ubskii dmitrii-ubskii marked this pull request as ready for review October 24, 2022 15:59
@dmitrii-ubskii dmitrii-ubskii changed the title Schema queries support in TypeQL Rust Define queries support in TypeQL Rust Oct 25, 2022
rust/pattern/constraint/type_/mod.rs Outdated Show resolved Hide resolved
rust/pattern/variable/builder/type_.rs Show resolved Hide resolved
rust/query/typeql_undefine.rs Show resolved Hide resolved
Copy link
Member

@alexjpwalker alexjpwalker left a comment

Choose a reason for hiding this comment

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

Left some comments.

@dmitrii-ubskii dmitrii-ubskii merged commit 6bb3c0f into typedb:master Oct 26, 2022
alexjpwalker pushed a commit to alexjpwalker/typeql that referenced this pull request Nov 2, 2022
## What is the goal of this PR?

We add support for schema queries, viz. `define`/`undefine`, and schema
query concepts such as rules.

## What are the changes implemented in this PR?

Implement data structures, builder functions, and parser visitors for:
- `define` query;
- `undefine` query;
- `rule`;
- `abstract`.

Misc:
- factored out common parser boilerplate;
- polished off the overridden type handling in `owns` and `plays` and
fixed some bugs related to them;
- migrated from Grabl to Vaticle Factory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants