pbugnion / jupyterlab-sql

SQL GUI for JupyterLab
MIT License
418 stars 52 forks source link

Presto support #112

Open michalrudko opened 4 years ago

michalrudko commented 4 years ago

I am trying to connect this extension to a presto instance, however I have problems with two things. First of all - is presto connection supported at this moment? I can't find anything related to the presto SQL alchemy plugin. Providing that this is supported, can I pass some connect_args in the URL when connecting via the jupyterlab-sql extension? If so, what would be the URL for the sample params as below?

SQLAlchemy

create_engine(
    'presto://user@host:443/hive',
    connect_args={'protocol': 'https',
                  'session_props': {'query_max_run_time': '1234m'}}
)
pbugnion commented 4 years ago

Thanks for raising this.

is presto connection supported

Currently, the only databases that we actually test against are sqlite, MySQL and PostgreSQL. However, I see no reason you wouldn't be able to connect to a presto instance in principle, since it looks like SQLAlchemy supports it (with PyHive). You would need to have PyHive available in the same virtual environment as the one Jupyter Lab is running in.

Separately, we're always interested in people willing to maintain support for other database types, so if you're interested in making Presto an explicitly supported database, let us know.

can I pass some connect_args in the URL when connecting via the jupyterlab-sql extension

You can pass custom parameters via the query string, as described here. This may well not work with nested arguments like session_props, though. PRs welcome for better support for custom arguments. Happy to discuss what this looks like.

pbugnion commented 4 years ago

See issue #113 for actively supporting additional database types.

michalrudko commented 4 years ago

@pbugnion - thanks for giving the broader context to this topic. I have the PyHive package installed in the virtual environment associated with the kernel, but I also installed it on the container JupyterLab runs on and will try to connect. Currently I am getting ('Connection aborted.', BadStatusLine('\x15\x03\x03\x00\x02\x02P',)), but it seems I need to provide some kerberos-specific args - I'll provide some updates once I manage to connect successfully to my presto instance.