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

Query stream feature/support to OracleDB #6505

Closed
calebeaires opened this issue Aug 3, 2020 · 4 comments · Fixed by #8086
Closed

Query stream feature/support to OracleDB #6505

calebeaires opened this issue Aug 3, 2020 · 4 comments · Fixed by #8086

Comments

@calebeaires
Copy link

Issue type:

[ ] question
[ ] bug report
[x] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[x] oracle
[ ] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo

TypeORM version:
[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)

OracleDB nodejs dialect has support to streaming by a very simple sintaxe. It works very well on the ReadStream node flow. Here is how it looks like:

queryStream(String sql [, Object bindParams, [Object options]]);

May you consider to add this support to TypeOrm?

@imnotjames
Copy link
Contributor

Is this similar to the postgres syntax?

@calebeaires
Copy link
Author

Quite similar...

const stream = await connection.queryStream(`SELECT employees_name FROM employees`);

stream.on('error', function (error) {
  // handle any error...
});

stream.on('data', function (data) {
  // handle data row...
});

stream.on('end', function () {
  // all data has been fetched...
  stream.destroy();  // the stream should be closed when it has been finished
});

stream.on('close', function () {
  // can now close connection...  (Note: do not close connections on 'end')
});

stream.on('metadata', function (metadata) {
  // access metadata of query
});

// listen to any other standard stream events...

@ozknemoy
Copy link

ozknemoy commented Dec 5, 2020

would be great to have this for oracle driver

@schambersnh
Copy link

agreed! we would love this as well

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

Successfully merging a pull request may close this issue.

4 participants