execsql2 2.29.0__py3-none-any.whl → 2.31.1__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.
Files changed (67) hide show
  1. execsql/__main__.py +4 -5
  2. execsql/api.py +6 -0
  3. execsql/cli/__init__.py +3 -14
  4. execsql/cli/application.py +6 -4
  5. execsql/cli/commands/lint.py +5 -2
  6. execsql/cli/commands/lsp.py +42 -0
  7. execsql/cli/dsn.py +38 -2
  8. execsql/cli/lint.py +24 -7
  9. execsql/cli/run.py +22 -9
  10. execsql/config.py +58 -10
  11. execsql/data/execsql.conf.template +8 -2
  12. execsql/db/access.py +7 -5
  13. execsql/db/base.py +18 -0
  14. execsql/db/duckdb.py +96 -14
  15. execsql/db/factory.py +11 -1
  16. execsql/db/mysql.py +56 -3
  17. execsql/db/odbc.py +45 -0
  18. execsql/db/postgres.py +1 -1
  19. execsql/db/sqlserver.py +37 -21
  20. execsql/exporters/ods.py +146 -41
  21. execsql/exporters/values.py +166 -9
  22. execsql/gui/__init__.py +3 -31
  23. execsql/importers/base.py +1 -1
  24. execsql/importers/csv.py +1 -1
  25. execsql/importers/ods.py +2 -0
  26. execsql/lsp/_util.py +21 -0
  27. execsql/lsp/cache.py +73 -0
  28. execsql/lsp/code_actions.py +10 -14
  29. execsql/lsp/completion.py +8 -15
  30. execsql/lsp/diagnostics.py +15 -3
  31. execsql/lsp/document.py +142 -41
  32. execsql/lsp/hover.py +5 -13
  33. execsql/lsp/navigation.py +7 -10
  34. execsql/lsp/server.py +111 -29
  35. execsql/manifest.py +29 -9
  36. execsql/metacommands/__init__.py +0 -2
  37. execsql/metacommands/io_fileops.py +16 -5
  38. execsql/metacommands/reference.py +1 -1
  39. execsql/metacommands/upsert.py +10 -1
  40. execsql/script/executor.py +2 -21
  41. execsql/state.py +6 -3
  42. execsql/state.pyi +2 -0
  43. execsql/utils/auth.py +21 -14
  44. execsql/utils/errors.py +20 -37
  45. execsql/utils/fileio.py +44 -48
  46. execsql/utils/paths.py +31 -0
  47. execsql/utils/regex.py +0 -5
  48. {execsql2-2.29.0.data → execsql2-2.31.1.data}/data/execsql2_extras/README.md +9 -8
  49. {execsql2-2.29.0.data → execsql2-2.31.1.data}/data/execsql2_extras/md_compare.sql +53 -29
  50. {execsql2-2.29.0.data → execsql2-2.31.1.data}/data/execsql2_extras/md_glossary.sql +20 -20
  51. {execsql2-2.29.0.data → execsql2-2.31.1.data}/data/execsql2_extras/md_upsert.sql +59 -66
  52. {execsql2-2.29.0.data → execsql2-2.31.1.data}/data/execsql2_extras/pg_compare.sql +19 -22
  53. {execsql2-2.29.0.data → execsql2-2.31.1.data}/data/execsql2_extras/pg_glossary.sql +13 -17
  54. {execsql2-2.29.0.data → execsql2-2.31.1.data}/data/execsql2_extras/script_template.sql +302 -299
  55. {execsql2-2.29.0.data → execsql2-2.31.1.data}/data/execsql2_extras/ss_compare.sql +39 -29
  56. {execsql2-2.29.0.data → execsql2-2.31.1.data}/data/execsql2_extras/ss_glossary.sql +13 -17
  57. {execsql2-2.29.0.data → execsql2-2.31.1.data}/data/execsql2_extras/ss_upsert.sql +56 -66
  58. {execsql2-2.29.0.dist-info → execsql2-2.31.1.dist-info}/METADATA +17 -43
  59. {execsql2-2.29.0.dist-info → execsql2-2.31.1.dist-info}/RECORD +66 -63
  60. execsql2-2.29.0.data/data/execsql2_extras/pg_upsert.sql +0 -2791
  61. {execsql2-2.29.0.data → execsql2-2.31.1.data}/data/execsql2_extras/config_settings.sqlite +0 -0
  62. {execsql2-2.29.0.data → execsql2-2.31.1.data}/data/execsql2_extras/example_config_prompt.sql +0 -0
  63. {execsql2-2.29.0.data → execsql2-2.31.1.data}/data/execsql2_extras/make_config_db.sql +0 -0
  64. {execsql2-2.29.0.dist-info → execsql2-2.31.1.dist-info}/WHEEL +0 -0
  65. {execsql2-2.29.0.dist-info → execsql2-2.31.1.dist-info}/entry_points.txt +0 -0
  66. {execsql2-2.29.0.dist-info → execsql2-2.31.1.dist-info}/licenses/LICENSE.txt +0 -0
  67. {execsql2-2.29.0.dist-info → execsql2-2.31.1.dist-info}/licenses/NOTICE +0 -0
@@ -36,9 +36,10 @@
36
36
  --
37
37
  -- AUTHORS
38
38
  -- Dreas Nielsen (RDN)
