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

I have some questions about it. #25

Open
aisuhua opened this issue Apr 27, 2016 · 1 comment
Open

I have some questions about it. #25

aisuhua opened this issue Apr 27, 2016 · 1 comment

Comments

@aisuhua
Copy link

aisuhua commented Apr 27, 2016

I feel surprised when i see the Query Syntax and Access Control designs. My first feel the Query Syntax is similar to Mongodb. That is hard work I think. Thanks for it.

After That, I spend the whole day to see the source code and document. Because i want to apply it to my new project. But i will not to use it now. Because it is unfamiliar to me now.

But, after checking the code and document. I have some questions about it. Below are what i thinking about now:

  • Why it don't handle the pagination. I mean the API should return like the meta page, total. Do it myself is ok. That good if it can provide.
  • The Query Syntax Having make no sense if it cannot be used with group by in mysql.??
  • If I use more than two IN condition. But the relationship is or not and. But i cannot do it now.

If i call api like this:

/albums?in={"id": [1], "title": ["Album 1"]}

The result is id IN (1) AND title IN ("Album 1"). But I want to search like this:

SELECT * FROM photo WHERE id IN(1,2) or album_id IN(2);
  • The fields query condition cannot filter the field. ps: I download the v1.3.7 release.

I call api like this:

/albums?fields=title

But the result is not my expect

{
  "albums": [
    {
      "id": 1,
      "title": "Album 1",
      "createdAt": "2016-02-28T11:28:33Z",
      "updatedAt": "2016-02-28T11:28:33Z"
    },

    ....and so on
  ]
}

Thanks. Sorry my bad english, I try my best.

@aisuhua
Copy link
Author

aisuhua commented Apr 28, 2016

How about change the query syntax in like this way:

http://phalcon-rest-boilerplate.dev/items?where={"author":{"l":"Jake"},"likes":{"in":[10, 11, 12]}}

and

http://phalcon-rest-boilerplate.dev/items?or=[{"author":{"e":"Jake"}},"likes":{"in":[10, 11, 12]}}]

I think it can satisfy more sql query situations and more easily to understand. Like:

  1. WHERE author="Jake" and likes IN (10, 11, 12)
  2. WHERE author="Jake" or likes IN (10, 11, 12)
  3. WHERE author IN ("Jake", "Mary") and likes IN (10, 11, 12)

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

1 participant