# HG changeset patch # User catherine@dellzilla # Date 1228429499 18000 # Node ID 6e69f866b702cce46bac71de102c27951b0321e1 # Parent 54cd1e802fa086ed5b6108e59f5a775371d8b128 tests for \dv diff -r 54cd1e802fa0 -r 6e69f866b702 sqlpython/exampleSession.txt --- a/sqlpython/exampleSession.txt Thu Dec 04 16:43:42 2008 -0500 +++ b/sqlpython/exampleSession.txt Thu Dec 04 17:24:59 2008 -0500 @@ -259,6 +259,52 @@ 2 rows selected. +testschema@orcl> -- \d command inspired by postgresql's psql +testschema@orcl> \dt + +TABLE_NAME TYPE +---------- ----- +PLAY TABLE + +1 row selected. + +testschema@orcl> \di + +INDEX_NAME INDEX_TYPE +---------- ---------- +XPK_PLAY NORMAL + +1 row selected. + +testschema@orcl> CREATE OR REPLACE VIEW review +> AS +> SELECT title, author, 'A masterpiece!' review +> FROM play; + +Executed + +testschema@orcl> \dv + +VIEW_NAME TYPE +--------- ---- +REVIEW VIEW + +1 row selected. + +testschema@orcl> cat review + +TITLE AUTHOR REVIEW +------------- ----------- -------------- +Twelfth Night Shakespeare A masterpiece! +The Tempest Shakespeare A masterpiece! +Agamemnon Aeschylus A masterpiece! + +3 rows selected. + +testschema@orcl> drop view review; + +Executed + testschema@orcl> drop table play; Executed diff -r 54cd1e802fa0 -r 6e69f866b702 sqlpython/mysqlpy.py --- a/sqlpython/mysqlpy.py Thu Dec 04 16:43:42 2008 -0500 +++ b/sqlpython/mysqlpy.py Thu Dec 04 17:24:59 2008 -0500 @@ -106,10 +106,6 @@ which get and run SQL scripts from disk.''' self.do_select(self.query_load10g) - def do_himom(self,args): - '''greets your mom''' - print 'hi mom' - def do_db(self,args,filepath='pass.txt'): '''Exec do_connect to db_alias in args (credentials form the file pass.txt) ''' f = open(filepath,'r')