mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
* test to split up root query into sub queries * moved splitter to driver * moved splitter to data-sql * filtered o2m within conversion * removed splitter * fix * fix * util to get root query * refactoring, preparation for root and sub queries * preparations for making separate sub queries * refactoring * implemented creation of sub query * made store in relational metadata mandatory * fixed export * abstracted the database request * get root query definition * preparation to merge streams * started converting nested many queries in converter Co-authored-by: Nicola Krumschmidt <nickrum@users.noreply.github.com> * refactoring * at least two childnodes for logical operator * refactoring missing module * fixed tests for fields * refactoring, mainly rename current to internal * start integrating second approach * getting closer but wip * getting closer * fixed naming * merged streams into final stream Co-authored-by: Brainslug <br41nslug@users.noreply.github.com> * fixed returning array Co-authored-by: Nicola Krumschmidt <nickrum@users.noreply.github.com> * added generic type * use existing many join node again * fixed test * made use of generic type * changed wording for relational stuff * composite keys * new generator for sub query parameters Co-authored-by: Nicola Krumschmidt <nickrum@users.noreply.github.com> * worked on index test * more specific return type for driver * fixed index file tests * removed approach on abstract query level * worked on index test but wip * simple test for nested many node * continued on index test * finally finished test * randomized test values again * moved common nested many logic up to data-sql * remove closing controller * typedocs and error handling * single test for nested many querying logic * refactor: added utility function for streams * Remove unneeded type declaration * Remove bind call * Use AtLeastOneElement type alias * Use unknown instead of any as value of Records * Rename loadAllResultIntoMemory to readToEnd * Fix o2m with compound keys * Fix type error in createJoin * Simplify AbstractSqlNestedMany type * catch error of conversion in data-sql * removed additional error handling in driver * replaced table alias with actual table name * Allow join field values to be numbers again * Clarify property names on AbstractSqlNestedMany some more * nested many node creation tests * docs --------- Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch> Co-authored-by: Nicola Krumschmidt <nickrum@users.noreply.github.com> Co-authored-by: Brainslug <br41nslug@users.noreply.github.com> Co-authored-by: Nicola Krumschmidt <nicola.krumschmidt@freenet.de>
@directus/data-sql
A package which all SQL drivers use. Is consists out of three individual parts:
- A set of types, which defines the abstract SQL query language.
- A query converter, which converts an abstract query into the abstract SQL query.
- A database response converter which converts the flat database response into a nested object in regards to tables that have been joined. It also replaces the actual column name from the database, with an user specified alias if one was provided.
- Some smaller utility functions, like for converting operators into SQL equivalents
Installation
npm install @directus/data-sql
Current architecture of this package
To get an overview of how the package is organized regarding it's files, directories and the dependencies between them,
run pnpm run depcruise and have a look in the created dependency-graph.svg image.