• R/O
  • SSH

execsql: Commit

Default repository for execsql.py


Commit MetaInfo

Révisionef3f0914a4bd9e8367c8c4fd2b1866565fdc674d (tree)
l'heure2016-02-14 05:32:40
AuteurDreas Nielsen <dreas.nielsen@gmai...>
CommiterDreas Nielsen

Message de Log

Added , , , and system variables.

Change Summary

Modification

diff -r 0967da7ae8ee -r ef3f0914a4bd doc/execsql.htm
--- a/doc/execsql.htm Sat Feb 13 11:46:53 2016 -0800
+++ b/doc/execsql.htm Sat Feb 13 12:32:40 2016 -0800
@@ -6,7 +6,7 @@
66 <meta name="description" content="Documentation for execsql.py, a scripting client for PostgreSQL, SQL Server, MS-Access, SQLite, MariaDB, MySQL, and Firebird databases." />
77 <meta name="author" content="R. Dreas Nielsen" />
88 <meta name="created" content="2008-04-27" />
9-<meta name="revised" content="2016-02-06" />
9+<meta name="revised" content="2016-02-13" />
1010 <meta name="copyright" content="Copyright (c) 2015, 2016, R. Dreas Nielsen" />
1111 <style type="text/css">
1212 html, body {
@@ -1106,6 +1106,25 @@
11061106 versions to directory names or file names. See
11071107 <a href="#example8">Example 8</a> for an illustration of its use.</dd>
11081108
1109+<dt class="normal">$DB_NAME</dt><dd>The name of the database currently in
1110+use, as specified on the command line or in a <a href="#connect">CONNECT</a>
1111+metacommand. This will be the database name for server-based databases,
1112+and the file name for file-based databases.</dd>
1113+
1114+<dt class="normal">$DB_NEED_PWD</dt><dd>A string equal to "TRUE" or "FALSE"
1115+indicating whether or not a password was required for the database
1116+currently in use.</dd>
1117+
1118+<dt class="normal">$DB_SERVER</dt><dd>The name of the database server
1119+for the database currently in use, as specified on the command line or
1120+in a <a href="#connect">CONNECT</a> metacommand. If the database in use
1121+is not server-based, the result will be an empty string.</dd>
1122+
1123+<dt class="normal">$DB_USER</dt><dd>The name of the database user for the
1124+database currently in use, as specified on the command line or in a
1125+<a href="#connect">CONNECT</a> metacommand. If the database connection
1126+does not require a user name, the result will be an empty string.</dd>
1127+
11091128 <dt class="normal">$ERROR_HALT_STATE</dt><dd>The value of the status
11101129 flag that is set by the <a href="#errorhalt">ERROR_HALT</a>
11111130 metacommand. The value of this variable is always either "ON" or
diff -r 0967da7ae8ee -r ef3f0914a4bd execsql/execsql.py
--- a/execsql/execsql.py Sat Feb 13 11:46:53 2016 -0800
+++ b/execsql/execsql.py Sat Feb 13 12:32:40 2016 -0800
@@ -27,7 +27,7 @@
2727 #
2828 # ===============================================================================
2929
30-__version__ = "1.2.14.3"
30+__version__ = "1.2.15.0"
3131 _vdate = "2016-02-13"
3232
3333 import os.path
@@ -2505,6 +2505,8 @@
25052505 self.type = dbt_sqlite
25062506 self.server_name = None
25072507 self.db_name = SQLite_fn
2508+ self.user = None
2509+ self.need_passwd = False
25082510 self.encoding = 'UTF-8'
25092511 self.paramstr = '?'
25102512 self.conn = None
@@ -3630,6 +3632,10 @@
36303632 self.subvars.add_substitution("$CURRENT_DIR", os.path.abspath(os.path.curdir))
36313633 self.subvars.add_substitution("$AUTOCOMMIT_STATE", "ON" if dbs.current().autocommit else "OFF")
36323634 self.subvars.add_substitution("$TIMER", unicode(datetime.timedelta(seconds=timer.elapsed())))
3635+ self.subvars.add_substitution("$DB_USER", dbs.current().user if dbs.current().user else '')
3636+ self.subvars.add_substitution("$DB_SERVER", dbs.current().server_name if dbs.current().server_name else '')
3637+ self.subvars.add_substitution("$DB_NAME", dbs.current().db_name)
3638+ self.subvars.add_substitution("$DB_NEED_PWD", "TRUE" if dbs.current().need_passwd else "FALSE")
36333639 while True:
36343640 match_found = False
36353641 cmditem.sql, match_found = self.subvars.substitute(cmditem.sql)
Afficher sur ancien navigateur de dépôt.