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

Conversation

Projects
None yet
3 participants
@revolunet
Contributor

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 revolunet referenced this pull request Apr 1, 2018

Merged

add clearOrder #100

@revolunet

This comment has been minimized.

Contributor

revolunet commented Apr 1, 2018

@elhigu

This comment has been minimized.

Collaborator

elhigu commented Apr 2, 2018

Beautiful, no comments, thank you!

@elhigu elhigu merged commit 0a1976d into tgriesser:master Apr 2, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@revolunet

This comment has been minimized.

Contributor

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

This comment has been minimized.

Collaborator

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

This comment has been minimized.

Contributor

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

This comment has been minimized.

Collaborator

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

This comment has been minimized.

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}]

@joelshepherd joelshepherd referenced this pull request Nov 13, 2018

Merged

[knex] Adding missing clearOrder() method #30482

7 of 9 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment