E&S CVS Commit: PEAK - SQSH-inspired variables and substitution!
tsarna at eby-sarna.com
tsarna at eby-sarna.com
Fri Aug 1 15:05:00 EDT 2003
Module Name: PEAK
Committed By: tsarna
Date: Fri Aug 1 19:04:19 UTC 2003
Modified Files:
PEAK/src/peak/running/tools/n2: sql.py
Log Message:
SQSH-inspired variables and substitution!
\set [-x] name=var [name2=var2] [...], \export var, \import var
Exported means something different in n2: the variable is connected to
the same-named variable in the python interpreter. \export var is like
\set -x var=${var}. \import marks a variable exported without touching
it, effectively importing it from python.
Unlike SQSH, *only* the ${var} form of variable substituion is recognized,
and it's recognized everywhere. Like SQSH, variable substitution is
performed on the input buffer before it is submitted, unless -n is given
to "go".
As an extension to SQSH, you can specify $varname as a buffer name to
load/copy/etc from/to a variable with the buf-xxx commands.
Also, the variable "prompt" now controls the format of the prompt. $L is
expanded into the line number, $S into the parser state (C for in a
comment, etc).
TODO: more things need to take defaults from variables. The variables in
turn should take their default defaults from peak.n2.sql.* properties or
something.
Also, PJE pointed out that the xacts support in go is kind of silly in
an always-in-transaction environment... actually, this is an issue in of
itself, currently there is now way not to be in a transaction for
databases like Sybase that support it, even though in Sybase you have to
be outside a transaction to do some things. XXX
To view diffs of this commit, you can use the following URL(s):
http://cvs.eby-sarna.com/PEAK/src/peak/running/tools/n2/sql.py.diff?r1=1.11&r2=1.12
To generate a diff of this commit:
cvs rdiff -r1.11 -r1.12 PEAK/src/peak/running/tools/n2/sql.py
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
More information about the source-changes
mailing list