39
+ -- Caleb Grant (CG)
39
40
  --
40
41
  -- VERSION
41
- -- 1.0.1
42
+ -- 1.1.0
42
43
  --
43
44
  -- HISTORY
44
45
  -- Date Remarks
@@ -51,13 +52,17 @@
51
52
  -- summarization. Modified item addition to do nothing on
52
53
  -- conflicts. Modified to use subquery instead of CTE when
53
54
  -- appending a new item. Version 1.0.1. RDN.
55
+ -- 2026-10-15 execsql2: each script's notes are its docstring (SHOW SCRIPTS, the
56
+ -- language server); def_url is a declared optional parameter;
57
+ -- ADD_GLOSSARY_ITEM keeps def_url. Version 1.1.0. Tested in
58
+ -- tests/templates of the execsql2 repository. CG.
54
59
  -- ============================================================================
55
60
 
56
61
 
57
62
  -- ################################################################
58
63
  -- Script INIT_GLOSSARY
59
64
  -- ===============================================================
60
- --
65
+ -- !x! BEGIN SCRIPT INIT_GLOSSARY with parameters (glossary_db_alias, glossary_table, name_col, def_col, def_url="")
61
66
  -- Initialize the custom glossary and describe the master glossary
62
67
  -- that will provide descriptions to include in the custom glossary.
63
68
  --
@@ -74,14 +79,12 @@
74
79
  -- Optional input argument:
75
80
  -- def_url : The URL of a page that provides additional
76
81
  -- information about the column (or other object).
77
- -- ===============================================================
78
- -- !x! BEGIN SCRIPT INIT_GLOSSARY with parameters (glossary_db_alias, glossary_table, name_col, def_col)
79
82
 
80
83
  -- !x! sub gls_alias !!#glossary_db_alias!!
81
84
  -- !x! sub gls_table !!#glossary_table!!
82
85
  -- !x! sub gls_name !!#name_col!!
83
86
  -- !x! sub gls_def !!#def_col!!
84
- -- !x! if(sub_defined(#def_url))
87
+ -- !x! if(not is_null("!!#def_url!!"))
85
88
  -- !x! sub gls_has_url Yes
86
89
  -- !x! sub gls_url !!#def_url!!
87
90
  -- !x! sub ~url_colspec !!gls_url!! text,
@@ -121,13 +124,11 @@ from gls_glossary order by !!gls_name!!;
121
124
  -- ################################################################
122
125
  -- Script ADD_GLOSSARY_LIST
123
126
  -- ===============================================================
124
- --
127
+ -- !x! BEGIN SCRIPT ADD_GLOSSARY_LIST with parameters (column_list)
125
128
  -- Add a specific list of columns to the glossary.
126
129
  --
127
130
  -- Required input arguments:
128
131
  -- column_list : A string of comma-separated column names.
129
- -- ===============================================================
130
- -- !x! BEGIN SCRIPT ADD_GLOSSARY_LIST with parameters (column_list)
131
132
 
132
133
  -- !x! sub ~entry_alias !!$current_alias!!
133
134
  -- !x! use initial
@@ -196,7 +197,7 @@ drop table gls_newglossary cascade;
196
197
  -- ################################################################
197
198
  -- Script ADD_GLOSSARY_ITEM
198
199
  -- ===============================================================
199
- --
200
+ -- !x! BEGIN SCRIPT ADD_GLOSSARY_ITEM with parameters (item, definition, def_url="")
200
201
  -- Add an object name and definition to the custom glossary.
201
202
  -- This does not use the master glossary.
202
203
  --
@@ -208,14 +209,12 @@ drop table gls_newglossary cascade;
208
209
  -- Optional input argument:
209
210
  -- def_url : The URL of a page that provides additional
210
211
  -- information about the item.
211
- -- ===============================================================
212
- -- !x! BEGIN SCRIPT ADD_GLOSSARY_ITEM with parameters (item, definition)
213
212
 
214
213
  -- !x! sub ~entry_alias !!$current_alias!!
215
214
  -- !x! use initial
216
215
 
217
- -- !x! if(is_true(gls_has_url))
218
- -- !x! andif(sub_defined(#def_url))
216
+ -- !x! if(is_true(!!gls_has_url!!))
217
+ -- !x! andif(not is_null("!!#def_url!!"))
219
218
  insert into gls_glossary (!!gls_name!!, !!gls_def!!, !!gls_url!!)
220
219
  select
221
220
  inp.item, inp.definition, inp.url
@@ -248,16 +247,13 @@ drop table gls_newglossary cascade;
248
247
  -- ################################################################
249
248
  -- Script ADD_GLOSSARY_TABLE
250
249
  -- ===============================================================
251
- --
250
+ -- !x! BEGIN SCRIPT ADD_GLOSSARY_TABLE with parameters (schema, table)
252
251
  -- Add definitions of all columns in a specified table to the
253
252
  -- custom glossary.
254
253
  --
255
254
  -- Required input arguments:
256
255
  -- schema : The schema of the table.
257
256
  -- table : The table name.
258
- --
259
- -- ===============================================================
260
- -- !x! BEGIN SCRIPT ADD_GLOSSARY_TABLE with parameters (schema, table)
261
257
 
262
258
  -- !x! sub ~entry_alias !!$current_alias!!
263
259