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

sequential query is super inconsistent #208

Closed
Truth1984 opened this issue Jun 5, 2020 · 2 comments
Closed

sequential query is super inconsistent #208

Truth1984 opened this issue Jun 5, 2020 · 2 comments

Comments

@Truth1984
Copy link

  1. I have a table with above 5000 records,
  2. and I set pageSize: 262144 in configuration.
let longQuery = async (table, config) => {
  let db = await attachDB(config);
  let finaldata = [];

  await new Promise((resolve, reject) => {
    db.sequentially(
      `SELECT * FROM ${table}`,
      [],
      (row, index) => {
        console.log(row, index);
        finaldata.push(row);

       //if (index > 5000) resolve();
      },
      (error) => {
        if (error) reject(error);
        resolve(finaldata);
      }
    );
  });

  await detachDB(db);
  return finaldata;
};

I tested multiple times, and neither of those results were the same.
It often stuck at around 750, sometimes 2000, 3000, but it never reached the end, and it threw no error.

@Truth1984
Copy link
Author

and sometimes it will throw

node-firebird/lib/index.js:4311
            for (var i = 0, length = ret.data.length; i < length; i++)
                                              ^

TypeError: Cannot read property 'length' of undefined

@miiguelperes
Copy link

I had the same problem, a formal way of solving it was used the following version: "node-firebird": "~ 0.8.9", sorry for the delay

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

3 participants