Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query relation #44

Conversation

LoicMahieu
Copy link

  • Move condition to join clause
  • Add support of and and or operators in where clause with relations
  • Use INNER join only when a condition in applied on the model. It make the relation optional until it is really required.
  • Scope all properties for allowing join on model with the same class name.
  • And finally, optional, relation query style for avoid nested where, see commit b93aed6

Rebase: I "rollback" the change about qualifiedColumnEscaped. This additional method wasn't necessary.

@slnode
Copy link

slnode commented Mar 30, 2016

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

@LoicMahieu
Copy link
Author

Related #40 #42

@Amir-61
Copy link
Contributor

Amir-61 commented Apr 6, 2016

Connect to : #31

Related to: #40 #42

Related GH issue: strongloop/loopback#517

@raymondfeng
Copy link
Contributor

ok to test

@raymondfeng
Copy link
Contributor

@LoicMahieu The PR causes a lot of failures for downstream connectors, for example:

Wed, 06 Apr 2016 20:02:10 GMT loopback:connector:mysql Error: {"code":"ER_PARSE_ERROR","errno":1064,"sqlState":"42000","index":0}
Wed, 06 Apr 2016 20:02:10 GMT loopback:connector:mysql Data:  undefined
Wed, 06 Apr 2016 20:02:10 GMT loopback:connector:sql Error: {"code":"ER_PARSE_ERROR","errno":1064,"sqlState":"42000","index":0} "CREATE TABLE `PostWithDefaultId` (\n  `PostWithDefaultId`.`id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,\n  `PostWithDefaultId`.`title` VARCHAR(255) NULL,\n  `PostWithDefaultId`.`content` VARCHAR(512) NULL,\n  `PostWithDefaultId`.`comments` TEXT NULL,\n  `PostWithDefaultId`.`history` TEXT NULL,\n  `PostWithDefaultId`.`stars` INT(11) NULL,\n  `PostWithDefaultId`.`userId` TEXT NULL,\n   INDEX `PostWithDefaultId`.`title`  (`PostWithDefaultId`.`title`) \n)" []
{ [Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.`title`) 
)' at line 9]
  code: 'ER_PARSE_ERROR',
  errno: 1064,
  sqlState: '42000',
  index: 0 }

I think some SQL statements don't allow the qualified column names, for example, create or index.

@stale
Copy link

stale bot commented Aug 22, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@slnode
Copy link

slnode commented Aug 22, 2017

Can one of the admins verify this patch?

1 similar comment
@slnode
Copy link

slnode commented Aug 22, 2017

Can one of the admins verify this patch?

@stale stale bot removed the stale label Aug 22, 2017
@slnode
Copy link

slnode commented Aug 22, 2017

Can one of the admins verify this patch?

@stale
Copy link

stale bot commented Oct 21, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@slnode
Copy link

slnode commented Oct 21, 2017

Can one of the admins verify this patch?

@stale stale bot added the stale label Oct 21, 2017
@stale
Copy link

stale bot commented Nov 4, 2017

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this Nov 4, 2017
@0candy 0candy removed the backlog label Nov 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants