ouseful-testing / sqlize-demo

Demo...
Apache License 2.0
0 stars 0 forks source link

sqlizer

Can we grab data into a repo and view it using a browser based SQL browser?

Yes we can.

This repo provides a proof of concept recipe for:

Set-up

To set up your own repository:

Querying the Database

On the database viewer page, run your SQL query.

To list the tables in the database, use the query:

SELECT name FROM sqlite_master WHERE type='table';

Loading Data into the Database

At the moment, you can only load CSV data into the database, but the plan is to support more datatype imports too (for example, JSON data).

To load data into the database:

When you submit the issue, if your commentauthorassociation status is the OWNER of the repository, a CONTRIBUTOR to or COLLABORATOR on it, or a MEMBER of the organisation associated with it, then the following will happen:

You should now be able to query your data from the database browser / query UI.

Running Scripts Submitted Via an Issue

As well as running "canned" commands, we can also submit aritrary scripts via an issue. For example, if post an issue with title jupytext_run_md and a Python script in the issue body, another action will:

For example, try using the following in an issue body:

# Header

Some text.

```python
# some code
print('hello world')
```

Some more text.

Using the power of Jupytext, the markdown is converted to an .ipynb Jupyter notebook and the code in it executed. The run notebook is then converted to html using nbconvert. The markdown, ipynb and html files can be found in the md, ipynb and html directories respectively.