6/22/2023 0 Comments Tab sql scratchpadThere are two NuGet packages and a GitHub repository: This article presents a simple way to fix that. It's even more difficult to get that code into an intelligible state that you can simply cut, paste and execute in a separate query window. The SQL Scratchpad component and its API are rapidly evolving.When using LINQPad to communicate with a Microsoft SQL Server (MSSQL) database via NHibernate, it's not straightforward to see the actual SQL queries which are being run against the database. for editing embedded SQL in PySpark)…Īn option to SSO and look-up a local JWT token in order to not require the credentials is coming soon. Popular functionalities of the full editor are gradually being integrated, e.g. This first release lets you edit and execute SQL content. The endpoints for executing SQL queries have been greatly simplified and now only ask for the essential like which SQL dialect and query statement or the id of the query previously sent for execution: curl -X POST -data 'operationId=63ce87ba-ca0f-4653-8aeb-e9f5c1781b78' curl -X POST -data 'statement=SHOW TABLES' -H "Authorization: Bearer " Then provide the token value in each following calls. It leverages the exact same authentication as the regular login page and only requires to provide a JWT token afterwards.įor example, simply ask for an access token: curl -X POST -d 'username=demo&password=demo' This is possible via the new public REST API which is much simpler to use than before and follows nowadays standards. To be truly alive, the Editor component needs to talk to the service that can authenticate the user and execute the queries. In order to get the dynamic content like the list of tables, columns… and execute SQL queries, the component needs to point to a Query API.įor the next steps and integrating deeper the component, have a look to the NPM Hue registry. It obviously can only help with the SQL syntax on its own. The autocomplete is powered by the local parser and will show-up. Copy paste the HTML code below into an index.html file and open it with FireFox: ĭirectly opening the local HTML page with Firefox Here is how easy it is to integrate it into a Web page. It then communicates via a REST API with the Hue server which interacts with the Databases we want to query. The component can then be integrated in any Web page. The SQL Editor is a module published to a registry called NPM. Here is a live demo of how easy it is to add the component:Īdding the component in 3 lines and watching the interaction with the public API of How it works One major added benefit is that now the Editor is easy to share and integrate, hence making a strong case for avoiding to re-invent the wheel and re-create various duplicated SQL Editors instead of focusing on making a single one better for the end users. The SQL Scratchpad is a lightweight repackaging of the mature Hue SQL Editor The already popular SQL Parser component is now joined by the SQL Scratchpad component. Segmenting the overall project into fully decoupled components is one reason it could rapidly evolve and still be alive after so long. The Hue SQL Editor project has been evolving for more than 10 years and allows you to query any Database or Data Warehouse. Leveraging the new Hue’s SQL Scratchpad Web Component and REST API into your own project.
0 Comments
Leave a Reply. |