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

Access the database after disconnecting #398

Open
vivinamalraj opened this issue Oct 26, 2023 · 0 comments
Open

Access the database after disconnecting #398

vivinamalraj opened this issue Oct 26, 2023 · 0 comments

Comments

@vivinamalraj
Copy link

vivinamalraj commented Oct 26, 2023

Access the database after disconnecting
I can able to execute queries on a ClickHouse database after disconnecting the client without encountering a NetworkError as expected.

To Reproduce

Modules

from clickhouse_driver import Client
from clickhouse_driver.errors import NetworkError

Create a ClickHouse client

client = Client(
host=host,
port=9000,
database='ClickHouse_DB'
user='default',
password='pass',
)

try:
# Execute the first query
response = client.execute("describe table_name")
print(response)
except NetworkError as e:
print(f"Error: {e}")
print("The client encountered a NetworkError.")

Disconnect the ClickHouse client

client.disconnect()

try:
# Attempt to execute a query after disconnecting (this will likely raise a NetworkError)
response = client.execute("describe table_name")
print(response)
except NetworkError as e:
print(f"Error: {e}")
print("The client encountered a NetworkError after disconnecting.")

Expected behavior
NetworkError excepted.

Versions

  • clickhouse-driver 0.2.6.
  • Python 3.9.10.
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

1 participant