• R/O
  • SSH

execsql: Commit

Default repository for execsql.py


Commit MetaInfo

Revision87bfb550e033f7e8ce379667c08481949505c06b (tree)
Time2022-08-28 03:36:13
Authorrdnielsen
Commiterrdnielsen

Log Message

Added replacement of deferred variables when a 'LOOP' metacommand is encountered.

Change Summary

Incremental Difference

diff -r eda09bb2f5e7 -r 87bfb550e033 execsql/execsql.py
--- a/execsql/execsql.py Fri Aug 12 15:04:50 2022 -0700
+++ b/execsql/execsql.py Sat Aug 27 11:36:13 2022 -0700
@@ -27,12 +27,12 @@
2727 #
2828 # ===============================================================================
2929
30-__version__ = "1.103.2"
31-__vdate = "2022-08-08"
30+__version__ = "1.103.3"
31+__vdate = "2022-08-27"
3232
3333 primary_vno = 1
3434 secondary_vno = 103
35-tertiary_vno = 2
35+tertiary_vno = 3
3636
3737 import os
3838 import os.path
@@ -6152,6 +6152,12 @@
61526152 # Don't run this command, but save it or complete the loop and add the loop's set of commands to the stack.
61536153 if cmditem.command_type == 'cmd' and loop_rx.match(cmditem.command.statement):
61546154 loop_nest_level += 1
6155+ # Substitute any deferred substitution variables with regular substition var flags, e.g.: "!!somevar!!"
6156+ m = defer_rx.findall(cmditem.command.statement)
6157+ if m is not None:
6158+ for dv in m:
6159+ rep = "!!" + dv[1] + "!!"
6160+ cmditem.command.statement = cmditem.command.statement.replace(dv[0], rep)
61556161 loopcommandstack[-1].add(cmditem)
61566162 elif cmditem.command_type == 'cmd' and endloop_rx.match(cmditem.command.statement):
61576163 if loop_nest_level == 0:
diff -r eda09bb2f5e7 -r 87bfb550e033 setup.py
--- a/setup.py Fri Aug 12 15:04:50 2022 -0700
+++ b/setup.py Sat Aug 27 11:36:13 2022 -0700
@@ -5,7 +5,7 @@
55 long_description = f.read()
66
77 setuptools.setup(name='execsql',
8- version='1.103.2',
8+ version='1.103.3',
99 description="Runs a SQL script against a PostgreSQL, MS-Access, SQLite, MS-SQL-Server, MySQL, MariaDB, Firebird, or Oracle database, or an ODBC DSN. Provides metacommands to import and export data, copy data between databases, conditionally execute SQL and metacommands, and dynamically alter SQL and metacommands with substitution variables. Data can be exported in 18 different formats, including CSV, TSV, ODS, HTML, JSON, LaTeX, and Markdown tables, and using custom templates.",
1010 author='Dreas Nielsen',
1111 author_email='dreas.nielsen@gmail.com',
Show on old repository browser