DBX-6700 Query-based compiler & Multifile support#870
Open
huydo862003 wants to merge 223 commits intomasterfrom
Open
DBX-6700 Query-based compiler & Multifile support#870huydo862003 wants to merge 223 commits intomasterfrom
huydo862003 wants to merge 223 commits intomasterfrom
Conversation
… injection errors
…ection to local validator
# Conflicts: # dbml-playground/package.json # packages/dbml-core/types/index.d.ts # packages/dbml-parse/__tests__/examples/compiler/syncDiagramView.test.ts # packages/dbml-parse/src/compiler/queries/transform/syncDiagramView.ts # packages/dbml-parse/src/core/interpreter/interpreter.ts
f8a23ed to
5907cf7
Compare
dc60fa9 to
ec99c50
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BREAKING CHANGE: Revamp the compiler into query-based design.
Add multifile support into compiler:
use: Non-transitive importsreuse: Transitive importsTable,Enum,TableGroup,Schema,Note(sticky note),TablePartialRef,Recordsare automatically pulled if all of its tables are in scope.TableGroupimport would also import all of its tables.TableGroupcannot reference imported table, it can only reference the current file's table (for now).Schemaimport would pull all elements inside that schema into scope.Discussion: [Proposal] Support splitting DBML to multiple files #843
TDD:
Suggested review order
Filepath,SyntaxNode,NodeSymboland the internable typesInternable.compiler.tsfile:a. Check how the local cache & the global cache are setup (
localQueryandglobalQuerymethods).b. Check what queries we have: https://www.notion.so/holistics/TDD-94-Query-based-compiler-Overview-of-the-compiler-architecture-345f89dc7e4980e88bc9fd6d140c1d8b?v=b4c7e791a9664e779faf139f7f7bda40&source=copy_link#345f89dc7e49804f8f0edca6282a32c8
lexer,parser.local_modulesfor validator (do not care about multifile support yet).global_modulesfor binder and interpreter (do not care about multifile support yet).use.Issue
(issue link here)
Lasting Changes (Technical)
(please list down: code changes/things that have wide-effect; new libraries/functions added that can be used by others; examples below)
class EmailValidatorto validate email address' validity)Tenant#is_trial?check)Checklist
Please check directly on the box once each of these are done