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

Add the param stream_results #23

Closed
hantmac opened this issue Feb 27, 2024 · 5 comments
Closed

Add the param stream_results #23

hantmac opened this issue Feb 27, 2024 · 5 comments
Assignees

Comments

@hantmac
Copy link
Member

hantmac commented Feb 27, 2024

if stream_results = false, pool the rows data into cursor, else call next every time.
Also fix #22

@rad-pat
Copy link
Contributor

rad-pat commented Mar 23, 2024

Does the current driver implementation of RowIterator represent a server-side cursor? If so, possible the dialect options supports_server_side_cursors and server_side_cursors are of use also?

@hantmac
Copy link
Member Author

hantmac commented Mar 24, 2024

Does the current driver implementation of RowIterator represent a server-side cursor? If so, possible the dialect options supports_server_side_cursors and server_side_cursors are of use also?

@rad-pat Because the databend-sqlalchemy use the databend-rust-driver-binding as python driver. So the RowIterator in https://github.com/datafuselabs/bendsql/blob/main/sql/src/rows.rs#L120 has implementation of RowIterator represent a server-side cursor.

@rad-pat
Copy link
Contributor

rad-pat commented Mar 24, 2024

Actually, it looks like flag server_side_cursors is the old way anyway, now deprecated in favour of stream_results.

@hantmac
Copy link
Member Author

hantmac commented Mar 25, 2024

Actually, it looks like flag server_side_cursors is the old way anyway, now deprecated in favour of stream_results.

We prefer to have a stream_results param, and default value is true.

@TCeason
Copy link
Collaborator

TCeason commented Sep 23, 2024

Now we can already support server_side_cursors https://github.com/datafuselabs/databend-sqlalchemy/blob/main/databend_sqlalchemy/databend_dialect.py#L609 use this demo to replace stream_result.

import connector
cursor = connector.connect('databend://root:@localhost:8000?sslmode=disable').cursor()
cursor.execute('SELECT * FROM test')
# print(cursor.fetchone())
# print(cursor.fetchall())
for row in cursor:
    print(row)

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