Skip to content

msainz/sqlmagic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

SQL Magic for IPython

Author: Aiyesha Ma & Marcos Sainz
Tested on IPython Version 0.13.1

This SQL cell magic allows you to open multiple connections to several databases and then reference the connections by name inside IPython.

Adapted from:

Load using:

import sqlmagic
reload(sqlmagic) # useful if you plan to be modifying this file

Now you can do the following line magic to setup a connection:

%connect {"name": "connection_name", "params": {"host": "host", "db": "database_name", "user": "user", "password": "password"}}

And then reference and use the connection via cell magic:

%%sql connection_name
select * from foo

About

SQL cell magic for IPython

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages