execsql2 2.16.14__py3-none-any.whl → 2.16.15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- execsql/format.py +0 -1
- execsql/metacommands/debug.py +45 -41
- execsql/metacommands/dispatch.py +2 -9
- {execsql2-2.16.14.dist-info → execsql2-2.16.15.dist-info}/METADATA +1 -1
- {execsql2-2.16.14.dist-info → execsql2-2.16.15.dist-info}/RECORD +24 -24
- {execsql2-2.16.14.data → execsql2-2.16.15.data}/data/execsql2_extras/README.md +0 -0
- {execsql2-2.16.14.data → execsql2-2.16.15.data}/data/execsql2_extras/config_settings.sqlite +0 -0
- {execsql2-2.16.14.data → execsql2-2.16.15.data}/data/execsql2_extras/example_config_prompt.sql +0 -0
- {execsql2-2.16.14.data → execsql2-2.16.15.data}/data/execsql2_extras/execsql.conf +0 -0
- {execsql2-2.16.14.data → execsql2-2.16.15.data}/data/execsql2_extras/make_config_db.sql +0 -0
- {execsql2-2.16.14.data → execsql2-2.16.15.data}/data/execsql2_extras/md_compare.sql +0 -0
- {execsql2-2.16.14.data → execsql2-2.16.15.data}/data/execsql2_extras/md_glossary.sql +0 -0
- {execsql2-2.16.14.data → execsql2-2.16.15.data}/data/execsql2_extras/md_upsert.sql +0 -0
- {execsql2-2.16.14.data → execsql2-2.16.15.data}/data/execsql2_extras/pg_compare.sql +0 -0
- {execsql2-2.16.14.data → execsql2-2.16.15.data}/data/execsql2_extras/pg_glossary.sql +0 -0
- {execsql2-2.16.14.data → execsql2-2.16.15.data}/data/execsql2_extras/pg_upsert.sql +0 -0
- {execsql2-2.16.14.data → execsql2-2.16.15.data}/data/execsql2_extras/script_template.sql +0 -0
- {execsql2-2.16.14.data → execsql2-2.16.15.data}/data/execsql2_extras/ss_compare.sql +0 -0
- {execsql2-2.16.14.data → execsql2-2.16.15.data}/data/execsql2_extras/ss_glossary.sql +0 -0
- {execsql2-2.16.14.data → execsql2-2.16.15.data}/data/execsql2_extras/ss_upsert.sql +0 -0
- {execsql2-2.16.14.dist-info → execsql2-2.16.15.dist-info}/WHEEL +0 -0
- {execsql2-2.16.14.dist-info → execsql2-2.16.15.dist-info}/entry_points.txt +0 -0
- {execsql2-2.16.14.dist-info → execsql2-2.16.15.dist-info}/licenses/LICENSE.txt +0 -0
- {execsql2-2.16.14.dist-info → execsql2-2.16.15.dist-info}/licenses/NOTICE +0 -0
execsql/format.py
CHANGED
execsql/metacommands/debug.py
CHANGED
|
@@ -7,8 +7,8 @@ Provides ``x_debug_write_metacommands``, which implements the
|
|
|
7
7
|
``WRITE METACOMMANDS`` debug metacommand that prints the full registered
|
|
8
8
|
metacommand list to the log/console for troubleshooting.
|
|
9
9
|
|
|
10
|
-
Also provides ``x_show_scripts``
|
|
11
|
-
|
|
10
|
+
Also provides ``x_show_scripts`` for runtime introspection of registered
|
|
11
|
+
SCRIPT blocks.
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
14
|
from pathlib import Path
|
|
@@ -214,50 +214,54 @@ def _format_script_source(span: Any) -> str:
|
|
|
214
214
|
|
|
215
215
|
|
|
216
216
|
# ---------------------------------------------------------------------------
|
|
217
|
-
# SHOW SCRIPTS
|
|
217
|
+
# SHOW SCRIPTS metacommand handler
|
|
218
218
|
# ---------------------------------------------------------------------------
|
|
219
219
|
|
|
220
220
|
|
|
221
221
|
def x_show_scripts(**kwargs: Any) -> None:
|
|
222
|
-
"""List all registered
|
|
223
|
-
scripts = _state.ast_scripts
|
|
224
|
-
if not scripts:
|
|
225
|
-
_state.output.write("No scripts registered.\n")
|
|
226
|
-
return
|
|
227
|
-
_state.output.write(f"Registered scripts ({len(scripts)}):\n\n")
|
|
228
|
-
# Compute column width for alignment
|
|
229
|
-
sigs = {name: _format_script_signature(name, block.param_defs) for name, block in scripts.items()}
|
|
230
|
-
max_sig = max(len(s) for s in sigs.values())
|
|
231
|
-
for name, block in scripts.items():
|
|
232
|
-
sig = sigs[name]
|
|
233
|
-
src = _format_script_source(block.span)
|
|
234
|
-
_state.output.write(f" {sig:<{max_sig}} {src}\n")
|
|
235
|
-
_state.output.write("\n")
|
|
222
|
+
"""List all registered scripts, or show detail for one script.
|
|
236
223
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
224
|
+
Without a name argument, lists all registered SCRIPT definitions with
|
|
225
|
+
their parameter signatures and source locations. With a name, shows
|
|
226
|
+
detail for that script including parameters, source, and docstring.
|
|
227
|
+
"""
|
|
228
|
+
script_name = (kwargs.get("script_id") or "").strip().lower()
|
|
241
229
|
scripts = _state.ast_scripts
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
_state.output.write("
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
230
|
+
|
|
231
|
+
if script_name:
|
|
232
|
+
# ---------- detail for one script ----------
|
|
233
|
+
if script_name not in scripts:
|
|
234
|
+
_state.output.write(f"No script named '{script_name}' is registered.\n")
|
|
235
|
+
return
|
|
236
|
+
block = scripts[script_name]
|
|
237
|
+
sig = _format_script_signature(block.name, block.param_defs)
|
|
238
|
+
src = _format_script_source(block.span)
|
|
239
|
+
_state.output.write(f"Script: {sig}\n")
|
|
240
|
+
_state.output.write(f"Source: {src}\n")
|
|
241
|
+
if block.param_defs:
|
|
242
|
+
_state.output.write("Parameters:\n")
|
|
243
|
+
max_name = max(len(p.name) for p in block.param_defs)
|
|
244
|
+
for p in block.param_defs:
|
|
245
|
+
if p.default is not None:
|
|
246
|
+
_state.output.write(f" {p.name:<{max_name}} (optional, default: {p.default})\n")
|
|
247
|
+
else:
|
|
248
|
+
_state.output.write(f" {p.name:<{max_name}} (required)\n")
|
|
249
|
+
else:
|
|
250
|
+
_state.output.write("Parameters: (none)\n")
|
|
251
|
+
if block.doc:
|
|
252
|
+
_state.output.write("\n")
|
|
253
|
+
for doc_line in block.doc.split("\n"):
|
|
254
|
+
_state.output.write(f" {doc_line}\n")
|
|
258
255
|
else:
|
|
259
|
-
|
|
260
|
-
|
|
256
|
+
# ---------- list all scripts ----------
|
|
257
|
+
if not scripts:
|
|
258
|
+
_state.output.write("No scripts registered.\n")
|
|
259
|
+
return
|
|
260
|
+
_state.output.write(f"Registered scripts ({len(scripts)}):\n\n")
|
|
261
|
+
sigs = {name: _format_script_signature(name, block.param_defs) for name, block in scripts.items()}
|
|
262
|
+
max_sig = max(len(s) for s in sigs.values())
|
|
263
|
+
for name, block in scripts.items():
|
|
264
|
+
sig = sigs[name]
|
|
265
|
+
src = _format_script_source(block.span)
|
|
266
|
+
_state.output.write(f" {sig:<{max_sig}} {src}\n")
|
|
261
267
|
_state.output.write("\n")
|
|
262
|
-
for doc_line in block.doc.split("\n"):
|
|
263
|
-
_state.output.write(f" {doc_line}\n")
|
execsql/metacommands/dispatch.py
CHANGED
|
@@ -99,7 +99,6 @@ from execsql.metacommands.debug import (
|
|
|
99
99
|
x_debug_write_metacommands,
|
|
100
100
|
x_debug_write_odbc_drivers,
|
|
101
101
|
x_debug_write_subvars,
|
|
102
|
-
x_show_script,
|
|
103
102
|
x_show_scripts,
|
|
104
103
|
)
|
|
105
104
|
from execsql.debug.repl import x_breakpoint
|
|
@@ -1750,20 +1749,14 @@ def build_dispatch_table() -> MetaCommandList:
|
|
|
1750
1749
|
)
|
|
1751
1750
|
|
|
1752
1751
|
# ------------------------------------------------------------------
|
|
1753
|
-
# SHOW SCRIPTS
|
|
1752
|
+
# SHOW SCRIPTS [<name>]
|
|
1754
1753
|
# ------------------------------------------------------------------
|
|
1755
1754
|
mcl.add(
|
|
1756
|
-
r"^\s*SHOW\s+SCRIPTS\s*$",
|
|
1755
|
+
r"^\s*SHOW\s+SCRIPTS\s*(?P<script_id>\w+)?\s*$",
|
|
1757
1756
|
x_show_scripts,
|
|
1758
1757
|
description="SHOW SCRIPTS",
|
|
1759
1758
|
category="action",
|
|
1760
1759
|
)
|
|
1761
|
-
mcl.add(
|
|
1762
|
-
r"^\s*SHOW\s+SCRIPT\s+(?P<script_id>\w+)\s*$",
|
|
1763
|
-
x_show_script,
|
|
1764
|
-
description="SHOW SCRIPT",
|
|
1765
|
-
category="action",
|
|
1766
|
-
)
|
|
1767
1760
|
|
|
1768
1761
|
# ------------------------------------------------------------------
|
|
1769
1762
|
# IF / ORIF / ANDIF / ELSEIF / ELSE / ENDIF
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: execsql2
|
|
3
|
-
Version: 2.16.
|
|
3
|
+
Version: 2.16.15
|
|
4
4
|
Summary: Runs a SQL script against a PostgreSQL, SQLite, MariaDB/MySQL, DuckDB, Firebird, MS-Access, MS-SQL-Server, 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.
|
|
5
5
|
Project-URL: Homepage, https://execsql2.readthedocs.io
|
|
6
6
|
Project-URL: Repository, https://github.com/geocoug/execsql
|
|
@@ -3,7 +3,7 @@ execsql/__main__.py,sha256=HdbK-SAhyUmfB6xINY5AzxdMSxGzWSGEG_2dv42Jn64,315
|
|
|
3
3
|
execsql/api.py,sha256=0D2Rl329fvDXERNrJBUzoWEt_VxqCHwRgaGzrq04rVs,19709
|
|
4
4
|
execsql/config.py,sha256=6icjr8PKenUGfFF6lciSclvejjDzY8GTW1OZ1-IZt-Y,29480
|
|
5
5
|
execsql/exceptions.py,sha256=j8hykBiof9H3Za9hwLIbDcVB2Xn65ODXXplp1jkvdgM,8453
|
|
6
|
-
execsql/format.py,sha256=
|
|
6
|
+
execsql/format.py,sha256=Nvkvi1nWw1iTcLDPAlXwdnZfifJib2_kszojMSdZtBA,24365
|
|
7
7
|
execsql/models.py,sha256=kCTUQg9-vReM6WNFfB_ZrEppuOW5u1uMBQThSkfPC0o,13264
|
|
8
8
|
execsql/parser.py,sha256=P3ea8k7T_XLMrbhpFNZXwytdShrY302MKnhosqza1lo,15493
|
|
9
9
|
execsql/plugins.py,sha256=2voLwT6eFap6BCBoZYndNNC_bMEJO1f_aP6xQTVXwYI,12815
|
|
@@ -69,8 +69,8 @@ execsql/metacommands/conditions.py,sha256=B6fBumkqoPO4wcQbw_ypYITaSnzPemAA1g5GrN
|
|
|
69
69
|
execsql/metacommands/connect.py,sha256=Wnlp5PeeaNDaVlaWjCetvarTgQIwIeMPYe8cyslPYeA,14969
|
|
70
70
|
execsql/metacommands/control.py,sha256=PlTAq34OkcmnOsPm3bZxF4mg1MaNBpENa8wzIKVEY10,8302
|
|
71
71
|
execsql/metacommands/data.py,sha256=tRQBGTAuW-eJ2tBNWaoZI9OjTyNNyHJISo7gOdL-sm8,11370
|
|
72
|
-
execsql/metacommands/debug.py,sha256=
|
|
73
|
-
execsql/metacommands/dispatch.py,sha256=
|
|
72
|
+
execsql/metacommands/debug.py,sha256=bFEQhNnKjIJHfc7FuZXIhUwWA-D8bMX7b3Anm5BWJT0,12051
|
|
73
|
+
execsql/metacommands/dispatch.py,sha256=DvpgpkX1yMWnJrVW8ir_o1xKgfZgXzlTt6IwP0Lwoek,87441
|
|
74
74
|
execsql/metacommands/io.py,sha256=vlGBje5sgnqeilooMdhJDgSRIhysHy5_7LrKtik9Xjs,3011
|
|
75
75
|
execsql/metacommands/io_export.py,sha256=iX4L3lpZGT2P5ca2C3XJ3MYxXJ_loC7nWmfKcWv4UGQ,13379
|
|
76
76
|
execsql/metacommands/io_fileops.py,sha256=K7eHMAuCUEVpNITYnJhWaSmXtAnnx1ZaNIFnOwKtXzc,9456
|
|
@@ -99,24 +99,24 @@ execsql/utils/numeric.py,sha256=xh02ANSRk3nUpQ-rtm66ILoMqoi7HtzCoRMIOT9U8QI,1570
|
|
|
99
99
|
execsql/utils/regex.py,sha256=diEzTZqU_HHwVMadPAvN1Vgzhl7I03eVaEFGCXyGGL8,3770
|
|
100
100
|
execsql/utils/strings.py,sha256=5Dvzrk-9SIw2lpxXZQkiJbNyo1sy7iXXAtSULlZ0KG8,8488
|
|
101
101
|
execsql/utils/timer.py,sha256=eDYf5VzCNFk7oo90InJucUm3XcBdhYMogjZMqeg9xzc,1899
|
|
102
|
-
execsql2-2.16.
|
|
103
|
-
execsql2-2.16.
|
|
104
|
-
execsql2-2.16.
|
|
105
|
-
execsql2-2.16.
|
|
106
|
-
execsql2-2.16.
|
|
107
|
-
execsql2-2.16.
|
|
108
|
-
execsql2-2.16.
|
|
109
|
-
execsql2-2.16.
|
|
110
|
-
execsql2-2.16.
|
|
111
|
-
execsql2-2.16.
|
|
112
|
-
execsql2-2.16.
|
|
113
|
-
execsql2-2.16.
|
|
114
|
-
execsql2-2.16.
|
|
115
|
-
execsql2-2.16.
|
|
116
|
-
execsql2-2.16.
|
|
117
|
-
execsql2-2.16.
|
|
118
|
-
execsql2-2.16.
|
|
119
|
-
execsql2-2.16.
|
|
120
|
-
execsql2-2.16.
|
|
121
|
-
execsql2-2.16.
|
|
122
|
-
execsql2-2.16.
|
|
102
|
+
execsql2-2.16.15.data/data/execsql2_extras/README.md,sha256=sxwVyU0ZahCfANv56LahkyuM505kFjrMhe-1SvWE69E,4845
|
|
103
|
+
execsql2-2.16.15.data/data/execsql2_extras/config_settings.sqlite,sha256=aY5cxR7Q7J6zJ4bC9lu5mHUrhy211Cq3MNKPQVCt02E,20480
|
|
104
|
+
execsql2-2.16.15.data/data/execsql2_extras/example_config_prompt.sql,sha256=SY3Jxn1qcVm4kPW9xmmTfknHfvURXmeEYTbRjYrjGSw,7487
|
|
105
|
+
execsql2-2.16.15.data/data/execsql2_extras/execsql.conf,sha256=_45iJ-KWZnB8uMW_gEg067MM5pmGJ-dVl7VbAZMunAE,9530
|
|
106
|
+
execsql2-2.16.15.data/data/execsql2_extras/make_config_db.sql,sha256=WwyC6dK-Eh5CAVppiBCDHqiI1_wEI9U95Ytpr4lsZkg,8726
|
|
107
|
+
execsql2-2.16.15.data/data/execsql2_extras/md_compare.sql,sha256=B8Wd7LZ0vnMY2qvA139JIEBkPObgRH2i5xj6PejTQt8,24092
|
|
108
|
+
execsql2-2.16.15.data/data/execsql2_extras/md_glossary.sql,sha256=DJRHcU5NbFpxTTX-IwH3yRlsboj1q6BBGrUAHKn4Cuo,10796
|
|
109
|
+
execsql2-2.16.15.data/data/execsql2_extras/md_upsert.sql,sha256=v_7GbWh_N1mBTmw3gvTrkagOVp2q0KmXvM8hE-DlFxY,112524
|
|
110
|
+
execsql2-2.16.15.data/data/execsql2_extras/pg_compare.sql,sha256=9dWa8hnfy5dVJI-z2iGpd9JzQmI4j2ziMlEdpnr66ro,24352
|
|
111
|
+
execsql2-2.16.15.data/data/execsql2_extras/pg_glossary.sql,sha256=pKjIIDsROAgJq2H-1qNEcRMAWManivcZ_AEVHzUUlic,9908
|
|
112
|
+
execsql2-2.16.15.data/data/execsql2_extras/pg_upsert.sql,sha256=k7AFiGTLBy3nf-qO5QIaZrEYTAKvdxxU3JDLx9jqkzs,108315
|
|
113
|
+
execsql2-2.16.15.data/data/execsql2_extras/script_template.sql,sha256=1Estacb_vm1FgK41k_G9nuduP1yiA-fQ1Kn4Z4mv5Ao,11153
|
|
114
|
+
execsql2-2.16.15.data/data/execsql2_extras/ss_compare.sql,sha256=TsVxWm3cEpR5-EiMYXNhtaY0arSNeKZhsJdHdLA7xeI,24833
|
|
115
|
+
execsql2-2.16.15.data/data/execsql2_extras/ss_glossary.sql,sha256=cLM7nN8JOIu9ZVP9oY9qdSK3hrnWJiDcX6nZmQQbQWI,13065
|
|
116
|
+
execsql2-2.16.15.data/data/execsql2_extras/ss_upsert.sql,sha256=BCqmBykXBF-BpCgOFeG1qhf2XfScKsxPD17wd1hYfHw,120647
|
|
117
|
+
execsql2-2.16.15.dist-info/METADATA,sha256=6QX4McX0vs9ywf8U7SeURBDnDsKMA4yOdLoQ7ke5uTQ,20921
|
|
118
|
+
execsql2-2.16.15.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
119
|
+
execsql2-2.16.15.dist-info/entry_points.txt,sha256=sUOxkM-dN1eBGGpSpDLsAaE0yNXYQKWZAfxPOlMkQyk,90
|
|
120
|
+
execsql2-2.16.15.dist-info/licenses/LICENSE.txt,sha256=LBdhuxejF8_bLCHZ2kWfmDXpDGUu914Gbd6_3JjCRe0,676
|
|
121
|
+
execsql2-2.16.15.dist-info/licenses/NOTICE,sha256=sqVrM73Ys9zfvWC_P797lHfTnoPW_ETeBSrUTFaob0A,339
|
|
122
|
+
execsql2-2.16.15.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{execsql2-2.16.14.data → execsql2-2.16.15.data}/data/execsql2_extras/example_config_prompt.sql
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|