SQLFlow is currently under active development. For those who are interested in trying it out, we have provided the instructions and demo. Play around with it. Any bug report and issue is welcome. :)
- Install Docker Community Edition on your Macbook.
- Build and run a dockerized MySQL server (In this example, called sqlflowdata) following example/datasets/README.md. Note that there is no need to install a local MySQL server, in which case you will have a port conflict in 3306.
- Pull the latest SQLFlow Docker image:
docker pull sqlflow/sqlflow:latest
.
After data is popularized in MySQL, let's test the installation from running a query in Jupyter Notebook:
-
Start a Docker container that runs SQLFlow server and Jupyter Notebook. If you are using Docker for Linux, please change
host.docker.internal:3306
tolocalhost:3306
.docker run --rm -it -p 8888:8888 sqlflow/sqlflow:latest \ bash -c "sqlflowserver --datasource="mysql://root:root@tcp(host.docker.internal:3306)/?maxAllowedPacket=0" & SQLFLOW_SERVER=localhost:50051 jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root"
If you are using Docker for Mac, please be aware the option
--db_address host.docker.internal:3306
wherehost.docker.internal
translates to the host ip address as recommended here.If you are running MySQL on remote, please be aware that MySQL only allows connections from localhost by default. Fix can be found here.
-
Open a web browser, go to
localhost:8888
and paste the token output from Notebook command above. In a Notebook cell, you should be able to test a select statement to fetch 5 records from train table in Iris database.%%sqlflow select * from iris.train limit 5;
-
Feel free to explore more examples at example.ipynb if you are new to Jupyter Notebook.