--view_tables

Switch

--view_tables

Description

Show data from MySQL tables. Will print the first five rows of the tables specified by -t, -f and --outcome_table if any of those flags are present. Also takes optional positional arguments and prints the description of those tables as well.

Argument and Default Value

Zero or more table names as positional arguments. Default: False (not given).

Details

Runs SELECT * ... LIMIT 5 on each table and prints the result; this is a read-only inspection switch and does not modify any tables. Aliased as --view_data. For column-level descriptions instead of sample rows, see --describe_tables.

Other Switches

Required Switches:

Optional Switches:

Example Commands

   dlatkInterface.py -d dla_tutorial -t msgs --view_tables
   ...
   SQL QUERY: select column_name from information_schema.columns
       where table_schema = 'dla_tutorial' and table_name='msgs'
   SQL QUERY: SELECT * FROM msgs LIMIT 5
message_id        user_id           date   created_time        message
         1        3991108   31,July,2004 2004-07-31 00:    can you bel
         2        3991108   25,July,2004 2004-07-25 00:    miss su  us
         3        3991108   24,July,2004 2004-07-24 00:    i'm lookin
         4        3991108   24,July,2004 2004-07-24 00:    what a time
         5        3991108 01,August,2004 2004-08-01 00:    i cannot be
   dlatkInterface.py -d dla_tutorial -t msgs --view_tables blog_outcomes
   ...
   SQL QUERY: select column_name from information_schema.columns
       where table_schema = 'dla_tutorial' and table_name='msgs'
   SQL QUERY: SELECT * FROM msgs LIMIT 5
message_id        user_id           date   created_time        message
         1        3991108   31,July,2004 2004-07-31 00:    can you bel
         2        3991108   25,July,2004 2004-07-25 00:    miss su  us
         3        3991108   24,July,2004 2004-07-24 00:    i'm lookin
         4        3991108   24,July,2004 2004-07-24 00:    what a time
         5        3991108 01,August,2004 2004-08-01 00:    i cannot be

   SQL QUERY: select column_name from information_schema.columns
               where table_schema = 'dla_tutorial' and table_name='blog_outcomes'
   SQL QUERY: SELECT * FROM blog_outcomes LIMIT 5
           user_id         gender     gender_cat            age           occu           sign      is_indunk     is_student   is_education  is_technology
           3991108              1         female             17         indUnk            Leo              1              0              0              0
           3417138              1         female             25 Communications         Taurus              0              0              0              0
           3673414              0           male             14        Student        Scorpio              0              1              0              0
           3361075              1         female             16        Student      Capricorn              0              1              0              0
           4115327              1         female             14         indUnk          Libra              1              0              0              0