Mercurial > sqlpython
changeset 464:26f60d5910a0
doubledashcomment moved into sqlpyPlus to define parser after local comment definition
author | catherine@Drou |
---|---|
date | Mon, 01 Mar 2010 23:26:38 -0500 |
parents | 317c0bb8afa4 |
children | 0be350ab306c |
files | docs/source/intro.rst sqlpython/sqlpyPlus.py |
diffstat | 2 files changed, 15 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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):