-
Notifications
You must be signed in to change notification settings - Fork 27
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
Support for Key-Value Pair Query Results, Streamed Data Access #507
Comments
Thank you for your detailed feedback on the
We hope these improvements enhance your experience with the Thank you again for your valuable input! |
@everpcpc Thanks for your support. We encountered an issue with the output of the record. For example, when we call queryIter or any method to execute a query, the output should ideally be in its respective data type, correct? However, for bigint, the output is returned as '7n' instead of 7 (even though it’s not a very large value). Using the MySQL handler, it provides the correct result. Does the output remain consistent across types—for instance, varchar as a string, and number and boolean in their proper formats? Am I correct? |
Thank you for your feedback. I'd like to clarify the data type mappings between Databend and JavaScript native types. You can find a full list of these mappings in our documentation here: Databend Driver Type Mapping. Regarding your specific concern, '7n' is indeed the correct output for bigint in JavaScript. In JavaScript, '7n' represents a BigInt, which is a primitive type. For more details on BigInt, you can refer to the MDN documentation: BigInt in JavaScript. To answer your query about consistency across types:
This ensures that the output remains consistent and adheres to JavaScript's handling of different data types. If you have any further questions, feel free to ask! |
@everpcpc Thanks! I indeed knew it but since the mysql handler port gave in a different way which made me ask it. |
@Shanmugavel-J Oh, I see. The type mapping depends on how the driver converts the response from the database. We recommend using the native Databend driver for better support. The MySQL handler is intended for transitional use and is just a compatible implementation. It has not been fully tested, so there may be some corner cases that are not covered. |
@everpcpc Yes, I noticed the features have been released. I’m now updating to the databend-driver package. Instead of an iterator for streams, I had requested a Node.js Readable stream, similar to what Snowflake and mysql provides. Which could be piped to another stream for transformation and would be useful in many ways |
@Shanmugavel-J I get it. We will add support for Node.js Readable stream in upcoming releases, making data streaming operations more flexible and convenient. |
@everpcpc That sounds great please let me know once that feature is added for fetching the rows in stream format. Thanks again for your support!! |
@Shanmugavel-J Hi, we have released a new version with Readable stream support. You could refer to the examples: https://www.npmjs.com/package/databend-driver?activeTab=readme#usage |
@everpcpc I will check and get back to you. Thanks! |
@everpcpc Please find my below observations,
When i execute the above method i could see its comment saying the rows, schema & stats could be fetched but i don't get the rows as output when i execute this method but i get the stats (execution time etc). but Ideally it should provide me with the rows, schema & the stats am I correct?
One observation was like, I couldn't see any types for stream. Could you please update it so that it would be great to see what that function would return? example code (Other way to use stream):
When i execute the below logic after successful execution of the below code, i get the error attached Query:
Error:
Object ( |
cc @youngsofun please check this error:
|
Hi, @Shanmugavel-J
|
@everpcpc Thanks! The variantObject option works as well. |
Currently, the npm databend-driver has the following limitations that impact usability and efficiency:
Ex:- const results = await conn.exec('SELECT * FROM test;');
results = [{ id: 1 }, { id: 2 }]
Proposed Features:
These features would significantly improve the usability, performance, and developer experience of the databend-driver. Thanks!
The text was updated successfully, but these errors were encountered: