vapor / sql-kit

*️⃣ Build SQL queries in Swift. Extensible, protocol-based design that supports DQL, DML, and DDL.
MIT License
248 stars 58 forks source link

Add support for nested subpath (JSON) expressions #169

Closed gwynne closed 1 year ago

gwynne commented 1 year ago

Adds a new (defaulted) SQLDialect method for correctly generating JSON subpath syntax on a per-dialect basis. Add SQLNestedSubpathExpression to enable actually invoking the method.

Related PRs for PostgresKit, MySQLKit, and SQLiteKit will be forthcoming, followed by a series of PRs against FluentKit, FluentPostgresDriver, FluentMySQLDriver, and FluentSQLiteDriver. (Yep, gotta update everything to properly leverage this, thanks to it having been handled incorrectly all this time!)

codecov-commenter commented 1 year ago

Codecov Report

Merging #169 (3b7b760) into main (5026e7c) will decrease coverage by 1.09%. The diff coverage is 19.23%.

:exclamation: Current head 3b7b760 differs from pull request most recent head 00e83ac. Consider uploading reports for the commit 00e83ac to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #169 +/- ## ========================================== - Coverage 71.44% 70.35% -1.09% ========================================== Files 94 96 +2 Lines 2444 2496 +52 ========================================== + Hits 1746 1756 +10 - Misses 698 740 +42 ``` | [Impacted Files](https://app.codecov.io/gh/vapor/sql-kit/pull/169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor) | Coverage Δ | | |---|---|---| | [Sources/SQLKit/SQLDialect.swift](https://app.codecov.io/gh/vapor/sql-kit/pull/169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9TUUxLaXQvU1FMRGlhbGVjdC5zd2lmdA==) | `73.46% <0.00%> (-1.54%)` | :arrow_down: | | [...urces/SQLKitBenchmark/SQLBenchmark+JSONPaths.swift](https://app.codecov.io/gh/vapor/sql-kit/pull/169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9TUUxLaXRCZW5jaG1hcmsvU1FMQmVuY2htYXJrK0pTT05QYXRocy5zd2lmdA==) | `0.00% <0.00%> (ø)` | | | [Sources/SQLKitBenchmark/SQLBenchmarker.swift](https://app.codecov.io/gh/vapor/sql-kit/pull/169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9TUUxLaXRCZW5jaG1hcmsvU1FMQmVuY2htYXJrZXIuc3dpZnQ=) | `80.00% <0.00%> (-5.72%)` | :arrow_down: | | [Sources/SQLKit/Query/SQLDataType.swift](https://app.codecov.io/gh/vapor/sql-kit/pull/169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9TUUxLaXQvUXVlcnkvU1FMRGF0YVR5cGUuc3dpZnQ=) | `82.35% <100.00%> (+1.10%)` | :arrow_up: | | [...rces/SQLKit/Query/SQLNestedSubpathExpression.swift](https://app.codecov.io/gh/vapor/sql-kit/pull/169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9TUUxLaXQvUXVlcnkvU1FMTmVzdGVkU3VicGF0aEV4cHJlc3Npb24uc3dpZnQ=) | `100.00% <100.00%> (ø)` | |