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

Multiple primary keys - Mysql Error #628

Open
mikoop79 opened this issue Nov 3, 2021 · 1 comment
Open

Multiple primary keys - Mysql Error #628

mikoop79 opened this issue Nov 3, 2021 · 1 comment

Comments

@mikoop79
Copy link

mikoop79 commented Nov 3, 2021

When I have a model with multiple primary keys I get a SQL error.


SQLSTATE[42000]: Syntax error or access violation: 1064 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 'as `` asc limit 5 offset 0' at line 1 at /var/www/v2/laravel/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:79)
[stacktrace]

@lindyhopchris
Copy link
Member

The package expects models to have a single primary key. You'd need to implement this yourself, as there isn't really a good generic way for the package to know how to handle multiple primary keys. That's because the JSON:API spec defines a single id field for the key of a resource - so knowing how to map that single id value to multiple primary keys isn't really something this package can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants