Commit Graph
79 Commits
Author SHA1 Message Date
Gwendal Roué 836efb120f Xcode 12.3 formatting 2020-12-23 12:13:05 +01:00
Gwendal Roué 60a9494434 Fix Swiftlint warnings 2020-12-23 10:10:10 +01:00
Gwendal Roué b485d4d3dc forSingleResult is no longer mandatory 2020-12-23 10:08:16 +01:00
Gwendal Roué 6abbf82a89 So long, visitor pattern! 2020-12-23 09:02:17 +01:00
Gwendal Roué b60f39e7cc Merge branch 'development' into dev/cte
# Conflicts:
#	GRDB/QueryInterface/Request/Association/Association.swift
#	GRDB/QueryInterface/Request/QueryInterfaceRequest.swift
#	GRDB/QueryInterface/SQL/SQLQuery.swift
#	GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift
#	GRDB/QueryInterface/SQLGeneration/SQLQueryGenerator.swift
2020-12-05 12:31:52 +01:00
Gwendal Roué 1e2d07a16f Simplify SQLSource
SQLSource used to be more or less able to deal with subqueries, as in SELECT ... FROM (SELECT ...).

But we had only one use case for it, the "trivial count query": SELECT COUNT(*) FROM (SELECT ...). And many opportunities for fatal errors, because such subqueries were not generally supported.

So we simplify SQLSource, and implement the trivial count query in another way.
2020-12-05 12:21:14 +01:00
Gwendal Roué 6f409f2140 Fix typo 2020-12-03 09:22:15 +01:00
Gwendal Roué 8000332ec4 Gather CTE methods 2020-12-01 19:29:39 +01:00
Gwendal Roué b7b89c5fa9 CTE associations 2020-11-30 21:51:17 +01:00
Gwendal Roué c776ee8d47 Association: remove TableRecord requirement 2020-11-30 21:50:18 +01:00
Gwendal Roué ec2640a459 CommonTableExpression is a table, after all 2020-11-30 19:21:46 +01:00
Gwendal Roué 2bb9f5ce0d First joins with CommonTableExpression 2020-11-29 19:05:12 +01:00
Gwendal Roué e1d3c1d7dc Give CommonTableExpression a key, for joins 2020-11-29 18:23:41 +01:00
Gwendal Roué e7dcf25063 CTE aliases 2020-11-29 15:49:55 +01:00
Gwendal Roué 7f229468d2 Documentation 2020-07-12 15:12:04 +02:00
Gwendal Roué 002287ca28 Close FetchRequest, make it visitable 2020-07-11 17:30:11 +02:00
Gwendal Roué ae41859bbb Cleanup 2020-07-11 10:57:24 +02:00
Gwendal Roué 68785d1c2d Hide _SQLAssociation 2020-07-05 16:21:28 +02:00
Gwendal Roué 268a45a635 Prepare for different kinds of SQLAssociationCondition 2020-07-02 08:29:49 +02:00
Gwendal Roué 2201026ce8 Introduce FastPrimaryKeyExpression, drop SQLPrimaryKeyExpression
Also, don't let the user access this expression, so that he does not attempt at decoding it. Its only purpose is to generate efficient SQL.
2020-07-01 20:40:11 +02:00
Gwendal Roué c4ab23761e QueryInterfaceRequest.selectPrimaryKey(as:) 2020-06-15 17:02:00 +02:00
Gwendal Roué a5de2b9288 Breaking: AnyFetchRequest.asRequest(of:) 2020-05-30 10:30:07 +02:00
Gwendal Roué 4c2042c3ce Cleanup 2bb53026ef 2020-05-25 13:04:10 +02:00
Gwendal Roué 2bb53026ef Fix #783 2020-05-25 09:34:11 +02:00
Gwendal Roué 476e72cca2 requestSQL(_:forSingleResult:) is experimental 2020-05-10 15:34:37 +02:00
Gwendal Roué 17e745f52b SQLRequestProtocol, close FetchRequest 2020-05-10 15:34:37 +02:00
Gwendal Roué da4b96c2ca Cleanup handling of subquery sources 2020-05-01 15:42:01 +02:00
Gwendal Roué 39f327fcb3 Optimize SQLAssociationCondition.filteringExpression(_:leftRows:)
And make sure we compute a correct database region for association requests
2020-05-01 15:06:47 +02:00
Gwendal Roué 27ffb2a418 Rename index(ofColumn:) to index(forColumn:) 2020-05-01 15:01:01 +02:00
Gwendal Roué dfcc6f99a5 SQLCollection can be qualified, now 2020-04-30 18:49:20 +02:00
Gwendal Roué 664c1ed281 Documentation 2020-04-30 18:35:05 +02:00
Gwendal Roué 057679a2ba We don't need to prevent requests that select several columns 2020-04-30 18:22:59 +02:00
Gwendal Roué 9006c701b3 Replace the expectsSingleResult hint with an analysis of the query 2020-04-30 14:14:07 +02:00
Gwendal Roué cb7a7633b1 TODO 2020-04-30 09:04:17 +02:00
Gwendal Roué 1d89d184fd Fix subqueries semantics 2020-04-30 08:19:00 +02:00
Gwendal Roué be249bc697 SQLRequestExpressible is a sub protocol of SQLSpecificExpressible 2020-04-29 23:40:37 +02:00
Gwendal Roué 4245e8f09e Cleanup 2020-04-29 22:24:58 +02:00
Gwendal Roué a15233eff1 SQLGenerationContext no longer needs to be mutated 2020-04-29 21:59:04 +02:00
Gwendal Roué 188f51c513 Refactor handling of arguments during SQL generation 2020-04-29 21:27:14 +02:00
Gwendal Roué 3d86f45aa2 SQLRequestExpressible
This protocol makes it possible to write request.filter(column == subRequest)
2020-04-29 20:18:00 +02:00
Gwendal Roué 473bc3a88e SQLQueryGenerator handles the single result optimization. Make sure a single column is selected for expression/collection requests 2020-04-29 18:30:46 +02:00
Gwendal Roué 8bcf9257f6 TODO 2020-04-29 14:32:53 +02:00
Gwendal Roué 82ff6cb4c5 Cleanup 2020-04-29 14:24:25 +02:00
Gwendal Roué 21552d8838 SQLRequest & QueryInterfaceRequest are SQLExpression 2020-04-29 14:24:18 +02:00
Gwendal Roué 6dca9e1068 Cleanup 2020-04-29 09:49:24 +02:00
Gwendal Roué 8cb75dd814 Subqueries wip 2020-04-28 21:03:58 +02:00
Gwendal Roué f543784241 TODO 2020-04-28 14:20:05 +02:00
Gwendal Roué d0ba9e342c Turn selection and having clauses into promises. Give association aggregates access to the actual primary key, for better support for WITHOUT ROW ID tables. 2020-04-25 19:51:03 +02:00
Gwendal Roué 7a475ad476 Cleanup 2020-04-10 08:58:29 +02:00
Gwendal Roué 37aa7feee9 Rename KeyPathRefining to Refinable 2020-04-09 18:50:36 +02:00