Skip to content

Commit 2ae029f

Browse files
Documented << operator
1 parent af6e92c commit 2ae029f

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

NEWS.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,6 @@ result sets
145145
-----
146146

147147
* Fix truth value of DataFrame error (thanks michael-erasmus)
148+
* `<<` operator (thanks xiaochuanyu)
149+
* added README example (thanks tanhuil)
150+
* bugfix in executing column_local_vars (thanks tebeka)

README.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,27 @@ leftmost column serving as key, for unique values.
109109
In [15]: result['richard2']
110110
Out[15]: (u'richard2', u'Richard II', u'History of Richard II', 1595, u'h', None, u'Moby', 22411, 628)
111111
112+
Assignment
113+
----------
114+
115+
Ordinary IPython assignment works for single-line `%sql` queries::
116+
117+
.. code-block:: python
118+
119+
In [16]: works = %sql SELECT title, year FROM work
120+
43 rows affected.
121+
122+
The `<<` operator captures query results in a local variable, and
123+
can be used in multi-line ``%%sql``::
124+
125+
.. code-block:: python
126+
127+
In [17]: %%sql works << SELECT title, year
128+
...: FROM work
129+
...:
130+
43 rows affected.
131+
Returning data to local variable works
132+
112133
Connecting
113134
----------
114135

@@ -254,6 +275,7 @@ Credits
254275
- Andrés Celis for SQL Server bugfix
255276
- Michael Erasmus for DataFrame truth bugfix
256277
- Noam Finkelstein for README clarification
278+
- Xiaochuan Yu for `<<` operator
257279

258280
.. _Distribute: http://pypi.python.org/pypi/distribute
259281
.. _Buildout: http://www.buildout.org/

0 commit comments

Comments
 (0)