=-----------------------------------------=
=-----------------------------------------=
  _______ _______ ___     _______ ___ ___
 |   _   |   _   |   |   |   _   |   Y   )
 |   1___|.  |   |.  |   |.  |   |.  1  /
 |____   |.  |   |.  |___|.  |   |.  _  \
 |:  1   |:  1   |:  1   |:  1   |:  |   \
 |::.. . |::..   |::.. . |::.. . |::.| .  )
 `-------`----|:.`-------`-------`--- ---'
              `--'
=-----------------------------------------=
SQL Orientated Kernels for Jupyter Notebook
=-----------------------------------------=

- | sqlite | mysql | postgres | oracle | -
- | videos | news                      | -

=-----------------------------------------=

-- mysql kernel for jupyter notebook

=-----------------------------------------=

-- howto install
-- howto change mysql connection
-- howto save mysql connection info
-- howto load mysql connection info
-- howto save query result to csv
-- howto change cell result output type

=-----------------------------------------=

-- howto install

pip install --upgrade sqlm-kernel
sqlmk_install

-- optional: 

pip install --upgrade nbtermix
nbtermix --kernel sqlmk

=-----------------------------------------=

-- howto change mysql connection

to open different mysql connection use 

--% dbcon:constr

on the beginning of the cell

where constr consists of string e.g.:

{
  "host":"127.0.0.1",
  "port":"3306",
  "user":"user",
  "password":"",
  "database":"mysql"
}

the string has to be specified on
one line and has to be preceded by:

--% dbcon:(oneliner constr)

Alternatively You can place the:
sqlmk_conn.json
file in the working directory containg
above information on one line
and then load it using
--% cload
(see below)

=-----------------------------------------=

-- howto save mysql connection info

put following magick on a line:

--% csave

it will save the current connection to the
sqlmk_conn.json
file

=-----------------------------------------=

-- howto load mysql connection info

put following magick on a line:

--% cload

it will load the current connection from
sqlmk_conn.json file

=-----------------------------------------=

-- howto save query result to csv

put following magick on a line:

--% dsave

it will save last query result to csv e.g.

--% dsave dummy

will save last query result to dummy.csv

=-----------------------------------------=

-- howto change output type

put following magick in a cell:

--% otext

to display cells result output in text mode

put following magick in a cell:

--% ohtml

to display cells result output in html mode

=-----------------------------------------=
-- created using vi, gnu screen and debian
=-----------------------------------------=