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

eachRow does not accept options #8

Closed
rashtao opened this issue Jul 1, 2015 · 3 comments
Closed

eachRow does not accept options #8

rashtao opened this issue Jul 1, 2015 · 3 comments

Comments

@rashtao
Copy link

rashtao commented Jul 1, 2015

CQL driver supports an options parameter (http://docs.datastax.com/en/developer/nodejs-driver/2.1/nodejs-driver/reference/paging.html) that is foundamental for:

  • setting the autopaging: { autoPage : true }
  • specify the page to fetch: { pageState : pageState, prepare : 1 , fetchSize : 1000 }

Currently cassanknex only allows me only to fetch the first 5000 rows and then I don't know how to get the next rows.

It would be great to have the possibility to specify the options, maybe following the fluent interface approach:

cassanKnex("mykeyspace")
            .select()
            .from("users")
            .options({prepare: true, autoPage : true})
            .eachRow();
@rashtao rashtao changed the title eachRow does not accepts options eachRow does not accept options Jul 1, 2015
@rashtao
Copy link
Author

rashtao commented Jul 1, 2015

The 'options' method would also be used for regular queries:

                cassanKnex("mykeyspace")
                    .insert(obj)
                    .into("users")
                    .options({prepare: true})
                    .exec(cb);

@UnbounDev
Copy link
Contributor

Currently options can be passed to exec and stream by calling the methods w/ an options object as the first parameter in the call signature (the docs are not very clear on this); e.g.

cassanKnex("mykeyspace")
                    .insert(obj)
                    .into("users")
                    .options({prepare: true})
                    .exec({ pageState : pageState, prepare : 1 , fetchSize : 1000 }, cb);

However; this is not implemented for forEach (my oversight); I'll add the same functionality to eachRow s.t. you can pass options via forEach(options, rowCb, errorCB).

@UnbounDev
Copy link
Contributor

@rashtao the fix is in! Version 1.6.0 on npm, docs have been updated as well - thanks for bringing attention to the issue!

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

No branches or pull requests

2 participants