Package: jupysql-plugin
jupysql-plugin[!TIP]
Deploy AI apps for free onPloomber Cloud![!NOTE]
Code in themainbranch is compatible with JupyterLab 4 (0.4.xor higher releases),
thejupyterlab3branch contains code compatible with JupyterLab 3 (0.3.xreleases).
We'll keep backporting some features and making0.3.xreleases for some time, but
we highly recommend upgrading to JupyterLab 4 for a better experience.Installpipinstalljupysql-pluginContributingDevelopment installcondacreate--namejupysql-pluginpython=3.11--channelconda-forge--yes
condaactivatejupysql-plugin
condainstallnodejs--channelconda-forge--yes
pipinstall-rrequirements.txt
pipinstall-rrequirements.dev.txt

jlpminstallNote:pkgmt formatcan be used to format and lint Python files before committing code.
To format JavaScript and TypeScript files, useyarn run eslint. To lint without formatting,
useyarn run eslint:check# Note: this command will take some time the first time as it has to compile the# frontend code. If the command fails, see the "troubleshooting setup" section belowpipinstall-e"."# upon installation, both the frontend and backend extensions must be activated# automatically, you can verify it by ensuring jupysql-plugin appears here:jupyterlabextensionlist# frontend extensionjupyterserverextensionlist# backend extension# if they don't appear, you can activate them manually, but this means that# the setup is incorrect! see pyproject.toml, under# tool.hatch.build.targets.wheel.shared-data, and fix any issues# activate manuallyjupyterserverextensionenablejupysql_plugin
jupyterlabextensionenablejupysql_plugin


jupyterlabextensiondevelop.--overwrite# NOTE: the two previous commands will fail if there are missing dependencies# rebuild extension Typescript# important: we had to set skipLibCheck: true# https://discourse.jupyter.org/t/struggling-with-extensions-and-dependencies-versions/19550jlpmbuildTo watch for changes and reload:# in one terminaljlpmwatch# another terminaljupyterlabRefresh JupyterLab to load the change in your browser.By default, thejlpm buildcommand generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:jupyterlabbuild--minimize=FalseTroubleshooting setupIf you encounter errors when installing the package for development, you can try the
following to configure an environment from scratch:# remove conda environmentcondaenvremove--namejupysql-plugin# delete yarn.lockrmyarn.lock# delete all temporary filesgitclean-fdxThen, create the conda environment again, install dependencies (jlpm install), and
build the extension manually (jupyter labextension build --development True .).
Finally, verify ifpip install -e "."works.Adding dependenciesjlpmaddPACKAGE# examplejlpmadd@jupyter-widgets/baseDevelopment uninstallpipuninstalljupysql-pluginIn development mode, you will also need to remove the symlink created byjupyter labextension developcommand. To find its location, you can runjupyter labextension listto figure out where thelabextensionsfolder is located. Then you can remove the symlink namedjupysql-pluginwithin that folder.Testing the extensionThis extension is usingJestfor JavaScript code testing.This extension usesPlaywrightfor the integration tests (aka user level tests).
More precisely, the JupyterLab helperGalatais used to handle testing the extension in JupyterLab. More information are provided within theui-testsREADME.To run the tests:pipinstallnoxpyyaml# unit testsnox--sessiontest# ui testsnox--sessionui_test# to only run the python unit testspytesttestsReleasing the extensionSeeRELEASEConfigurationThepackage.jsonfile contains ajupyterlabextension. More information about
this section ishere(you might need to switch the git branch dependin on which version JupyterLab version you're building for). The schema ishere.Ploomber Cloud API EndpointYou can set thePLOOMBER_CLOUD_HOSTvariable to switch the API endpoint (by default, it's set to our production API endpoint).exportPLOOMBER_CLOUD_HOST=https://cloudapi-dev.ploomber.io