# HG changeset patch # User catherine@Drou # Date 1267503998 18000 # Node ID 26f60d5910a0c1d44e2d2bad5d3b31fd1789b75a # Parent 317c0bb8afa43d3b5f55175e4b2f2c00037295e9 doubledashcomment moved into sqlpyPlus to define parser after local comment definition diff -r 317c0bb8afa4 -r 26f60d5910a0 docs/source/intro.rst --- a/docs/source/intro.rst Sat Feb 27 23:15:30 2010 -0500 +++ b/docs/source/intro.rst Mon Mar 01 23:26:38 2010 -0500 @@ -7,9 +7,10 @@ * Current docs: http://packages.python.org/sqlpython/ * Mailing list: http://groups.google.com/group/sqlpython -SQLPython is a command-line interface to Oracle databases. It is intended as an alternative to Oracle's -SQL\*Plus. For the most part, it can be used the same way SQL\*Plus would be used; this documentation -focuses on the places where SQLPython differs. +SQLPython is a command-line interface to relational databases. It was created as an alternative to Oracle's +``SQL\*Plus``, and can likewise be used instead of postgres' ``psql`` or mysql's ``mysql`` text clients. +For the most part, it can be used as any other text-based SQL interface would; this document focuses on +the extra capabilities License ------- @@ -87,8 +88,11 @@ Non-Oracle RDBMS ---------------- -As of sqlpython 1.6.4, preliminary work has begun to adapt sqlpython to non-Oracle databases. -You may use it to run queries against postgreSQL, MySQL, etc., but data-dictionary access -commands (`ls`, `grep`, `refs`, etc.) will generate errors. Connection to non-Oracle databases -is currently only possible via URL connection strings. +Version 1.7.0 of sqlpython works against PostgreSQL and MySQL, though the testing against +those databases has been very slight thus far. Help in testing and improving sqlpython's +functions against those databases is welcome. Support for Microsoft SQL Server and sqlite +will be available as soon as those databases are added to the Gerald project, and volunteers +for Gerald will benefit sqlpython as well. +As of 1.7.0, sqlpython sessions can only "see" metadata within the named schema belonging +to the currently connected user. A fix for this is expected for 1.7.1. \ No newline at end of file diff -r 317c0bb8afa4 -r 26f60d5910a0 sqlpython/sqlpyPlus.py --- a/sqlpython/sqlpyPlus.py Sat Feb 27 23:15:30 2010 -0500 +++ b/sqlpython/sqlpyPlus.py Mon Mar 01 23:26:38 2010 -0500 @@ -26,7 +26,7 @@ import sys, os, re, sqlpython, pyparsing, re, completion import datetime, pickle, binascii, subprocess, time, itertools, hashlib import traceback, operator -from cmd2 import Cmd, make_option, options, Statekeeper, Cmd2TestCase +from cmd2 import Cmd, make_option, options, Statekeeper, Cmd2TestCase, options_defined from output_templates import output_templates from metadata import metaqueries from plothandler import Plot @@ -393,6 +393,9 @@ version''' def __init__(self): + # override commentGrammars before top-level __init__, or they won't affect self.parser + self.doubleDashComment = pyparsing.NotAny(pyparsing.Or(options_defined)) + pyparsing.Literal('--') + pyparsing.restOfLine + self.commentGrammars = pyparsing.Or([pyparsing.cStyleComment, self.doubleDashComment]) sqlpython.sqlpython.__init__(self) self.binds = CaselessDict() if self.settable.has_key('case_insensitive'): @@ -413,7 +416,6 @@ self.rdbms_supported = Abbreviatable_List('oracle postgres mysql'.split()) self.version = 'SQLPython %s' % sqlpython.__version__ self.pystate = {'r': [], 'binds': self.binds, 'substs': self.substvars} - self.commentGrammars = pyparsing.Or([pyparsing.cStyleComment, self.doubleDashComment]) # overrides cmd's parseline def parseline(self, line):