<s> import psycopg2 <EOL> from mosql . util import raw <EOL> from mosql . query import select , left_join <EOL> from mosql . db import Database , group <EOL> db = Database ( psycopg2 , host = '<STR_LIT:127.0.0.1>' ) <EOL> with db as cur : <EOL> cur . execute ( select ( <EOL> '<STR_LIT>' , <EOL> joins = left_join ( '<STR_LIT>' , using = '<STR_LIT>' ) , <EOL> where = { '<STR_LIT:key>' : '<STR_LIT:email>' } , <EOL> group_by = '<STR_LIT>' , <EOL> select = ( '<STR_LIT>' , raw ( '<STR_LIT>' ) ) , <EOL> order_by = '<STR_LIT>' , <EOL> ) ) <EOL> print '<STR_LIT>' <EOL> for row in cur : <EOL> print row <EOL> print <EOL> cur . execute ( select ( <EOL> '<STR_LIT>' , <EOL> joins = left_join ( '<STR_LIT>' , using = '<STR_LIT>' ) , <EOL> where = { '<STR_LIT:key>' : '<STR_LIT:email>' } , <EOL> select = ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> order_by = '<STR_LIT>' , <EOL> ) ) <EOL> print '<STR_LIT>' <EOL> for row in group ( [ '<STR_LIT>' ] , cur ) : <EOL> print row </s>
