Commit Graph
47 Commits
Author SHA1 Message Date
Gwendal Roué a7b8a73dba Cleanup
After failed experiment:

SELECT ...
FROM parent
JOIN (SELECT * FROM child LIMIT 1) child ON child.parentId = child.id

The problem is that the join condition can't go inside the subquery, because SQLite complains about unknown table "parent". And when the join condition is outside the subquery, the LIMIT clause has been applied too early.

So we're still stuck with:

SELECT ...
FROM parent
JOIN child ON child.id = (SELECT id FROM child WHERE child.parentId = child.id LIMIT 1)

For some reason SQLite accepts the reference to the parent table in this case.
2020-04-19 14:14:13 +02:00
Gwendal Roué 5fed231856 Simplify SQLAssociationCondition.filteringExpression 2020-04-18 17:06:29 +02:00
Gwendal Roué 615f4159d6 Rename firstInMany to firstOnly 2020-04-18 17:06:29 +02:00
Gwendal Roué 8057572357 Move firstInMany flag in SQLRelation 2020-04-18 17:06:29 +02:00
Gwendal Roué 7ed967b502 Cleanup SQLAssociationCardinality and SQLAssociationStep 2020-04-18 17:06:29 +02:00
Gwendal Roué f545789205 Avoid using the rowid column when we can use the regular primary key 2020-04-18 17:06:23 +02:00
Gwendal Roué f97088d63a Failing tests for HasManyThrough.first 2020-04-18 16:40:22 +02:00
Gwendal Roué 6f125bd3d7 SQLAssociation.associationForFirst() 2020-04-18 16:40:22 +02:00
Gwendal Roué d80922954a Let hasMany.first include nested associations 2020-04-18 16:40:22 +02:00
Gwendal Roué fb550d30a0 HasManyAssociation.first and last 2020-04-18 16:40:22 +02:00
Gwendal Roué 37aa7feee9 Rename KeyPathRefining to Refinable 2020-04-09 18:50:36 +02:00
Gwendal Roué d988be49a6 Revert #748 2020-04-09 13:42:37 +02:00
Gwendal Roué 7ce6a8a094 Rename QueryInterfaceRequest to Request 2020-04-04 20:12:03 +02:00
Gwendal Roué 19061934ce SE-0242: Synthesize default values for the memberwise initializer
...and more initializers cleanup
2020-03-09 08:49:06 +01:00
Gwendal Roué 9aa67f9db9 SE-0255: Implicit returns from single-expression functions 2020-03-08 23:12:46 +01:00
Gwendal Roué 8718d525d4 SE-0253: Callable values of user-defined nominal types 2020-03-08 20:36:49 +01:00
Gwendal Roué 7865b0a2ee SE-0249: Key Path Expressions as Functions 2020-03-08 19:58:51 +01:00
Gwendal Roué 694adcec64 Remove other deprecated methods 2020-03-08 18:03:11 +01:00
Gwendal Roué b961962f93 Cleanup 2020-01-25 16:29:04 +01:00
Gwendal Roué e999ab5ecb Don't deprecate SQLLiteral.mapSQL, after all 2020-01-25 13:46:00 +01:00
Gwendal Roué 86e32cdc23 Cleanup SQLGenerationContext 2020-01-24 08:55:55 +01:00
Gwendal Roué 6a0cc838da Deprecate SQLLiteral.mapSQL and SQLExpression.sqlLiteral 2020-01-24 08:55:55 +01:00
Gwendal Roué 5e67ca5566 Deprecate SQLExpressionLiteral, hide SQLSelectionLiteral, introduce SQLLiteral.sqlExpression and .sqlSelectable 2020-01-24 08:55:55 +01:00
Gwendal Roué d7ef314a15 SQLLiteral is now a promise that needs an SQLGenerationContext 2020-01-24 08:55:55 +01:00
Gwendal Roué 349e34b1c1 Internal API experiment: KeyPathRefining 2020-01-21 19:37:19 +01:00
Gwendal Roué 4bfab90750 Restore and deprecate SQLLogicalBinaryOperator 2020-01-16 18:50:48 +01:00
Gwendal Roué 01b47a833a Introduce the || string concatenation operator 2020-01-16 08:38:17 +01:00
Gwendal Roué a398c6dc99 Flattten stricly associative operators 2020-01-16 08:17:11 +01:00
Gwendal Roué 32a40b18fd Introduce associative binary operators 2020-01-16 08:01:48 +01:00
Gwendal Roué 0b07a6a696 Cleanup 2020-01-11 20:43:37 +01:00
Gwendal Roué ebdfa9e52a Fix failiing tests for children relations 2020-01-11 18:36:36 +01:00
Gwendal Roué 2595729c8c Documentation 2020-01-03 08:04:22 +01:00
Gwendal Roué baa9695678 SQLQueryGenerator.grouping(_:) 2019-12-29 17:18:17 +01:00
Gwendal Roué 7208f53176 Support for NULLS FIRST and NULLS LAST 2019-12-07 12:31:58 +01:00
Gwendal Roué b4929bb638 Rename aliased(_:) to forKey(_:) 2019-07-27 16:29:09 +02:00
Gwendal Roué 35ceeebb3d Style tweaks 2019-07-26 20:56:33 +02:00
Gwendal Roué df6bb8761c Swiftlint + whitespace 2019-07-01 08:57:53 +02:00
Gwendal Roué 50c9792eb2 Merge pull request #546 from openbitapp/master
fix errors for Xcode 11 beta
2019-06-09 11:57:59 +02:00
Roberto Casula b6f988194c fix errors for Xcode 11 beta 2019-06-08 15:46:48 +02:00
Gwendal Roué e7a590b82b Extract joining methods to the JoinableRequest protocol 2019-05-29 08:36:55 +02:00
Gwendal Roué 1d75863c9a Also turn SQLAssociationCondition SQL expression into an array 2019-05-26 21:46:19 +02:00
Gwendal Roué 6fa452b68c Fix joined(operator:) 2019-05-26 20:46:11 +02:00
Gwendal Roué ab000d7a4f Remove useless expression parenthesis from SQL 2019-05-26 20:08:13 +02:00
Gwendal Roué 680f3ad20c Nicer WHERE, HAVING and ON output 2019-05-26 15:32:00 +02:00
Gwendal Roué 0ad7d5e894 Fix failing test for parallel inclusion of hasManyThrough(_, through: belongsTo, via: hasMany) 2019-05-24 13:18:00 +02:00
Gwendal Roué f23e41a866 Fix wrong Columns enums 2019-05-22 20:28:07 +02:00
Gwendal Roué faae864699 Query Interface code organization 2019-05-22 20:13:33 +02:00