Commit Graph

52 Commits

Author SHA1 Message Date
dependabot[bot]
6e537f0e76 Bump @vitest/coverage-v8 from 1.2.2 to 1.3.1 (#21512)
Bumps [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8) from 1.2.2 to 1.3.1.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v1.3.1/packages/coverage-v8)

---
updated-dependencies:
- dependency-name: "@vitest/coverage-v8"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-22 02:16:48 +01:00
dependabot[bot]
5f974aaef1 Bump dependency-cruiser from 16.2.0 to 16.2.1 (#21467)
Bumps [dependency-cruiser](https://github.com/sverweij/dependency-cruiser) from 16.2.0 to 16.2.1.
- [Release notes](https://github.com/sverweij/dependency-cruiser/releases)
- [Changelog](https://github.com/sverweij/dependency-cruiser/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sverweij/dependency-cruiser/compare/v16.2.0...v16.2.1)

---
updated-dependencies:
- dependency-name: dependency-cruiser
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-19 10:20:21 +01:00
dependabot[bot]
01d3b3f524 Bump vitest from 1.2.2 to 1.3.0 (#21468)
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 1.2.2 to 1.3.0.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v1.3.0/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-19 09:59:45 +01:00
dependabot[bot]
24758103ac Bump @types/node from 18.19.15 to 18.19.17 (#21450)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.19.15 to 18.19.17.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-16 08:21:33 +01:00
Jan Arends
673e516d5b Durus: Selection of properties from a object stored in a JSON field (#21158)
* defined json node

* query json field test

* activated json node in ASQL

* renamed test

* replaced dedicated node with existing 'nested' node

* added abstract sql json node

* test for conversion

* another jest test

* added test for picking an attribute which is an array

* randomized values in test

* converted from tree to path list

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>

* added a column index per json path

* skip TDD tests for now

* adjusted abstract sql json type

Co-authored-by: Nicola Krumschmidt <nickrum@users.noreply.github.com>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>

* overall field conversion test for json

Co-authored-by: Nicola Krumschmidt <nicola.krumschmidt@freenet.de>

* one node per json path

* removed empty lines

* fixed linter

* integrated json node conversion

* integrated json conversion

* renamed variable

* enhanced test and fixed bug

Co-authored-by: Brainslug <tim@brainslug.nl>

* randomized values for test

* fixed func call

* test for json select in driver

* simple json support in driver

* moved json path into the list of parameters

* used operator in pg driver to return an object by key

* fixed tests

* fixed circular dep

* finalized test in driver

* renamed node

* renamed interface type

* Simplify json path accumulation

Co-authored-by: Jan Arends <jaads@users.noreply.github.com>

* Move object type to its own file

* Rename object type name for consistency

* Improve variable naming in test

* Fix formatting

---------

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: Nicola Krumschmidt <nickrum@users.noreply.github.com>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Nicola Krumschmidt <nicola.krumschmidt@freenet.de>
Co-authored-by: Brainslug <tim@brainslug.nl>
Co-authored-by: Jan Arends <jaads@users.noreply.github.com>
2024-02-14 23:30:28 +01:00
Rijk van Zanten
bad22bf1ff v10.9.2 2024-02-14 11:21:02 -05:00
Pascal Jufer
206a7cae0b Update dependencies (#21428) 2024-02-14 12:12:50 +01:00
dependabot[bot]
42c3d83b14 Bump tsup from 8.0.1 to 8.0.2 (#21410)
Bumps [tsup](https://github.com/egoist/tsup) from 8.0.1 to 8.0.2.
- [Release notes](https://github.com/egoist/tsup/releases)
- [Changelog](https://github.com/egoist/tsup/blob/dev/.releaserc.json)
- [Commits](https://github.com/egoist/tsup/compare/v8.0.1...v8.0.2)

---
updated-dependencies:
- dependency-name: tsup
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-13 09:07:07 +01:00
dependabot[bot]
d27604dced Bump dependency-cruiser from 16.1.0 to 16.2.0 (#21348)
Bumps [dependency-cruiser](https://github.com/sverweij/dependency-cruiser) from 16.1.0 to 16.2.0.
- [Release notes](https://github.com/sverweij/dependency-cruiser/releases)
- [Changelog](https://github.com/sverweij/dependency-cruiser/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sverweij/dependency-cruiser/compare/v16.1.0...v16.2.0)

---
updated-dependencies:
- dependency-name: dependency-cruiser
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 13:18:18 +01:00
dependabot[bot]
2345b2a1ec Bump @types/node from 18.19.12 to 18.19.14 (#21347)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.19.12 to 18.19.14.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 13:17:25 +01:00
Rijk van Zanten
d3874a8f19 v10.9.0 2024-02-06 14:29:32 -05:00
dependabot[bot]
e6572992c9 Bump @types/node from 18.19.10 to 18.19.12 (#21269)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.19.10 to 18.19.12.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-01 02:33:26 +01:00
Nicola Krumschmidt
1acbe2535f Make relational node names less confusing (#21213)
* Change relational-many node type string to relational-single

* Rename relational-single type to align with type string

* Change relational-any node type string to relational-union

* Rename relational-union type to align with type string
2024-01-29 12:43:45 +01:00
Pascal Jufer
86aedeb27c Patch Tuesday 🐸 (#21221)
* Update root deps

* Update `@directus/api` deps

* Update `@directus/app` deps

* Update `docs` deps

* Update `@directus/components` deps

* Update `@directus/composables` deps

* Update `create-directus-extension` deps

* Update `create-directus-project` deps

* Update `@directus/data` deps

* Update `@directus/data-driver-postgres` deps

* Update `@directus/data-sql` deps

* Update `@directus/env` deps

* Update `@directus/extensions` deps

* Update `@directus/extensions-sdk` deps

* Update `@directus/memory` deps

* Update `@directus/random` deps

* Update `@directus/release-notes-generator` deps

* Update `@directus/storage` deps

* Update `@directus/storage-driver-cloudinary` deps

* Update `@directus/storage-driver-local` deps

* Update `@directus/storage-driver-s3` deps

* Update `@directus/storage-driver-supabase` deps

* Update `@directus/stores` deps

* Update `@directus/themes` deps

* Update `@directus/update-check` deps

* Update `@directus/utils` deps

* Update `@directus/validation` deps

* Update `tests/blackbox` deps

* Add changeset

* Bump pnpm to 8.15.0

* Update GH actions
2024-01-28 22:56:34 +01:00
Pascal Jufer
2584bd5330 Update vitest to v1.2.2 (#21216) 2024-01-28 13:43:53 +01:00
Jan Arends
578cbb0146 Durus refactoring: New directory for node conversions (#21168)
* used existing type for definition

* created directory to convert the actual nodes
2024-01-23 12:01:38 +01:00
Nicola Krumschmidt
b230d0695c Use table and column indices instead of random unique aliases (#20843)
* Make "as" required on abstract SQL select nodes

* Adjust driver to always expect as

* Replace parameter index generator with general purpose one

* Use table and column indices instead of unique aliases

* Fix and refactor data-sql tests

* Adjust postgres driver to use table and column indices

* adopted query unit tests

* adopted index file tests in driver

* adopted utility tests in driver

* deleted unused variables

* moved indexing logic into converter specific utils folder

* tiny reference fix

* removed mock

* Remove mock variable from orderBy test

* Move index to identifier functions to data-sql

* Rename columnIndexToName in tests and parameters

---------

Co-authored-by: Jan Arends <jan.arends@mailbox.org>
2024-01-12 18:30:32 +00:00
dependabot[bot]
9dda56c924 Bump vitest from 1.1.0 to 1.1.1 (#20931)
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v1.1.1/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-02 00:57:30 +01:00
Rijk van Zanten
c45cd69dd7 v10.8.3 2023-12-21 14:19:08 -05:00
Pascal Jufer
98532788d5 Selective Patch Tuesday 🐸 (#20796) 2023-12-20 00:26:15 +01:00
Pascal Jufer
5e72ea1b08 Patch Tuesday 🐸 (#20714) 2023-12-12 04:36:50 +01:00
Pascal Jufer
1a07d7355d Update TypeScript to 5.3.3 (#20710) 2023-12-11 20:39:34 +01:00
Pascal Jufer
81c9156508 Update Vitest to v1 (#20694) 2023-12-10 19:49:45 +01:00
Nicola Krumschmidt
e57312a2f2 Add select node to abstract SQL that combines primitive and fn (#20654) 2023-12-06 17:29:00 +01:00
Nicola Krumschmidt
4f2a90c345 Split up abstract sql in root and sub query (#20638)
* Split up abstract sql in root and sub query

* Finish new root/sub query abstract sql mechanism

Co-authored-by: Jan Arends <jaads@users.noreply.github.com>

* playground

* Fix getMappedQueriesStream by closing controller

Co-authored-by: Jan Arends <jaads@users.noreply.github.com>

* Add double nested o2m example to playground

* adopted test to create o2m sub queries

* adopted more tests

* more test fixes

* removed playground again

* Fix tests

Co-authored-by: Jan Arends <jaads@users.noreply.github.com>

* Remove orm dir and move contents to utils

* Add tests for mapResult

* Remove orm export

---------

Co-authored-by: Jan Arends <jaads@users.noreply.github.com>
Co-authored-by: Jan Arends <jan.arends@mailbox.org>
2023-12-06 15:07:11 +00:00
Jan Arends
08bbe27794 Durus: nested type refactoring (#20553)
* initial thoughts

* optional meta data for a2o with json

* added test

* some docs

* Adjust abstract query to support single column any relations

* fix build

* added relational any option to nested one

* applied type refactoring in converter

* improved a2o relation definition

* no pk column name in any json column

* added place for a2o sub query generator

* docs on type

* deleted test

Co-authored-by: Nicola Krumschmidt <nickrum@users.noreply.github.com>

* docs

* reverted preps

* renamed meta to nesting

* removed reverted prep

* removed unnecessary check

* docs

* renamed meta

Co-authored-by: Nicola Krumschmidt <nicola.krumschmidt@freenet.de>

---------

Co-authored-by: Nicola Krumschmidt <nicola.krumschmidt@freenet.de>
Co-authored-by: Nicola Krumschmidt <nickrum@users.noreply.github.com>
2023-12-04 18:18:55 +00:00
Pascal Jufer
d30bb69490 Clean-up deps (#20581) 2023-11-30 00:46:09 +01:00
Pascal Jufer
a5215d674b Update TypeScript to 5.3.2 (#20571) 2023-11-29 13:54:56 +01:00
Pascal Jufer
ba7fac402e Update Prettier v3.1.0 (#20481) 2023-11-20 16:23:22 +01:00
Pascal Jufer
454ecdbefe Update Vitest to v0.34.6 (#20477) 2023-11-20 13:04:56 +01:00
Nicola Krumschmidt
d9bd5adeb1 Refactor the file structure in data-sql (#20433)
* Refactor data-sql types file structure

* used types dir directly

* target conversion outside of conditions, file for filter conversion result

* type import only via index file

* removed unused index files

* Refactor data-sql types file structure

* used types dir directly

* target conversion outside of conditions, file for filter conversion result

* type import only via index file

* removed unused index files

* fixed tests

* rename

---------

Co-authored-by: Jan Arends <jan.arends@mailbox.org>
2023-11-17 20:41:25 +01:00
Jan Arends
a920cd3978 Durus: Modifiers on o2m (#20411)
* docs

* added todo test

* refactoring

* refactoring

* convert filter

* conversion of all modifiers

* added more modifiers to test

* fixed tests

* test for various things

* Fix joins in nested many generation

---------

Co-authored-by: Nicola Krumschmidt <nicola.krumschmidt@freenet.de>
2023-11-16 10:01:23 +01:00
Nicola Krumschmidt
d5861365e9 Make modifiers and aliases on abstract queries required (#20393)
* Make modifiers on abstract queries required

Since the properties on the modifiers object are already optional, we can explicitly require the modifiers property

* Require at least one element if sort modifier is present

* Make aliases on abstract queries required

* Remove alias from abstract sql

* Always use aliases when generating alias mapping
2023-11-15 12:02:32 +01:00
Jan Arends
5c7c79dfc2 Durus sorting on an m2o field (#20357)
* Changed sort conversion to support nested targets

* Refactoring in sort test

* integrated new sort conversion

* formatting

* removed type errors

* test for sort in modifier conversion

* remove unneeded stuff from driver

* fixed tests

* removed unused type

* support functions for sort

* Remove not needed error handling

* Allow sorting by functions in query converter

---------

Co-authored-by: Nicola Krumschmidt <nicola.krumschmidt@freenet.de>
2023-11-10 19:48:28 +00:00
Jan Arends
6f0205d054 Durus: Filtering on m2o relations (#20222)
* initial ideas

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Nicola Krumschmidt <nickrum@users.noreply.github.com>
Co-authored-by: ian <licitdev@users.noreply.github.com>

* removed function as target again

* converter test like the rest

* TDD test for converter

* TDD test for pg statement creation

* fix

* convert nested condition target

* test for function target conversion

* made condition nodes return join clause for nested filter

* handled the additional join for logical nodes

* adopted changes in filter test

* fixed test

* added join to modifiers

* Allow same target in all conditions

* Fix AbstractSqlQueryOrderNode type

* Fix deeply nested filter conversion

* Fix condition converters with nested target

* Make filter result clauses required

* Fix merging joins

* Fix convertLogical type

* Allow all SQL condition nodes to be functions

* fixed test

* rename

* new test, separated integration tests

* remove duplicated joins

* formatter

* fixed string condition

* adopted tests

* preparation for sort

* removed test complexity drastically

* clean up join duplicate removal

* unit test for modifier conversion

* reverted converter test

* removed join duplication removal

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Nicola Krumschmidt <nickrum@users.noreply.github.com>
Co-authored-by: ian <licitdev@users.noreply.github.com>
Co-authored-by: Nicola Krumschmidt <nicola.krumschmidt@freenet.de>
2023-11-10 18:40:47 +01:00
Jan Arends
b2fe81b596 Durus o2m field selects for PostgreSQL (#20037)
* 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>
2023-10-27 12:19:46 -04:00
Pascal Jufer
e987c1990e 10.6.4 (#20102) 2023-10-20 18:55:45 +00:00
Nicola Krumschmidt
2fed2670c8 Remove root property from AbstractQuery and minor cleanup (#19992)
* Move fields file out of fields folder

* Remove root property from AbstractQuery
2023-10-11 00:00:26 +02:00
Nicola Krumschmidt
6c45914b8a Split up related field node type in data abstraction layer (#19942)
* Fix casing in file names

* Refactor file structure

* Split up related field node

* formatter

* renamed fields-node.ts to fields.ts

* Small grammar fix in comment

Co-authored-by: Jan Arends <jan.arends@mailbox.org>

---------

Co-authored-by: Jan Arends <jan.arends@mailbox.org>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-10-09 10:12:42 -04:00
Jan Arends
d6e6208c26 Data abstraction: Field selection, modifiers and m2o for PostgreSQL driver (#19146)
* Naming typo

* First experiments

* Setup testing playground

* Fetch in client stream

* Add logging

* Remove unneeded stream to string util

* added logical operator to complex test and cleanup

* Improve typing

* started adding function support

* Support nested m2o in data-sql

* Implement join sql string creation

* It's alive!

* Remove unused aliases

* Add todo reminder

* fix build

* small improvements for fn conversion

* function conversion in pg driver

* more expressive typedocs

* toMatchObject in data sql to ignore alias and path

* added type to sort node

* moved and fixes tests for comparison

* moved condition tests

* separate file for functions

* test for function condition

* added proper args to function although not in use

* AT TIME ZONE 'UTC' when needed, proper arg value

* intersects support in pg driver

* convert geo value

* docs for intersects

* reworked column as function input

* support for functions in abstract select

* fixes tests

* count support in select

* refactoring: split up filter conversion

* starting every and some operators

Co-authored-by: Nicola Krumschmidt <nickrum@users.noreply.github.com>

* extracted variable in test

* in operator with sub query support

* split up conditions type into multiple types

* type for a single query parameter

* condition type

* intersects_bbox in pg driver

* finalized type declarations

* geo condition types

* pnpm lock update

* removed playground

* join

* fixed geo

* fixed types in test

* changeset

* made path prop required again

* geojson for intersects to the driver

* removed sub query from set-condition

* clean up form sub query removal

* added between support

* fixed geo condition test type

* formatting

* moved number operators to utils

* xy-condition to condition-xy

* remove between

* between clean up

* formatter

* refactoring: split up condition generation

* changeset

* split up type for geo condition

* refactoring: split up conditions converter

* fix formatter

* split up types

* split up abstract query into multiple files

* export fix

* split up condition builders in pg driver

* enabled all functions in select and nr condition

* adjusted join conversion and added test

* added test for node conversion

* moved index generator to converter dir

* docs

* format fix

* split up abstract query types further

* split up abstract sql types further

* split ups in converter and fine granular tests

* fix format

* proper index file in converter

* proper type for generator

* more docs on data-sql

* updated data readme

* readme tweaks

* removed circular dependency and added union type

* moved create-identifier function

* added index file in sql utils

* comment on converter usage

* removed circular deps in sql types

* last dependency fixes in data sql

* fixed tests

* cleanup up dependencies in overall abstract query

* removed base type to reduce noise

* reduce some index files in sql types declaration

* formatter

* more dependency tweaks

* formatter

* graphs for data and data-sql

* added dependency cruiser

* added lock file

* pnpm downgrade 8.6.0 to fixed lock file

* try fixing again with 8.6.2

* formatting

* formatting, now with correct formatter

* fixed dependencies

* formatter

* extracted variable for more readable code

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>

* formatter

* fixed export of condition types for driver

* consistent file naming for conditions

* updated docs

* type fix

* removed todo

* another type fix

* split up expand func and added test

* todo test for driver class

* fixed unit test

* fixed typo

* removed todo, though about it, it's good as it is

* separated path map creation from query-converter

* renamed converter to query-converter

* user specific aliases for primitives

* fixed linter

* user specified alias for m2o

* documentation

* redesigned the function types and added alias support

* formatter

* unit test for pg driver index file

* moved call to source as class member

* moved alias map creation back to converter

* moved unique alias generation to ORM

* tsup update

* renamed nodes to fields

* redefined return type of query converter

* modifier conversion similar to fields conversion

* added response converter dir again

* aligned unit tests

* fixed circular dependency

* moved orm logic one level up again

* formatter

* removed SVGs

* Update pull_request_template.md

* Update pull_request_template.md

* Run formatter

* a bit renaming and restructuring

* formatter

---------

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
Co-authored-by: Nicola Krumschmidt <nickrum@users.noreply.github.com>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
2023-10-06 09:32:04 -04:00
Pascal Jufer
e1dd6fa037 Update TS related dependencies and configurations (#19866) 2023-09-29 14:45:47 +02:00
Pascal Jufer
c67775a9a0 Bundle packages (#19712)
* Bundle `@directus/composables`

* Bundle `@directus/constants`

* Align tsconfig in `data` packages

To prevent warnings like
> Cannot write file 'packages/data-sql/dist/index.d.ts' because it would overwrite input file

* Bundle `@directus/pressure`

* Align tsconfig in `@directus/random`

* Bundle `@directus/schema`

* Bundle `@directus/storage`

* Bundle `@directus/storage-driver-azure`

* Bundle `@directus/storage-driver-cloudinary`

* Bundle `@directus/storage-driver-gcs`

* Bundle `@directus/storage-driver-local`

* Bundle `@directus/storage-driver-s3`

* Align tsconfig in `@directus/themes`

* Bundle `@directus/update-check`

* Add changeset

* Bundle `storage-driver-supabase`

* Update changeset

* Remove dedicated export of 'types/overview'
2023-09-26 21:14:27 +08:00
rijkvanzanten
373cc9f4fa v10.5.0 2023-07-25 17:36:33 -04:00
Pascal Jufer
e583c6b6ea Add tsconfig for Vue & CJS (#19197)
* Add tsconfig for Vue

* Delete tsconfig.json

* Use vue tsconfig for composables

* Add changeset

* Update changeset

* Update changeset
2023-07-18 17:36:16 -04:00
rijkvanzanten
d3c9de9dfb v10.4.3 2023-07-11 16:00:17 +02:00
Jan Arends
84bd5d0ef3 Basic filters for PostgreSQL driver (#19005)
* conversion to abstract sql

* greater than for where clause in pg driver

* refactoring

* forward targets again

* more filter options and fixes

* added filters, moved operator mapping into driver

* removed trim

* add changeset

* removed first type approach

* enhanced abstract sql

* value and set comparison in abstract query

* split up where and intersect again

* preps for where comparison to a set

* typedocs

* fix linter

* The random things we did, who knows

* adding logical conditions (WIP)

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Nicola Krumschmidt <nickrum@users.noreply.github.com>

* Push values to parameters directly

* Fix convert test

* Fix convert filter tests

* Implement filter conversion for logical and negate nodes

* Fix where tests

* Add logical where stringification

* Negate comparison operators directly

* Remove some unneeded parentheses

* Improve parameter index generator type

* Fix formatter issues

* Add todo statements

* Remove unused node type

* Removed unneeded check

* One more unnecessary check

---------

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
Co-authored-by: Nicola Krumschmidt <nickrum@users.noreply.github.com>
Co-authored-by: Nicola Krumschmidt <nicola.krumschmidt@freenet.de>
2023-07-02 15:10:55 +02:00
Connor
92621429ee Linting and Formatting Upgrade (#18892)
* add docs to eslint

* update prettier ignore

* fix vitepress linting

* eslint ignore fixes

* prettier run

* update prettier ignore

* fix formatting

* enable linting of markdown files

* revert format command change

* fix irregular whitespace

* update dictionary

* (Changelog) Create four-boxes-shake.md

* Rework ESLint / Prettier setup

- Disable js/ts/vue files for Prettier to ensure linting/formatting is
  only happening via ESLint
- Rework formatting of code blocks in md files
  - Disable formatting of code blocks in md files under '/docs' by Prettier
  - Instead use "eslint-plugin-markdown" to format & __lint__ js*/ts*/vue such code blocks
  - Replace unmaintained "eslint-plugin-md" plugin by official "eslint-plugin-markdown" plugin
  - I'll check whether we can use this to format other code blocks
    (json, html, ...) as well
- Restructure, clean-up and apply some fixes to the ESLint config
  (Note: Not ready for flat config yet since not supported by
  vscode-eslint)
- Enable cache for ESLint / Prettier in scripts
- Clean-up ignore file
  - Explicit folder declaration (.../)
  - Don't ignore all 'extensions' folders in ESLint (only
    '/api/extensions/')
  - Enable formatting in '/.github' folder

* Fix all formatting issues with Prettier

* Update md files under /docs/.typedocs

* Fix lint issues in vue/js files

* ESLint / Prettier config revision v2

Enable Prettier for md code blocks, but only as warnings since it can
get into the way with Vitepress md extensions like '[!code ...]'
comments

* Remove prettier-ignore comments

* Make spellchecker happy

* Remove changeset

* Revert lint setup for code blocks

There are many cases in the docs where linting / formatting of code
blocks doesn't make
sense:
- Code block is only an excerpt - linter fails
- Code block contains special comments (e.g. markdown extensions) which
  needs to remain at the same place - formatting would break it
- ...

* Apply lint issues / formatting from temp lint setup

* Run formatter

* Fix merge failure

* Simplify & modernize ESLint / Prettier setup

No longer run Prettier via ESLint. Nowadays, this is the recommended
setup. There's no real need to run it this way, it's just an additional
layer.

Add VS Code settings to make the work with the new setup easier.

* Remove unused eslint disable directives

* Make editorconfig more useful

* Fix formatting issues reported by editorconfig

* Format files with Prettier

* Enable formatting of source translations file

* Format source translations file

* Remove unnecessary console error

* Remove unnecessary line

* Only ignore md files under .changeset

* Add CI reporter for Prettier

* Fail job on wrongly formatted files

* Fix format

* Test Prettier action on changed/added file

* Use simple CI format check for now & no cache

* Revert "Test Prettier action on changed/added file"

This reverts commit 4f7d8826ad.

* Introduce code blocks check for docs

* Fix code block issues

* Ignore auto-generated packages dir

* Fix comment position

* Also lint `/app/.storybook`

* Reformat modified files

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2023-06-29 11:54:01 +02:00
rijkvanzanten
2239ef8db7 v10.4.0 2023-06-27 17:43:26 -04:00
Jan Arends
0fea5ab016 converted abstract sort modifier (#18938)
* converted sort

* update comment

* changeset

* change wording

* renamed converter tests

* updated docs

* Change changeset description

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

* docs

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-06-20 10:36:44 -04:00
Jan Arends
1cbae4952c Limit and offset modifiers for Postgres driver (#18894)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2023-06-19 15:51:12 +02:00