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

add clearOrder method fix #2360 #2553

Merged
merged 1 commit into from Apr 2, 2018
Merged

add clearOrder method fix #2360 #2553

merged 1 commit into from Apr 2, 2018

Conversation

@revolunet
Copy link
Contributor

@revolunet revolunet commented Apr 1, 2018

this adds the clearOrder method

is it normal that atm the order clause is reused like in this example ?

i ran into this for some obscure reason in a sqlite environnement. the order clause was getting a field from another database...

 const textData = await knex
    .select()
    .from("myTable")
    .where({
      etat: "TOP"
    })
    .orderBy("date", "desc")
    .first()
    .catch(console.log);
revolunet added a commit to revolunet/knex-documentation that referenced this pull request Apr 1, 2018
@revolunet
Copy link
Contributor Author

@revolunet revolunet commented Apr 1, 2018

@elhigu
Copy link
Member

@elhigu elhigu commented Apr 2, 2018

Beautiful, no comments, thank you!

@elhigu elhigu merged commit 0a1976d into knex:master Apr 2, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@revolunet
Copy link
Contributor Author

@revolunet revolunet commented Apr 7, 2018

thanks ;)

do you know a way to fetch a built version from npm until you make a new release ?

@elhigu
Copy link
Member

@elhigu elhigu commented Apr 8, 2018

I'm just starting to do release

elhigu added a commit to knex/documentation that referenced this pull request Apr 8, 2018
@revolunet
Copy link
Contributor Author

@revolunet revolunet commented May 12, 2018

can you please explain why the clear methods are required ?
id like to understand when to use it or not.
thanks

@elhigu
Copy link
Member

@elhigu elhigu commented May 15, 2018

It can be used when ever when you need to remove certain parts from existing query builder. Sometimes it is useful, for example when making result count query from normal query one should drop order by part or result counting query might get super slow.

@bertho-zero
Copy link
Contributor

@bertho-zero bertho-zero commented Jun 22, 2018

In my case I would also need a clearGroupBy to make a correct count.

My current result is: countQuery === [{total: 3}, {total: 2}]

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

Successfully merging this pull request may close these issues.

None yet

3 participants