execsql2 2.2.1__py3-none-any.whl → 2.4.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.
- execsql/cli/run.py +11 -5
- execsql/config.py +52 -0
- execsql/db/access.py +11 -3
- execsql/db/base.py +180 -135
- execsql/db/dsn.py +4 -0
- execsql/db/duckdb.py +4 -0
- execsql/db/factory.py +31 -5
- execsql/db/firebird.py +4 -0
- execsql/db/mysql.py +18 -1
- execsql/db/oracle.py +4 -0
- execsql/db/postgres.py +3 -0
- execsql/db/sqlite.py +3 -0
- execsql/db/sqlserver.py +11 -2
- execsql/exceptions.py +18 -0
- execsql/exporters/base.py +6 -0
- execsql/exporters/delimited.py +36 -0
- execsql/exporters/duckdb.py +4 -0
- execsql/exporters/feather.py +4 -0
- execsql/exporters/html.py +6 -0
- execsql/exporters/json.py +5 -6
- execsql/exporters/latex.py +4 -0
- execsql/exporters/ods.py +28 -7
- execsql/exporters/parquet.py +3 -0
- execsql/exporters/pretty.py +5 -0
- execsql/exporters/raw.py +5 -3
- execsql/exporters/sqlite.py +4 -0
- execsql/exporters/templates.py +16 -6
- execsql/exporters/values.py +4 -0
- execsql/exporters/xls.py +26 -7
- execsql/exporters/xml.py +3 -0
- execsql/exporters/zip.py +15 -0
- execsql/importers/base.py +5 -3
- execsql/importers/csv.py +7 -5
- execsql/importers/feather.py +6 -4
- execsql/importers/ods.py +2 -0
- execsql/importers/xls.py +2 -0
- execsql/metacommands/__init__.py +177 -1968
- execsql/metacommands/dispatch.py +2011 -0
- execsql/models.py +7 -0
- execsql/parser.py +10 -0
- execsql/script/__init__.py +95 -0
- execsql/script/control.py +162 -0
- execsql/{script.py → script/engine.py} +144 -406
- execsql/script/variables.py +281 -0
- execsql/types.py +29 -0
- execsql/utils/auth.py +2 -0
- execsql/utils/crypto.py +4 -6
- execsql/utils/datetime.py +1 -0
- execsql/utils/errors.py +11 -0
- execsql/utils/fileio.py +18 -0
- execsql/utils/gui.py +46 -0
- execsql/utils/mail.py +7 -17
- execsql/utils/numeric.py +2 -0
- execsql/utils/regex.py +9 -0
- execsql/utils/strings.py +16 -0
- execsql/utils/timer.py +2 -0
- execsql2-2.4.1.data/data/execsql2_extras/README.md +65 -0
- {execsql2-2.2.1.data → execsql2-2.4.1.data}/data/execsql2_extras/execsql.conf +1 -1
- {execsql2-2.2.1.dist-info → execsql2-2.4.1.dist-info}/METADATA +8 -1
- execsql2-2.4.1.dist-info/RECORD +108 -0
- execsql2-2.2.1.data/data/execsql2_extras/READ_ME.rst +0 -127
- execsql2-2.2.1.dist-info/RECORD +0 -104
- {execsql2-2.2.1.data → execsql2-2.4.1.data}/data/execsql2_extras/config_settings.sqlite +0 -0
- {execsql2-2.2.1.data → execsql2-2.4.1.data}/data/execsql2_extras/example_config_prompt.sql +0 -0
- {execsql2-2.2.1.data → execsql2-2.4.1.data}/data/execsql2_extras/make_config_db.sql +0 -0
- {execsql2-2.2.1.data → execsql2-2.4.1.data}/data/execsql2_extras/md_compare.sql +0 -0
- {execsql2-2.2.1.data → execsql2-2.4.1.data}/data/execsql2_extras/md_glossary.sql +0 -0
- {execsql2-2.2.1.data → execsql2-2.4.1.data}/data/execsql2_extras/md_upsert.sql +0 -0
- {execsql2-2.2.1.data → execsql2-2.4.1.data}/data/execsql2_extras/pg_compare.sql +0 -0
- {execsql2-2.2.1.data → execsql2-2.4.1.data}/data/execsql2_extras/pg_glossary.sql +0 -0
- {execsql2-2.2.1.data → execsql2-2.4.1.data}/data/execsql2_extras/pg_upsert.sql +0 -0
- {execsql2-2.2.1.data → execsql2-2.4.1.data}/data/execsql2_extras/script_template.sql +0 -0
- {execsql2-2.2.1.data → execsql2-2.4.1.data}/data/execsql2_extras/ss_compare.sql +0 -0
- {execsql2-2.2.1.data → execsql2-2.4.1.data}/data/execsql2_extras/ss_glossary.sql +0 -0
- {execsql2-2.2.1.data → execsql2-2.4.1.data}/data/execsql2_extras/ss_upsert.sql +0 -0
- {execsql2-2.2.1.dist-info → execsql2-2.4.1.dist-info}/WHEEL +0 -0
- {execsql2-2.2.1.dist-info → execsql2-2.4.1.dist-info}/entry_points.txt +0 -0
- {execsql2-2.2.1.dist-info → execsql2-2.4.1.dist-info}/licenses/LICENSE.txt +0 -0
- {execsql2-2.2.1.dist-info → execsql2-2.4.1.dist-info}/licenses/NOTICE +0 -0
execsql/metacommands/__init__.py
CHANGED
|
@@ -10,209 +10,207 @@ Handler functions live in the sibling modules:
|
|
|
10
10
|
|
|
11
11
|
from __future__ import annotations
|
|
12
12
|
|
|
13
|
-
import re
|
|
14
|
-
|
|
15
13
|
import execsql.state as _state # noqa: F401
|
|
16
14
|
|
|
17
15
|
# Handler imports — grouped by module for readability.
|
|
18
16
|
from execsql.metacommands.connect import (
|
|
19
|
-
x_connect_pg,
|
|
20
|
-
x_connect_user_pg,
|
|
21
|
-
x_connect_ssvr,
|
|
22
|
-
x_connect_user_ssvr,
|
|
23
|
-
x_connect_mysql,
|
|
24
|
-
x_connect_user_mysql,
|
|
25
|
-
x_connect_access,
|
|
26
|
-
x_connect_fb,
|
|
27
|
-
x_connect_user_fb,
|
|
28
|
-
x_connect_ora,
|
|
29
|
-
x_connect_user_ora,
|
|
30
|
-
x_connect_duckdb,
|
|
31
|
-
x_connect_sqlite,
|
|
32
|
-
x_connect_dsn,
|
|
33
|
-
x_use,
|
|
34
|
-
x_disconnect,
|
|
35
|
-
x_autocommit_on,
|
|
36
|
-
x_autocommit_off,
|
|
37
|
-
x_pg_vacuum,
|
|
38
|
-
x_daoflushdelay,
|
|
17
|
+
x_connect_pg, # noqa: F401
|
|
18
|
+
x_connect_user_pg, # noqa: F401
|
|
19
|
+
x_connect_ssvr, # noqa: F401
|
|
20
|
+
x_connect_user_ssvr, # noqa: F401
|
|
21
|
+
x_connect_mysql, # noqa: F401
|
|
22
|
+
x_connect_user_mysql, # noqa: F401
|
|
23
|
+
x_connect_access, # noqa: F401
|
|
24
|
+
x_connect_fb, # noqa: F401
|
|
25
|
+
x_connect_user_fb, # noqa: F401
|
|
26
|
+
x_connect_ora, # noqa: F401
|
|
27
|
+
x_connect_user_ora, # noqa: F401
|
|
28
|
+
x_connect_duckdb, # noqa: F401
|
|
29
|
+
x_connect_sqlite, # noqa: F401
|
|
30
|
+
x_connect_dsn, # noqa: F401
|
|
31
|
+
x_use, # noqa: F401
|
|
32
|
+
x_disconnect, # noqa: F401
|
|
33
|
+
x_autocommit_on, # noqa: F401
|
|
34
|
+
x_autocommit_off, # noqa: F401
|
|
35
|
+
x_pg_vacuum, # noqa: F401
|
|
36
|
+
x_daoflushdelay, # noqa: F401
|
|
39
37
|
)
|
|
40
38
|
from execsql.metacommands.control import (
|
|
41
|
-
x_if,
|
|
42
|
-
x_if_orif,
|
|
43
|
-
x_if_andif,
|
|
44
|
-
x_if_elseif,
|
|
45
|
-
x_if_else,
|
|
46
|
-
x_if_block,
|
|
47
|
-
x_if_end,
|
|
48
|
-
x_loop,
|
|
49
|
-
x_halt,
|
|
50
|
-
x_halt_msg,
|
|
51
|
-
x_error_halt,
|
|
52
|
-
x_metacommand_error_halt,
|
|
53
|
-
x_begin_batch,
|
|
54
|
-
x_end_batch,
|
|
55
|
-
x_rollback,
|
|
56
|
-
x_break,
|
|
57
|
-
x_wait_until,
|
|
39
|
+
x_if, # noqa: F401
|
|
40
|
+
x_if_orif, # noqa: F401
|
|
41
|
+
x_if_andif, # noqa: F401
|
|
42
|
+
x_if_elseif, # noqa: F401
|
|
43
|
+
x_if_else, # noqa: F401
|
|
44
|
+
x_if_block, # noqa: F401
|
|
45
|
+
x_if_end, # noqa: F401
|
|
46
|
+
x_loop, # noqa: F401
|
|
47
|
+
x_halt, # noqa: F401
|
|
48
|
+
x_halt_msg, # noqa: F401
|
|
49
|
+
x_error_halt, # noqa: F401
|
|
50
|
+
x_metacommand_error_halt, # noqa: F401
|
|
51
|
+
x_begin_batch, # noqa: F401
|
|
52
|
+
x_end_batch, # noqa: F401
|
|
53
|
+
x_rollback, # noqa: F401
|
|
54
|
+
x_break, # noqa: F401
|
|
55
|
+
x_wait_until, # noqa: F401
|
|
58
56
|
)
|
|
59
57
|
from execsql.metacommands.data import (
|
|
60
|
-
x_sub,
|
|
61
|
-
x_sub_add,
|
|
62
|
-
x_sub_append,
|
|
63
|
-
x_sub_empty,
|
|
64
|
-
x_rm_sub,
|
|
65
|
-
x_sub_local,
|
|
66
|
-
x_sub_tempfile,
|
|
67
|
-
x_sub_ini,
|
|
68
|
-
x_sub_querystring,
|
|
69
|
-
x_sub_encrypt,
|
|
70
|
-
x_sub_decrypt,
|
|
71
|
-
x_subdata,
|
|
72
|
-
x_selectsub,
|
|
73
|
-
x_prompt_selectsub,
|
|
74
|
-
x_empty_strings,
|
|
75
|
-
x_trim_strings,
|
|
76
|
-
x_replace_newlines,
|
|
77
|
-
x_empty_rows,
|
|
78
|
-
x_only_strings,
|
|
79
|
-
x_boolean_int,
|
|
80
|
-
x_boolean_words,
|
|
81
|
-
x_fold_col_hdrs,
|
|
82
|
-
x_trim_col_hdrs,
|
|
83
|
-
x_clean_col_hdrs,
|
|
84
|
-
x_del_empty_cols,
|
|
85
|
-
x_create_col_hdrs,
|
|
86
|
-
x_dedup_col_hdrs,
|
|
87
|
-
x_import_common_cols_only,
|
|
88
|
-
x_quote_all_text,
|
|
89
|
-
x_reset_counter,
|
|
90
|
-
x_reset_counters,
|
|
91
|
-
x_set_counter,
|
|
92
|
-
x_max_int,
|
|
58
|
+
x_sub, # noqa: F401
|
|
59
|
+
x_sub_add, # noqa: F401
|
|
60
|
+
x_sub_append, # noqa: F401
|
|
61
|
+
x_sub_empty, # noqa: F401
|
|
62
|
+
x_rm_sub, # noqa: F401
|
|
63
|
+
x_sub_local, # noqa: F401
|
|
64
|
+
x_sub_tempfile, # noqa: F401
|
|
65
|
+
x_sub_ini, # noqa: F401
|
|
66
|
+
x_sub_querystring, # noqa: F401
|
|
67
|
+
x_sub_encrypt, # noqa: F401
|
|
68
|
+
x_sub_decrypt, # noqa: F401
|
|
69
|
+
x_subdata, # noqa: F401
|
|
70
|
+
x_selectsub, # noqa: F401
|
|
71
|
+
x_prompt_selectsub, # noqa: F401
|
|
72
|
+
x_empty_strings, # noqa: F401
|
|
73
|
+
x_trim_strings, # noqa: F401
|
|
74
|
+
x_replace_newlines, # noqa: F401
|
|
75
|
+
x_empty_rows, # noqa: F401
|
|
76
|
+
x_only_strings, # noqa: F401
|
|
77
|
+
x_boolean_int, # noqa: F401
|
|
78
|
+
x_boolean_words, # noqa: F401
|
|
79
|
+
x_fold_col_hdrs, # noqa: F401
|
|
80
|
+
x_trim_col_hdrs, # noqa: F401
|
|
81
|
+
x_clean_col_hdrs, # noqa: F401
|
|
82
|
+
x_del_empty_cols, # noqa: F401
|
|
83
|
+
x_create_col_hdrs, # noqa: F401
|
|
84
|
+
x_dedup_col_hdrs, # noqa: F401
|
|
85
|
+
x_import_common_cols_only, # noqa: F401
|
|
86
|
+
x_quote_all_text, # noqa: F401
|
|
87
|
+
x_reset_counter, # noqa: F401
|
|
88
|
+
x_reset_counters, # noqa: F401
|
|
89
|
+
x_set_counter, # noqa: F401
|
|
90
|
+
x_max_int, # noqa: F401
|
|
93
91
|
)
|
|
94
92
|
from execsql.metacommands.debug import (
|
|
95
|
-
x_debug_write_metacommands,
|
|
96
|
-
x_debug_commandliststack,
|
|
97
|
-
x_debug_iflevels,
|
|
98
|
-
x_debug_write_odbc_drivers,
|
|
99
|
-
x_debug_log_subvars,
|
|
100
|
-
x_debug_log_config,
|
|
101
|
-
x_debug_write_subvars,
|
|
102
|
-
x_debug_write_config,
|
|
93
|
+
x_debug_write_metacommands, # noqa: F401
|
|
94
|
+
x_debug_commandliststack, # noqa: F401
|
|
95
|
+
x_debug_iflevels, # noqa: F401
|
|
96
|
+
x_debug_write_odbc_drivers, # noqa: F401
|
|
97
|
+
x_debug_log_subvars, # noqa: F401
|
|
98
|
+
x_debug_log_config, # noqa: F401
|
|
99
|
+
x_debug_write_subvars, # noqa: F401
|
|
100
|
+
x_debug_write_config, # noqa: F401
|
|
103
101
|
)
|
|
104
102
|
from execsql.metacommands.io import (
|
|
105
|
-
x_export,
|
|
106
|
-
x_export_query,
|
|
107
|
-
x_export_query_with_template,
|
|
108
|
-
x_export_with_template,
|
|
109
|
-
x_export_ods_multiple,
|
|
110
|
-
x_export_metadata,
|
|
111
|
-
x_export_metadata_table,
|
|
112
|
-
x_import,
|
|
113
|
-
x_import_file,
|
|
114
|
-
x_import_ods,
|
|
115
|
-
x_import_ods_pattern,
|
|
116
|
-
x_import_xls,
|
|
117
|
-
x_import_xls_pattern,
|
|
118
|
-
x_import_parquet,
|
|
119
|
-
x_import_feather,
|
|
120
|
-
x_import_row_buffer,
|
|
121
|
-
x_show_progress,
|
|
122
|
-
x_export_row_buffer,
|
|
123
|
-
x_write,
|
|
124
|
-
x_write_create_table,
|
|
125
|
-
x_write_create_table_ods,
|
|
126
|
-
x_write_create_table_xls,
|
|
127
|
-
x_write_create_table_alias,
|
|
128
|
-
x_write_prefix,
|
|
129
|
-
x_write_suffix,
|
|
130
|
-
x_writescript,
|
|
131
|
-
x_include,
|
|
132
|
-
x_copy,
|
|
133
|
-
x_copy_query,
|
|
134
|
-
x_zip,
|
|
135
|
-
x_zip_buffer_mb,
|
|
136
|
-
x_rm_file,
|
|
137
|
-
x_make_export_dirs,
|
|
138
|
-
x_cd,
|
|
139
|
-
x_scan_lines,
|
|
140
|
-
x_hdf5_text_len,
|
|
141
|
-
x_serve,
|
|
103
|
+
x_export, # noqa: F401
|
|
104
|
+
x_export_query, # noqa: F401
|
|
105
|
+
x_export_query_with_template, # noqa: F401
|
|
106
|
+
x_export_with_template, # noqa: F401
|
|
107
|
+
x_export_ods_multiple, # noqa: F401
|
|
108
|
+
x_export_metadata, # noqa: F401
|
|
109
|
+
x_export_metadata_table, # noqa: F401
|
|
110
|
+
x_import, # noqa: F401
|
|
111
|
+
x_import_file, # noqa: F401
|
|
112
|
+
x_import_ods, # noqa: F401
|
|
113
|
+
x_import_ods_pattern, # noqa: F401
|
|
114
|
+
x_import_xls, # noqa: F401
|
|
115
|
+
x_import_xls_pattern, # noqa: F401
|
|
116
|
+
x_import_parquet, # noqa: F401
|
|
117
|
+
x_import_feather, # noqa: F401
|
|
118
|
+
x_import_row_buffer, # noqa: F401
|
|
119
|
+
x_show_progress, # noqa: F401
|
|
120
|
+
x_export_row_buffer, # noqa: F401
|
|
121
|
+
x_write, # noqa: F401
|
|
122
|
+
x_write_create_table, # noqa: F401
|
|
123
|
+
x_write_create_table_ods, # noqa: F401
|
|
124
|
+
x_write_create_table_xls, # noqa: F401
|
|
125
|
+
x_write_create_table_alias, # noqa: F401
|
|
126
|
+
x_write_prefix, # noqa: F401
|
|
127
|
+
x_write_suffix, # noqa: F401
|
|
128
|
+
x_writescript, # noqa: F401
|
|
129
|
+
x_include, # noqa: F401
|
|
130
|
+
x_copy, # noqa: F401
|
|
131
|
+
x_copy_query, # noqa: F401
|
|
132
|
+
x_zip, # noqa: F401
|
|
133
|
+
x_zip_buffer_mb, # noqa: F401
|
|
134
|
+
x_rm_file, # noqa: F401
|
|
135
|
+
x_make_export_dirs, # noqa: F401
|
|
136
|
+
x_cd, # noqa: F401
|
|
137
|
+
x_scan_lines, # noqa: F401
|
|
138
|
+
x_hdf5_text_len, # noqa: F401
|
|
139
|
+
x_serve, # noqa: F401
|
|
142
140
|
)
|
|
143
141
|
from execsql.metacommands.prompt import (
|
|
144
|
-
x_prompt,
|
|
145
|
-
x_prompt_enter,
|
|
146
|
-
x_prompt_entryform,
|
|
147
|
-
x_prompt_pause,
|
|
148
|
-
x_prompt_compare,
|
|
149
|
-
x_prompt_ask_compare,
|
|
150
|
-
x_prompt_ask,
|
|
151
|
-
x_prompt_map,
|
|
152
|
-
x_prompt_action,
|
|
153
|
-
x_prompt_savefile,
|
|
154
|
-
x_prompt_openfile,
|
|
155
|
-
x_prompt_directory,
|
|
156
|
-
x_prompt_select_rows,
|
|
157
|
-
x_prompt_credentials,
|
|
158
|
-
x_prompt_connect,
|
|
159
|
-
x_ask,
|
|
160
|
-
x_pause,
|
|
161
|
-
x_msg,
|
|
162
|
-
x_reset_dialog_canceled,
|
|
142
|
+
x_prompt, # noqa: F401
|
|
143
|
+
x_prompt_enter, # noqa: F401
|
|
144
|
+
x_prompt_entryform, # noqa: F401
|
|
145
|
+
x_prompt_pause, # noqa: F401
|
|
146
|
+
x_prompt_compare, # noqa: F401
|
|
147
|
+
x_prompt_ask_compare, # noqa: F401
|
|
148
|
+
x_prompt_ask, # noqa: F401
|
|
149
|
+
x_prompt_map, # noqa: F401
|
|
150
|
+
x_prompt_action, # noqa: F401
|
|
151
|
+
x_prompt_savefile, # noqa: F401
|
|
152
|
+
x_prompt_openfile, # noqa: F401
|
|
153
|
+
x_prompt_directory, # noqa: F401
|
|
154
|
+
x_prompt_select_rows, # noqa: F401
|
|
155
|
+
x_prompt_credentials, # noqa: F401
|
|
156
|
+
x_prompt_connect, # noqa: F401
|
|
157
|
+
x_ask, # noqa: F401
|
|
158
|
+
x_pause, # noqa: F401
|
|
159
|
+
x_msg, # noqa: F401
|
|
160
|
+
x_reset_dialog_canceled, # noqa: F401
|
|
163
161
|
)
|
|
164
162
|
from execsql.metacommands.script_ext import (
|
|
165
|
-
x_extendscript,
|
|
166
|
-
x_extendscript_metacommand,
|
|
167
|
-
x_extendscript_sql,
|
|
168
|
-
x_executescript,
|
|
163
|
+
x_extendscript, # noqa: F401
|
|
164
|
+
x_extendscript_metacommand, # noqa: F401
|
|
165
|
+
x_extendscript_sql, # noqa: F401
|
|
166
|
+
x_executescript, # noqa: F401
|
|
169
167
|
)
|
|
170
168
|
from execsql.metacommands.system import (
|
|
171
|
-
x_system_cmd,
|
|
172
|
-
x_email,
|
|
173
|
-
x_timer,
|
|
174
|
-
x_log,
|
|
175
|
-
x_logwritemessages,
|
|
176
|
-
x_log_datavars,
|
|
177
|
-
x_log_sql,
|
|
178
|
-
x_console,
|
|
179
|
-
x_consoleprogress,
|
|
180
|
-
x_consolewait,
|
|
181
|
-
x_consolewait_onerror,
|
|
182
|
-
x_consolewait_whendone,
|
|
183
|
-
x_console_hideshow,
|
|
184
|
-
x_consolewidth,
|
|
185
|
-
x_consoleheight,
|
|
186
|
-
x_consolestatus,
|
|
187
|
-
x_consolesave,
|
|
188
|
-
x_cancel_halt,
|
|
189
|
-
x_cancel_halt_write_clear,
|
|
190
|
-
x_cancel_halt_write,
|
|
191
|
-
x_cancel_halt_email_clear,
|
|
192
|
-
x_cancel_halt_email,
|
|
169
|
+
x_system_cmd, # noqa: F401
|
|
170
|
+
x_email, # noqa: F401
|
|
171
|
+
x_timer, # noqa: F401
|
|
172
|
+
x_log, # noqa: F401
|
|
173
|
+
x_logwritemessages, # noqa: F401
|
|
174
|
+
x_log_datavars, # noqa: F401
|
|
175
|
+
x_log_sql, # noqa: F401
|
|
176
|
+
x_console, # noqa: F401
|
|
177
|
+
x_consoleprogress, # noqa: F401
|
|
178
|
+
x_consolewait, # noqa: F401
|
|
179
|
+
x_consolewait_onerror, # noqa: F401
|
|
180
|
+
x_consolewait_whendone, # noqa: F401
|
|
181
|
+
x_console_hideshow, # noqa: F401
|
|
182
|
+
x_consolewidth, # noqa: F401
|
|
183
|
+
x_consoleheight, # noqa: F401
|
|
184
|
+
x_consolestatus, # noqa: F401
|
|
185
|
+
x_consolesave, # noqa: F401
|
|
186
|
+
x_cancel_halt, # noqa: F401
|
|
187
|
+
x_cancel_halt_write_clear, # noqa: F401
|
|
188
|
+
x_cancel_halt_write, # noqa: F401
|
|
189
|
+
x_cancel_halt_email_clear, # noqa: F401
|
|
190
|
+
x_cancel_halt_email, # noqa: F401
|
|
193
191
|
x_cancel_halt_exec, # noqa: F401
|
|
194
|
-
x_cancel_halt_exec_clear,
|
|
195
|
-
x_error_halt_write_clear,
|
|
196
|
-
x_error_halt_write,
|
|
197
|
-
x_error_halt_email_clear,
|
|
198
|
-
x_error_halt_email,
|
|
192
|
+
x_cancel_halt_exec_clear, # noqa: F401
|
|
193
|
+
x_error_halt_write_clear, # noqa: F401
|
|
194
|
+
x_error_halt_write, # noqa: F401
|
|
195
|
+
x_error_halt_email_clear, # noqa: F401
|
|
196
|
+
x_error_halt_email, # noqa: F401
|
|
199
197
|
x_error_halt_exec, # noqa: F401
|
|
200
|
-
x_error_halt_exec_clear,
|
|
201
|
-
x_write_warnings,
|
|
202
|
-
x_gui_level,
|
|
203
|
-
x_execute,
|
|
198
|
+
x_error_halt_exec_clear, # noqa: F401
|
|
199
|
+
x_write_warnings, # noqa: F401
|
|
200
|
+
x_gui_level, # noqa: F401
|
|
201
|
+
x_execute, # noqa: F401
|
|
204
202
|
)
|
|
205
203
|
|
|
206
204
|
# Regex helper functions (from utils/regex.py)
|
|
207
205
|
from execsql.utils.regex import (
|
|
208
|
-
ins_rxs,
|
|
206
|
+
ins_rxs, # noqa: F401
|
|
209
207
|
ins_quoted_rx, # noqa: F401
|
|
210
|
-
ins_schema_rxs,
|
|
211
|
-
ins_table_rxs,
|
|
212
|
-
ins_table_list_rxs,
|
|
213
|
-
ins_fn_rxs,
|
|
208
|
+
ins_schema_rxs, # noqa: F401
|
|
209
|
+
ins_table_rxs, # noqa: F401
|
|
210
|
+
ins_table_list_rxs, # noqa: F401
|
|
211
|
+
ins_fn_rxs, # noqa: F401
|
|
214
212
|
)
|
|
215
|
-
from execsql.script import MetaCommandList
|
|
213
|
+
from execsql.script import MetaCommandList # noqa: F401
|
|
216
214
|
|
|
217
215
|
# ---------------------------------------------------------------------------
|
|
218
216
|
# Export format constants — single source of truth.
|
|
@@ -250,1798 +248,9 @@ DATABASE_TYPES = [
|
|
|
250
248
|
]
|
|
251
249
|
|
|
252
250
|
|
|
253
|
-
def build_dispatch_table() -> MetaCommandList:
|
|
254
|
-
"""Construct and return the complete metacommand dispatch table."""
|
|
255
|
-
mcl = MetaCommandList()
|
|
256
|
-
|
|
257
|
-
# ------------------------------------------------------------------
|
|
258
|
-
# DEBUG metacommands
|
|
259
|
-
# ------------------------------------------------------------------
|
|
260
|
-
mcl.add(
|
|
261
|
-
ins_fn_rxs(r"^\s*DEBUG\s+WRITE\s+METACOMMANDLIST\s+TO\s+", r"\s*$"),
|
|
262
|
-
x_debug_write_metacommands,
|
|
263
|
-
description="DEBUG",
|
|
264
|
-
category="action",
|
|
265
|
-
)
|
|
266
|
-
mcl.add(r"^\s*DEBUG\s+WRITE\s+COMMANDLISTSTACK\s*$", x_debug_commandliststack)
|
|
267
|
-
mcl.add(r"^\s*DEBUG\s+WRITE\s+IFLEVELS\s*$", x_debug_iflevels)
|
|
268
|
-
mcl.add(
|
|
269
|
-
ins_fn_rxs(
|
|
270
|
-
r"^\s*DEBUG\s+WRITE\s+ODBC_DRIVERS(?:\s+(?P<append>APPEND\s+)?TO\s+",
|
|
271
|
-
r")?\s*$",
|
|
272
|
-
),
|
|
273
|
-
x_debug_write_odbc_drivers,
|
|
274
|
-
)
|
|
275
|
-
mcl.add(
|
|
276
|
-
r"^\s*DEBUG\s+LOG(?:\s+(?P<local>LOCAL))?(?:\s+(?P<user>USER))?\s+SUBVARS\s*$",
|
|
277
|
-
x_debug_log_subvars,
|
|
278
|
-
)
|
|
279
|
-
mcl.add(r"^\s*DEBUG\s+LOG\s+CONFIG\s*$", x_debug_log_config)
|
|
280
|
-
mcl.add(
|
|
281
|
-
ins_fn_rxs(
|
|
282
|
-
r"^\s*DEBUG\s+WRITE(?:\s+(?P<local>LOCAL))?(?:\s+(?P<user>USER))?\s+SUBVARS"
|
|
283
|
-
r"(?:\s+(?P<append>APPEND\s+)?TO\s+",
|
|
284
|
-
r")?\s*$",
|
|
285
|
-
),
|
|
286
|
-
x_debug_write_subvars,
|
|
287
|
-
)
|
|
288
|
-
mcl.add(
|
|
289
|
-
ins_fn_rxs(
|
|
290
|
-
r"^\s*DEBUG\s+WRITE\s+CONFIG(?:\s+(?P<append>APPEND\s+)?TO\s+",
|
|
291
|
-
r")?\s*$",
|
|
292
|
-
),
|
|
293
|
-
x_debug_write_config,
|
|
294
|
-
)
|
|
295
|
-
|
|
296
|
-
# ------------------------------------------------------------------
|
|
297
|
-
# SERVE
|
|
298
|
-
# ------------------------------------------------------------------
|
|
299
|
-
mcl.add(
|
|
300
|
-
ins_fn_rxs(
|
|
301
|
-
r"^\s*SERVE\s+",
|
|
302
|
-
rf"\s+AS\s+(?P<format>{'|'.join(SERVE_FORMATS)})\s*$",
|
|
303
|
-
),
|
|
304
|
-
x_serve,
|
|
305
|
-
description="SERVE",
|
|
306
|
-
category="action",
|
|
307
|
-
)
|
|
308
|
-
|
|
309
|
-
# ------------------------------------------------------------------
|
|
310
|
-
# Misc short commands
|
|
311
|
-
# ------------------------------------------------------------------
|
|
312
|
-
mcl.add(
|
|
313
|
-
r"^\s*RESET\s+DIALOG_CANCELED\s*$",
|
|
314
|
-
x_reset_dialog_canceled,
|
|
315
|
-
description="RESET DIALOG_CANCELED",
|
|
316
|
-
category="action",
|
|
317
|
-
)
|
|
318
|
-
mcl.add(
|
|
319
|
-
r"^\s*SUB_QUERYSTRING\s+(?P<qstr>.+)\s*$",
|
|
320
|
-
x_sub_querystring,
|
|
321
|
-
description="SUB_QUERYSTRING",
|
|
322
|
-
category="action",
|
|
323
|
-
)
|
|
324
|
-
mcl.add(r"^\s*BREAK\s*$", x_break, description="BREAK", category="control")
|
|
325
|
-
|
|
326
|
-
# ------------------------------------------------------------------
|
|
327
|
-
# EXPORT QUERY (various formats)
|
|
328
|
-
# ------------------------------------------------------------------
|
|
329
|
-
mcl.add(
|
|
330
|
-
ins_fn_rxs(
|
|
331
|
-
r"^\s*EXPORT\s+QUERY\s+<<\s*(?P<query>.*;)\s*>>\s+(?P<tee>TEE\s+)?(?P<append>APPEND\s+)?TO\s+",
|
|
332
|
-
ins_fn_rxs(
|
|
333
|
-
r"(?:\s+IN\s+ZIPFILE\s+",
|
|
334
|
-
rf")?\s+AS\s*(?P<format>{'|'.join(QUERY_EXPORT_FORMATS)}|PARQUET|TXT-AND)"
|
|
335
|
-
r'(?:\s+DESCRIP(?:TION)?\s+"(?P<description>[^"]*)")?\s*$',
|
|
336
|
-
symbolicname="zipfilename",
|
|
337
|
-
),
|
|
338
|
-
),
|
|
339
|
-
x_export_query,
|
|
340
|
-
"EXPORT QUERY",
|
|
341
|
-
category="action",
|
|
342
|
-
)
|
|
343
|
-
mcl.add(
|
|
344
|
-
ins_fn_rxs(
|
|
345
|
-
r"^\s*EXPORT\s+QUERY\s+<<\s*(?P<query>.*;)\s*>>\s+(?P<tee>TEE\s+)?(?P<append>APPEND\s+)?TO\s+",
|
|
346
|
-
rf"\s+AS\s*(?P<format>{'|'.join(JSON_VARIANT_FORMATS)})(?:\s+(?P<notype>NOTYPE))?"
|
|
347
|
-
r'(?:\s+DESCRIP(?:TION)?\s+"(?P<description>[^"]*)")?\s*$',
|
|
348
|
-
),
|
|
349
|
-
x_export_query,
|
|
350
|
-
)
|
|
351
|
-
mcl.add(
|
|
352
|
-
ins_fn_rxs(
|
|
353
|
-
r"^\s*EXPORT\s+QUERY\s+<<\s*(?P<query>.*;)\s*>>\s+(?P<tee>TEE\s+)?(?P<append>APPEND\s+)?TO\s+",
|
|
354
|
-
ins_fn_rxs(
|
|
355
|
-
r"(?:\s+IN\s+ZIPFILE\s+",
|
|
356
|
-
ins_fn_rxs(r")?\s+WITH\s+TEMPLATE\s+", r"\s*$", "template"),
|
|
357
|
-
symbolicname="zipfilename",
|
|
358
|
-
),
|
|
359
|
-
),
|
|
360
|
-
x_export_query_with_template,
|
|
361
|
-
)
|
|
362
|
-
|
|
363
|
-
# ------------------------------------------------------------------
|
|
364
|
-
# EXPORT (table/view)
|
|
365
|
-
# ------------------------------------------------------------------
|
|
366
|
-
mcl.add(
|
|
367
|
-
ins_table_rxs(
|
|
368
|
-
r"^\s*EXPORT\s+",
|
|
369
|
-
ins_fn_rxs(
|
|
370
|
-
r"\s+(?P<tee>TEE\s+)?(?P<append>APPEND\s+)?TO\s+",
|
|
371
|
-
ins_fn_rxs(
|
|
372
|
-
r"(?:\s+IN\s+ZIPFILE\s+",
|
|
373
|
-
ins_fn_rxs(r")?\s+WITH\s+TEMPLATE\s+", r"\s*$", "template"),
|
|
374
|
-
symbolicname="zipfilename",
|
|
375
|
-
),
|
|
376
|
-
),
|
|
377
|
-
),
|
|
378
|
-
x_export_with_template,
|
|
379
|
-
description="EXPORT",
|
|
380
|
-
category="action",
|
|
381
|
-
)
|
|
382
|
-
mcl.add(
|
|
383
|
-
ins_table_rxs(
|
|
384
|
-
r"^\s*EXPORT\s+",
|
|
385
|
-
ins_fn_rxs(
|
|
386
|
-
ins_fn_rxs(
|
|
387
|
-
r"\s+(?P<tee>TEE\s+)?(?P<append>APPEND\s+)?TO\s+",
|
|
388
|
-
r"(?:\s+IN\s+ZIPFILE\s+",
|
|
389
|
-
),
|
|
390
|
-
rf")?\s+AS\s+(?P<format>{'|'.join(TABLE_EXPORT_FORMATS)}|PARQUET|TXT-AND)"
|
|
391
|
-
r'(?:\s+DESCRIP(?:TION)?\s+"(?P<description>[^"]*)")?\s*$',
|
|
392
|
-
symbolicname="zipfilename",
|
|
393
|
-
),
|
|
394
|
-
),
|
|
395
|
-
x_export,
|
|
396
|
-
"EXPORT",
|
|
397
|
-
category="action",
|
|
398
|
-
)
|
|
399
|
-
mcl.add(
|
|
400
|
-
ins_table_rxs(
|
|
401
|
-
r"^\s*EXPORT\s+",
|
|
402
|
-
ins_fn_rxs(
|
|
403
|
-
ins_fn_rxs(
|
|
404
|
-
r"\s+(?P<tee>TEE\s+)?(?P<append>APPEND\s+)?TO\s+",
|
|
405
|
-
r"(?:\s+IN\s+ZIPFILE\s+",
|
|
406
|
-
),
|
|
407
|
-
rf")?\s+AS\s+(?P<format>{'|'.join(JSON_VARIANT_FORMATS)})(?:\s+(?P<notype>NOTYPE))?"
|
|
408
|
-
r'(?:\s+DESCRIP(?:TION)?\s+"(?P<description>[^"]*)")?\s*$',
|
|
409
|
-
symbolicname="zipfilename",
|
|
410
|
-
),
|
|
411
|
-
),
|
|
412
|
-
x_export,
|
|
413
|
-
)
|
|
414
|
-
mcl.add(
|
|
415
|
-
ins_table_list_rxs(
|
|
416
|
-
r"^\s*EXPORT\s+",
|
|
417
|
-
ins_fn_rxs(
|
|
418
|
-
r"\s+(?P<tee>TEE\s+)?(?P<append>APPEND\s+)?TO\s+",
|
|
419
|
-
r'\s+AS\s+ODS(?:\s+DESCRIP(?:TION)?\s+"(?P<description>[^"]*)")?\s*$',
|
|
420
|
-
),
|
|
421
|
-
),
|
|
422
|
-
x_export_ods_multiple,
|
|
423
|
-
)
|
|
424
|
-
|
|
425
|
-
# ------------------------------------------------------------------
|
|
426
|
-
# IMPORT_FILE
|
|
427
|
-
# ------------------------------------------------------------------
|
|
428
|
-
mcl.add(
|
|
429
|
-
ins_table_rxs(
|
|
430
|
-
r"^\s*IMPORT_FILE\s+TO\s+TABLE\s+",
|
|
431
|
-
ins_fn_rxs(
|
|
432
|
-
r'\s+COLUMN\s+"(?P<columnname>[A-Za-z0-9_\-\: ]+)"\s+FROM\s+',
|
|
433
|
-
r"\s*$",
|
|
434
|
-
),
|
|
435
|
-
),
|
|
436
|
-
x_import_file,
|
|
437
|
-
description="IMPORT_FILE",
|
|
438
|
-
category="action",
|
|
439
|
-
)
|
|
440
|
-
mcl.add(
|
|
441
|
-
ins_table_rxs(
|
|
442
|
-
r"^\s*IMPORT_FILE\s+TO\s+TABLE\s+",
|
|
443
|
-
ins_fn_rxs(
|
|
444
|
-
r"\s+COLUMN\s+(?P<columnname>[A-Za-z0-9_\-\:]+)\s+FROM\s+",
|
|
445
|
-
r"\s*$",
|
|
446
|
-
),
|
|
447
|
-
),
|
|
448
|
-
x_import_file,
|
|
449
|
-
)
|
|
450
|
-
|
|
451
|
-
# ------------------------------------------------------------------
|
|
452
|
-
# IMPORT ODS (pattern)
|
|
453
|
-
# ------------------------------------------------------------------
|
|
454
|
-
mcl.add(
|
|
455
|
-
ins_schema_rxs(
|
|
456
|
-
r"\s*IMPORT\s+TO\s+(?:(?P<new>NEW|REPLACEMENT)\s+)?TABLES\s+IN\s+(?:SCHEMA\s+)?",
|
|
457
|
-
ins_fn_rxs(
|
|
458
|
-
r"\s+FROM\s+",
|
|
459
|
-
r"\s+SHEETS\s+MATCHING\s+(?P<patn>\S+)(?:\s+SKIP\s+(?P<skip>\d+))?\s*?",
|
|
460
|
-
),
|
|
461
|
-
),
|
|
462
|
-
x_import_ods_pattern,
|
|
463
|
-
description="IMPORT",
|
|
464
|
-
category="action",
|
|
465
|
-
)
|
|
466
|
-
|
|
467
|
-
# ------------------------------------------------------------------
|
|
468
|
-
# CD
|
|
469
|
-
# ------------------------------------------------------------------
|
|
470
|
-
mcl.add(r"^\s*CD\s+(?P<dir>.+)\s*$", x_cd, description="CD", category="action")
|
|
471
|
-
|
|
472
|
-
# ------------------------------------------------------------------
|
|
473
|
-
# IMPORT ODS (single sheet)
|
|
474
|
-
# ------------------------------------------------------------------
|
|
475
|
-
mcl.add(
|
|
476
|
-
ins_table_rxs(
|
|
477
|
-
r"^\s*IMPORT\s+TO\s+(?:(?P<new>NEW|REPLACEMENT)\s+)?",
|
|
478
|
-
ins_fn_rxs(
|
|
479
|
-
r"\s+FROM\s+",
|
|
480
|
-
r'\s+SHEET\s+"(?P<sheetname>[A-Za-z0-9_\.\/\-\\ ]+)"'
|
|
481
|
-
r"(?:\s+SKIP\s+(?P<skip>\d+))?\s*$",
|
|
482
|
-
),
|
|
483
|
-
)
|
|
484
|
-
+ ins_table_rxs(
|
|
485
|
-
r"^\s*IMPORT\s+TO\s+(?:(?P<new>NEW|REPLACEMENT)\s+)?",
|
|
486
|
-
ins_fn_rxs(
|
|
487
|
-
r"\s+FROM\s+",
|
|
488
|
-
r"\s+SHEET\s+(?P<sheetname>[A-Za-z0-9_\.\/\-\\]+)"
|
|
489
|
-
r"(?:\s+SKIP\s+(?P<skip>\d+))?\s*$",
|
|
490
|
-
),
|
|
491
|
-
),
|
|
492
|
-
x_import_ods,
|
|
493
|
-
)
|
|
494
|
-
|
|
495
|
-
# ------------------------------------------------------------------
|
|
496
|
-
# IMPORT XLS (pattern)
|
|
497
|
-
# ------------------------------------------------------------------
|
|
498
|
-
mcl.add(
|
|
499
|
-
ins_schema_rxs(
|
|
500
|
-
r"\s*IMPORT\s+TO\s+(?:(?P<new>NEW|REPLACEMENT)\s+)?TABLES\s+IN\s+(?:SCHEMA\s+)?",
|
|
501
|
-
ins_fn_rxs(
|
|
502
|
-
r"\s+FROM\s+EXCEL\s+",
|
|
503
|
-
r"\s+SHEETS\s+MATCHING\s+(?P<patn>\S+)(?:\s+SKIP\s+(?P<skip>\d+))?"
|
|
504
|
-
r"(?:\s+ENCODING\s+(?P<encoding>\w+))?\s*?",
|
|
505
|
-
),
|
|
506
|
-
),
|
|
507
|
-
x_import_xls_pattern,
|
|
508
|
-
)
|
|
509
|
-
|
|
510
|
-
# ------------------------------------------------------------------
|
|
511
|
-
# IMPORT XLS (single sheet)
|
|
512
|
-
# ------------------------------------------------------------------
|
|
513
|
-
mcl.add(
|
|
514
|
-
ins_table_rxs(
|
|
515
|
-
r"^\s*IMPORT\s+TO\s+(?:(?P<new>NEW|REPLACEMENT)\s+)?",
|
|
516
|
-
ins_fn_rxs(
|
|
517
|
-
r"\s+FROM\s+EXCEL\s+",
|
|
518
|
-
r'\s+SHEET\s+"(?P<sheetname>[A-Za-z0-9_\.\/\-\\ ]+)"'
|
|
519
|
-
r"(?:\s+SKIP\s+(?P<skip>\d+))?(?:\s+ENCODING\s+(?P<encoding>\w+))?\s*$",
|
|
520
|
-
),
|
|
521
|
-
)
|
|
522
|
-
+ ins_table_rxs(
|
|
523
|
-
r"^\s*IMPORT\s+TO\s+(?:(?P<new>NEW|REPLACEMENT)\s+)?",
|
|
524
|
-
ins_fn_rxs(
|
|
525
|
-
r"\s+FROM\s+EXCEL\s+",
|
|
526
|
-
r"\s+SHEET\s+(?P<sheetname>[A-Za-z0-9_\.\/\-\\]+)"
|
|
527
|
-
r"(?:\s+SKIP\s+(?P<skip>\d+))?(?:\s+ENCODING\s+(?P<encoding>\w+))?\s*$",
|
|
528
|
-
),
|
|
529
|
-
),
|
|
530
|
-
x_import_xls,
|
|
531
|
-
)
|
|
532
|
-
|
|
533
|
-
# ------------------------------------------------------------------
|
|
534
|
-
# IMPORT PARQUET / FEATHER
|
|
535
|
-
# ------------------------------------------------------------------
|
|
536
|
-
mcl.add(
|
|
537
|
-
ins_table_rxs(
|
|
538
|
-
r"^\s*IMPORT\s+TO\s+(?:(?P<new>NEW|REPLACEMENT)\s+)?",
|
|
539
|
-
ins_fn_rxs(r"\s+FROM\s+PARQUET\s+", r"\s*$"),
|
|
540
|
-
),
|
|
541
|
-
x_import_parquet,
|
|
542
|
-
)
|
|
543
|
-
mcl.add(
|
|
544
|
-
ins_table_rxs(
|
|
545
|
-
r"^\s*IMPORT\s+TO\s+(?:(?P<new>NEW|REPLACEMENT)\s+)?",
|
|
546
|
-
ins_fn_rxs(r"\s+FROM\s+FEATHER\s+", r"\s*$"),
|
|
547
|
-
),
|
|
548
|
-
x_import_feather,
|
|
549
|
-
)
|
|
550
|
-
|
|
551
|
-
# ------------------------------------------------------------------
|
|
552
|
-
# PROMPT ACTION
|
|
553
|
-
# ------------------------------------------------------------------
|
|
554
|
-
mcl.add(
|
|
555
|
-
ins_table_rxs(
|
|
556
|
-
r"^\s*PROMPT\s+ACTION\s+",
|
|
557
|
-
ins_table_rxs(
|
|
558
|
-
r'\s+MESSAGE\s+"(?P<message>(.|\n)*)"(?:\s+DISPLAY\s+',
|
|
559
|
-
r")?(?:\s+COMPACT\s+(?P<compact>\d+))?(?:\s+(?P<continue>CONTINUE))?"
|
|
560
|
-
r"(?:\s+HELP\s+(?P<help>[^\s]+))?\s*$",
|
|
561
|
-
suffix="disp",
|
|
562
|
-
),
|
|
563
|
-
),
|
|
564
|
-
x_prompt_action,
|
|
565
|
-
description="PROMPT ACTION",
|
|
566
|
-
category="prompt",
|
|
567
|
-
)
|
|
568
|
-
mcl.add(
|
|
569
|
-
ins_table_rxs(
|
|
570
|
-
r"^\s*PROMPT\s+ACTION\s+",
|
|
571
|
-
ins_table_rxs(
|
|
572
|
-
r'\s+MESSAGE\s+"(?P<message>(.|\n)*)"(?:\s+DISPLAY\s+',
|
|
573
|
-
r")?(?:\s+COMPACT\s+(?P<compact>\d+))?(?:\s+(?P<continue>CONTINUE))?"
|
|
574
|
-
r'(?:\s+HELP\s+"(?P<help>[^"]+)")?\s*$',
|
|
575
|
-
suffix="disp",
|
|
576
|
-
),
|
|
577
|
-
),
|
|
578
|
-
x_prompt_action,
|
|
579
|
-
)
|
|
580
|
-
|
|
581
|
-
# ------------------------------------------------------------------
|
|
582
|
-
# PROMPT SAVEFILE / OPENFILE / DIRECTORY
|
|
583
|
-
# ------------------------------------------------------------------
|
|
584
|
-
mcl.add(
|
|
585
|
-
ins_fn_rxs(
|
|
586
|
-
r"^\s*PROMPT\s+SAVEFILE\s+SUB\s+(?P<match>~?\w+)(?:\s+(?P<fn_match>~?\w+))?"
|
|
587
|
-
r"(?:\s+(?P<path_match>~?\w+))?(?:\s+(?P<ext_match>~?\w+))?"
|
|
588
|
-
r"(?:\s+(?P<fnbase_match>~?\w+))?(?:\s+FROM\s+",
|
|
589
|
-
r")?\s*$",
|
|
590
|
-
symbolicname="startdir",
|
|
591
|
-
),
|
|
592
|
-
x_prompt_savefile,
|
|
593
|
-
description="PROMPT SAVEFILE",
|
|
594
|
-
category="prompt",
|
|
595
|
-
)
|
|
596
|
-
mcl.add(
|
|
597
|
-
ins_fn_rxs(
|
|
598
|
-
r"^\s*PROMPT\s+OPENFILE\s+SUB\s+(?P<match>~?\w+)(?:\s+(?P<fn_match>~?\w+))?"
|
|
599
|
-
r"(?:\s+(?P<path_match>~?\w+))?(?:\s+(?P<ext_match>~?\w+))?"
|
|
600
|
-
r"(?:\s+(?P<fnbase_match>~?\w+))?(?:\s+FROM\s+",
|
|
601
|
-
r")?\s*$",
|
|
602
|
-
symbolicname="startdir",
|
|
603
|
-
),
|
|
604
|
-
x_prompt_openfile,
|
|
605
|
-
description="PROMPT OPENFILE",
|
|
606
|
-
category="prompt",
|
|
607
|
-
)
|
|
608
|
-
mcl.add(
|
|
609
|
-
ins_fn_rxs(
|
|
610
|
-
r"^\s*PROMPT\s+DIRECTORY\s+SUB\s+(?P<match>~?\w+)(?:\s+(?P<fullpath>FULLPATH))?"
|
|
611
|
-
r"(?:\s+FROM\s+",
|
|
612
|
-
r")?\s*$",
|
|
613
|
-
symbolicname="startdir",
|
|
614
|
-
),
|
|
615
|
-
x_prompt_directory,
|
|
616
|
-
description="PROMPT DIRECTORY",
|
|
617
|
-
category="prompt",
|
|
618
|
-
)
|
|
619
|
-
|
|
620
|
-
# ------------------------------------------------------------------
|
|
621
|
-
# PROMPT SELECT_ROWS
|
|
622
|
-
# ------------------------------------------------------------------
|
|
623
|
-
mcl.add(
|
|
624
|
-
ins_table_rxs(
|
|
625
|
-
r"^\s*PROMPT\s+SELECT_ROWS\s+FROM\s+",
|
|
626
|
-
ins_table_rxs(
|
|
627
|
-
r"(?:\s+IN\s+(?P<alias1>\w+))?\s+INTO\s+",
|
|
628
|
-
r'(?:\s+IN\s+(?P<alias2>\w+))?(?:\s+HELP\s+(?P<help>[^\s]+))?\s+MESSAGE\s+"(?P<msg>(.|\n)*)"\s*$',
|
|
629
|
-
suffix="2",
|
|
630
|
-
),
|
|
631
|
-
suffix="1",
|
|
632
|
-
),
|
|
633
|
-
x_prompt_select_rows,
|
|
634
|
-
description="PROMPT SELECT_ROWS",
|
|
635
|
-
category="prompt",
|
|
636
|
-
)
|
|
637
|
-
mcl.add(
|
|
638
|
-
ins_table_rxs(
|
|
639
|
-
r"^\s*PROMPT\s+SELECT_ROWS\s+FROM\s+",
|
|
640
|
-
ins_table_rxs(
|
|
641
|
-
r"(?:\s+IN\s+(?P<alias1>\w+))?\s+INTO\s+",
|
|
642
|
-
r'(?:\s+IN\s+(?P<alias2>\w+))?(?:\s+HELP\s+"(?P<help>[^"]+)")?\s+MESSAGE\s+"(?P<msg>(.|\n)*)"\s*$',
|
|
643
|
-
suffix="2",
|
|
644
|
-
),
|
|
645
|
-
suffix="1",
|
|
646
|
-
),
|
|
647
|
-
x_prompt_select_rows,
|
|
648
|
-
)
|
|
649
|
-
|
|
650
|
-
# ------------------------------------------------------------------
|
|
651
|
-
# SUB_LOCAL / SUB_ENCRYPT / SUB_DECRYPT
|
|
652
|
-
# ------------------------------------------------------------------
|
|
653
|
-
mcl.add(
|
|
654
|
-
r"^\s*SUB_LOCAL\s+(?P<match>~?\w+)\s+(?P<repl>.+)$",
|
|
655
|
-
x_sub_local,
|
|
656
|
-
description="SUB_LOCAL",
|
|
657
|
-
category="action",
|
|
658
|
-
)
|
|
659
|
-
mcl.add(
|
|
660
|
-
r"^\s*SUB_ENCRYPT\s+(?P<match>[+~]?\w+)\s+(?P<plaintext>.+)\s*$",
|
|
661
|
-
x_sub_encrypt,
|
|
662
|
-
description="SUB_ENCRYPT",
|
|
663
|
-
category="action",
|
|
664
|
-
)
|
|
665
|
-
mcl.add(
|
|
666
|
-
r"^\s*SUB_DECRYPT\s+(?P<match>[+~]?\w+)\s+(?P<crypttext>.+)\s*$",
|
|
667
|
-
x_sub_decrypt,
|
|
668
|
-
description="SUB_DECRYPT",
|
|
669
|
-
category="action",
|
|
670
|
-
)
|
|
671
|
-
|
|
672
|
-
# ------------------------------------------------------------------
|
|
673
|
-
# WAIT_UNTIL
|
|
674
|
-
# ------------------------------------------------------------------
|
|
675
|
-
mcl.add(
|
|
676
|
-
r"^\s*WAIT_UNTIL\s+(?P<condition>.+)\s+(?P<end>HALT|CONTINUE)\s+AFTER\s+(?P<seconds>\d+)\s+SECONDS\s*$",
|
|
677
|
-
x_wait_until,
|
|
678
|
-
description="WAIT_UNTIL",
|
|
679
|
-
category="control",
|
|
680
|
-
)
|
|
681
|
-
|
|
682
|
-
# ------------------------------------------------------------------
|
|
683
|
-
# CONFIG * (various settings)
|
|
684
|
-
# ------------------------------------------------------------------
|
|
685
|
-
mcl.add(
|
|
686
|
-
r"^\s*LOG_WRITE_MESSAGES\s+(?P<setting>Yes|No|On|Off|True|False|0|1)\s*$",
|
|
687
|
-
x_logwritemessages,
|
|
688
|
-
description="LOG_WRITE_MESSAGES",
|
|
689
|
-
category="config_option",
|
|
690
|
-
)
|
|
691
|
-
mcl.add(
|
|
692
|
-
r"^\s*CONFIG\s+LOG_WRITE_MESSAGES\s+(?P<setting>Yes|No|On|Off|True|False|0|1)\s*$",
|
|
693
|
-
x_logwritemessages,
|
|
694
|
-
description="CONFIG",
|
|
695
|
-
category="config",
|
|
696
|
-
)
|
|
697
|
-
mcl.add(
|
|
698
|
-
r"^\s*CONFIG\s+QUOTE_ALL_TEXT\s+(?P<setting>Yes|No|On|Off|True|False|0|1)\s*$",
|
|
699
|
-
x_quote_all_text,
|
|
700
|
-
description="QUOTE_ALL_TEXT",
|
|
701
|
-
category="config_option",
|
|
702
|
-
)
|
|
703
|
-
mcl.add(
|
|
704
|
-
r"^\s*CONFIG\s+IMPORT_ROW_BUFFER\s+(?P<rows>[1-9][0-9]*)\s*$",
|
|
705
|
-
x_import_row_buffer,
|
|
706
|
-
description="IMPORT_ROW_BUFFER",
|
|
707
|
-
category="config_option",
|
|
708
|
-
)
|
|
709
|
-
mcl.add(
|
|
710
|
-
r"^\s*CONFIG\s+SHOW_PROGRESS\s+(?P<setting>Yes|No|On|Off|True|False|0|1)\s*$",
|
|
711
|
-
x_show_progress,
|
|
712
|
-
description="SHOW_PROGRESS",
|
|
713
|
-
category="config_option",
|
|
714
|
-
)
|
|
715
|
-
mcl.add(
|
|
716
|
-
r"^\s*CONFIG\s+EXPORT_ROW_BUFFER\s+(?P<rows>[1-9][0-9]*)\s*$",
|
|
717
|
-
x_export_row_buffer,
|
|
718
|
-
description="EXPORT_ROW_BUFFER",
|
|
719
|
-
category="config_option",
|
|
720
|
-
)
|
|
721
|
-
mcl.add(
|
|
722
|
-
r"^\s*CONFIG\s+ZIP_BUFFER_MB\s+(?P<size>[1-9][0-9]*)\s*$",
|
|
723
|
-
x_zip_buffer_mb,
|
|
724
|
-
description="ZIP_BUFFER_MB",
|
|
725
|
-
category="config_option",
|
|
726
|
-
)
|
|
727
|
-
mcl.add(
|
|
728
|
-
r"^\s*EMPTY_STRINGS\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
729
|
-
x_empty_strings,
|
|
730
|
-
description="EMPTY_STRINGS",
|
|
731
|
-
category="config_option",
|
|
732
|
-
)
|
|
733
|
-
mcl.add(
|
|
734
|
-
r"^\s*CONFIG\s+EMPTY_STRINGS\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
735
|
-
x_empty_strings,
|
|
736
|
-
)
|
|
737
|
-
mcl.add(
|
|
738
|
-
r"^\s*TRIM_STRINGS\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
739
|
-
x_trim_strings,
|
|
740
|
-
description="TRIM_STRINGS",
|
|
741
|
-
category="config_option",
|
|
742
|
-
)
|
|
743
|
-
mcl.add(
|
|
744
|
-
r"^\s*CONFIG\s+TRIM_STRINGS\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
745
|
-
x_trim_strings,
|
|
746
|
-
)
|
|
747
|
-
mcl.add(
|
|
748
|
-
r"^\s*CONFIG\s+REPLACE_NEWLINES\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
749
|
-
x_replace_newlines,
|
|
750
|
-
description="REPLACE_NEWLINES",
|
|
751
|
-
category="config_option",
|
|
752
|
-
)
|
|
753
|
-
mcl.add(
|
|
754
|
-
r"^\s*CONFIG\s+EMPTY_ROWS\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
755
|
-
x_empty_rows,
|
|
756
|
-
description="EMPTY_ROWS",
|
|
757
|
-
category="config_option",
|
|
758
|
-
)
|
|
759
|
-
mcl.add(
|
|
760
|
-
r"^\s*CONFIG\s+ONLY_STRINGS\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
761
|
-
x_only_strings,
|
|
762
|
-
description="ONLY_STRINGS",
|
|
763
|
-
category="config_option",
|
|
764
|
-
)
|
|
765
|
-
mcl.add(
|
|
766
|
-
r"^\s*(?:CONFIG\s+)?BOOLEAN_INT\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
767
|
-
x_boolean_int,
|
|
768
|
-
description="BOOLEAN_INT",
|
|
769
|
-
category="config_option",
|
|
770
|
-
)
|
|
771
|
-
mcl.add(
|
|
772
|
-
r"^\s*BOOLEAN_WORDS\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
773
|
-
x_boolean_words,
|
|
774
|
-
description="BOOLEAN_WORDS",
|
|
775
|
-
category="config_option",
|
|
776
|
-
)
|
|
777
|
-
mcl.add(
|
|
778
|
-
r"^\s*CONFIG\s+BOOLEAN_WORDS\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
779
|
-
x_boolean_words,
|
|
780
|
-
)
|
|
781
|
-
mcl.add(
|
|
782
|
-
r"^\s*CONFIG\s+FOLD_COLUMN_HEADERS\s+(?P<foldspec>no|lower|upper)\s*$",
|
|
783
|
-
x_fold_col_hdrs,
|
|
784
|
-
description="FOLD_COLUMN_HEADERS",
|
|
785
|
-
category="config_option",
|
|
786
|
-
)
|
|
787
|
-
mcl.add(
|
|
788
|
-
r"^\s*CONFIG\s+TRIM_COLUMN_HEADERS\s+(?P<which>NONE|BOTH|LEFT|RIGHT)\s*$",
|
|
789
|
-
x_trim_col_hdrs,
|
|
790
|
-
description="TRIM_COLUMN_HEADERS",
|
|
791
|
-
category="config_option",
|
|
792
|
-
)
|
|
793
|
-
mcl.add(
|
|
794
|
-
r"^\s*CLEAN_COLUMN_HEADERS\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
795
|
-
x_clean_col_hdrs,
|
|
796
|
-
description="CLEAN_COLUMN_HEADERS",
|
|
797
|
-
category="config_option",
|
|
798
|
-
)
|
|
799
|
-
mcl.add(
|
|
800
|
-
r"^\s*CONFIG\s+CLEAN_COLUMN_HEADERS\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
801
|
-
x_clean_col_hdrs,
|
|
802
|
-
)
|
|
803
|
-
mcl.add(
|
|
804
|
-
r"^\s*CONFIG\s+DELETE_EMPTY_COLUMNS\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
805
|
-
x_del_empty_cols,
|
|
806
|
-
description="DELETE_EMPTY_COLUMNS",
|
|
807
|
-
category="config_option",
|
|
808
|
-
)
|
|
809
|
-
mcl.add(
|
|
810
|
-
r"^\s*CONFIG\s+CREATE_COLUMN_HEADERS\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
811
|
-
x_create_col_hdrs,
|
|
812
|
-
description="CREATE_COLUMN_HEADERS",
|
|
813
|
-
category="config_option",
|
|
814
|
-
)
|
|
815
|
-
mcl.add(
|
|
816
|
-
r"^\s*CONFIG\s+DEDUP_COLUMN_HEADERS\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
817
|
-
x_dedup_col_hdrs,
|
|
818
|
-
description="DEDUP_COLUMN_HEADERS",
|
|
819
|
-
category="config_option",
|
|
820
|
-
)
|
|
821
|
-
mcl.add(
|
|
822
|
-
r"^\s*IMPORT_ONLY_COMMON_COLUMNS\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
823
|
-
x_import_common_cols_only,
|
|
824
|
-
description="IMPORT_ONLY_COMMON_COLUMNS",
|
|
825
|
-
category="config_option",
|
|
826
|
-
)
|
|
827
|
-
mcl.add(
|
|
828
|
-
r"^\s*IMPORT_COMMON_COLUMNS_ONLY\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
829
|
-
x_import_common_cols_only,
|
|
830
|
-
)
|
|
831
|
-
mcl.add(
|
|
832
|
-
r"^\s*CONFIG\s+IMPORT_ONLY_COMMON_COLUMNS\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
833
|
-
x_import_common_cols_only,
|
|
834
|
-
)
|
|
835
|
-
mcl.add(
|
|
836
|
-
r"^\s*MAKE_EXPORT_DIRS\s+(?P<setting>Yes|No|On|Off|True|False|0|1)\s*$",
|
|
837
|
-
x_make_export_dirs,
|
|
838
|
-
description="MAKE_EXPORT_DIRS",
|
|
839
|
-
category="config_option",
|
|
840
|
-
)
|
|
841
|
-
mcl.add(
|
|
842
|
-
r"^\s*CONFIG\s+MAKE_EXPORT_DIRS\s+(?P<setting>Yes|No|On|Off|True|False|0|1)\s*$",
|
|
843
|
-
x_make_export_dirs,
|
|
844
|
-
)
|
|
845
|
-
mcl.add(
|
|
846
|
-
r"^\s*WRITE_WARNINGS\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
847
|
-
x_write_warnings,
|
|
848
|
-
description="WRITE_WARNINGS",
|
|
849
|
-
category="config_option",
|
|
850
|
-
)
|
|
851
|
-
mcl.add(
|
|
852
|
-
r"^\s*CONFIG\s+WRITE_WARNINGS\s+(?P<yesno>YES|NO|ON|OFF|TRUE|FALSE|0|1)\s*$",
|
|
853
|
-
x_write_warnings,
|
|
854
|
-
)
|
|
855
|
-
mcl.add(
|
|
856
|
-
r"^\s*CONFIG\s+GUI_LEVEL\s+(?P<level>[0-2])\s*$",
|
|
857
|
-
x_gui_level,
|
|
858
|
-
description="GUI_LEVEL",
|
|
859
|
-
category="config_option",
|
|
860
|
-
)
|
|
861
|
-
mcl.add(
|
|
862
|
-
r"^\s*CONFIG\s+WRITE_PREFIX\s+(?P<prefix>.*)\s*$",
|
|
863
|
-
x_write_prefix,
|
|
864
|
-
description="WRITE_PREFIX",
|
|
865
|
-
category="config_option",
|
|
866
|
-
)
|
|
867
|
-
mcl.add(
|
|
868
|
-
r"^\s*CONFIG\s+WRITE_SUFFIX\s+(?P<suffix>.*)\s*$",
|
|
869
|
-
x_write_suffix,
|
|
870
|
-
description="WRITE_SUFFIX",
|
|
871
|
-
category="config_option",
|
|
872
|
-
)
|
|
873
|
-
mcl.add(
|
|
874
|
-
r"^\s*CONFIG\s+SCAN_LINES\s+(?P<scanlines>[0-9]+)\s*$",
|
|
875
|
-
x_scan_lines,
|
|
876
|
-
description="SCAN_LINES",
|
|
877
|
-
category="config_option",
|
|
878
|
-
)
|
|
879
|
-
mcl.add(
|
|
880
|
-
r"^\s*CONFIG\s+HDF5_TEXT_LEN\s+(?P<textlen>[0-9]+)\s*$",
|
|
881
|
-
x_hdf5_text_len,
|
|
882
|
-
description="HDF5_TEXT_LEN",
|
|
883
|
-
category="config_option",
|
|
884
|
-
)
|
|
885
|
-
mcl.add(
|
|
886
|
-
r"^\s*CONFIG\s+LOG_DATAVARS\s+(?P<setting>Yes|No|On|Off|True|False|0|1)\s*$",
|
|
887
|
-
x_log_datavars,
|
|
888
|
-
description="LOG_DATAVARS",
|
|
889
|
-
category="config_option",
|
|
890
|
-
)
|
|
891
|
-
mcl.add(
|
|
892
|
-
r"^\s*CONFIG\s+LOG_SQL\s+(?P<setting>Yes|No|On|Off|True|False|0|1)\s*$",
|
|
893
|
-
x_log_sql,
|
|
894
|
-
description="LOG_SQL",
|
|
895
|
-
category="config_option",
|
|
896
|
-
)
|
|
897
|
-
mcl.add(
|
|
898
|
-
r"^\s*CONFIG\s+DAO_FLUSH_DELAY_SECS\s+(?P<secs>[0-9]*\.?[0-9]+)\s*$",
|
|
899
|
-
x_daoflushdelay,
|
|
900
|
-
description="DAO_FLUSH_DELAY_SECS",
|
|
901
|
-
category="config_option",
|
|
902
|
-
)
|
|
903
|
-
mcl.add(
|
|
904
|
-
r"^\s*CONSOLE\s+WAIT_WHEN_ERROR\s+(?P<onoff>ON|OFF|YES|NO|TRUE|FALSE|0|1)\s*$",
|
|
905
|
-
x_consolewait_onerror,
|
|
906
|
-
description="CONSOLE_WAIT_WHEN_ERROR",
|
|
907
|
-
category="config_option",
|
|
908
|
-
)
|
|
909
|
-
mcl.add(
|
|
910
|
-
r"^\s*CONFIG\s+CONSOLE\s+WAIT_WHEN_ERROR\s+(?P<onoff>ON|OFF|YES|NO|TRUE|FALSE|0|1)\s*$",
|
|
911
|
-
x_consolewait_onerror,
|
|
912
|
-
)
|
|
913
|
-
mcl.add(
|
|
914
|
-
r"^\s*CONSOLE\s+WAIT_WHEN_DONE\s+(?P<onoff>ON|OFF|YES|NO|TRUE|FALSE|0|1)\s*$",
|
|
915
|
-
x_consolewait_whendone,
|
|
916
|
-
description="CONSOLE_WAIT_WHEN_DONE",
|
|
917
|
-
category="config_option",
|
|
918
|
-
)
|
|
919
|
-
mcl.add(
|
|
920
|
-
r"^\s*CONFIG\s+CONSOLE\s+WAIT_WHEN_DONE\s+(?P<onoff>ON|OFF|YES|NO|TRUE|FALSE|0|1)\s*$",
|
|
921
|
-
x_consolewait_whendone,
|
|
922
|
-
)
|
|
923
|
-
|
|
924
|
-
# ------------------------------------------------------------------
|
|
925
|
-
# CONNECT — MS Access
|
|
926
|
-
# ------------------------------------------------------------------
|
|
927
|
-
mcl.add(
|
|
928
|
-
ins_fn_rxs(
|
|
929
|
-
r"^CONNECT\s+TO\s+ACCESS\s*\(\s*FILE\s*=\s*",
|
|
930
|
-
r"(?:\s*,\s*NEED_PWD\s*=\s*(?P<need_pwd>TRUE|FALSE))?"
|
|
931
|
-
r"(?:\s*,\s+PASSWORD\s*=\s*(?P<password>[^\s]+))?"
|
|
932
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
933
|
-
),
|
|
934
|
-
x_connect_access,
|
|
935
|
-
description="CONNECT",
|
|
936
|
-
category="action",
|
|
937
|
-
)
|
|
938
|
-
|
|
939
|
-
# ------------------------------------------------------------------
|
|
940
|
-
# CONNECT — Firebird
|
|
941
|
-
# ------------------------------------------------------------------
|
|
942
|
-
mcl.add(
|
|
943
|
-
(
|
|
944
|
-
r"^CONNECT\s+USER\s+TO\s+FIREBIRD\s*\(\s*SERVER\s*=\s*(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)\s*,\s*"
|
|
945
|
-
r"DB\s*=\s*(?P<db_name>[A-Z][A-Z0-9_\-]*)(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?"
|
|
946
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
947
|
-
r'^CONNECT\s+USER\s+TO\s+FIREBIRD\s*\(\s*SERVER\s*=\s*"(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)"\s*,\s*'
|
|
948
|
-
r'DB\s*=\s*"(?P<db_name>[A-Z][A-Z0-9_\- ]*)"(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?'
|
|
949
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
950
|
-
),
|
|
951
|
-
x_connect_user_fb,
|
|
952
|
-
)
|
|
953
|
-
mcl.add(
|
|
954
|
-
r"^CONNECT\s+TO\s+FIREBIRD\s*\(\s*SERVER\s*=\s*(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)\s*,\s*"
|
|
955
|
-
r"DB\s*=\s*(?P<db_name>[A-Z][A-Z0-9_\-]*)(?:\s*,\s*USER\s*=\s*(?P<user>[A-Z][A-Z0-9_@\-\.]*)\s*,\s*"
|
|
956
|
-
r"NEED_PWD\s*=\s*(?P<need_pwd>TRUE|FALSE))?(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?"
|
|
957
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
958
|
-
x_connect_fb,
|
|
959
|
-
)
|
|
960
|
-
|
|
961
|
-
# ------------------------------------------------------------------
|
|
962
|
-
# CONNECT — Oracle
|
|
963
|
-
# ------------------------------------------------------------------
|
|
964
|
-
mcl.add(
|
|
965
|
-
(
|
|
966
|
-
r"^CONNECT\s+USER\s+TO\s+ORACLE\s*\(\s*SERVER\s*=\s*(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)\s*,\s*"
|
|
967
|
-
r"DB\s*=\s*(?P<db_name>[A-Z][A-Z0-9_\-]*)(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?"
|
|
968
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
969
|
-
r'^CONNECT\s+USER\s+TO\s+ORACLE\s*\(\s*SERVER\s*=\s*"(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)"\s*,\s*'
|
|
970
|
-
r'DB\s*=\s*"(?P<db_name>[A-Z][A-Z0-9_\- ]*)"(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?'
|
|
971
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
972
|
-
),
|
|
973
|
-
x_connect_user_ora,
|
|
974
|
-
)
|
|
975
|
-
mcl.add(
|
|
976
|
-
(
|
|
977
|
-
r"^CONNECT\s+TO\s+ORACLE\s*\(\s*SERVER\s*=\s*(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)\s*,\s*"
|
|
978
|
-
r"DB\s*=\s*(?P<db_name>[A-Z][A-Z0-9_\-]*)(?:\s*,\s*USER\s*=\s*(?P<user>[A-Z][A-Z0-9_\-@\.]*)\s*,\s*"
|
|
979
|
-
r"NEED_PWD\s*=\s*(?P<need_pwd>TRUE|FALSE))?(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?"
|
|
980
|
-
r"(?:\s*,\s+PASSWORD\s*=\s*(?P<password>[^\s\)]+))?"
|
|
981
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
982
|
-
r'^CONNECT\s+TO\s+ORACLE\s*\(\s*SERVER\s*=\s*"(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)"\s*,\s*'
|
|
983
|
-
r'DB\s*=\s*"(?P<db_name>[A-Z][A-Z0-9_\-]*)"(?:\s*,\s*USER\s*=\s*"(?P<user>[A-Z][A-Z0-9_\-@\.]*)"\s*,\s*'
|
|
984
|
-
r"NEED_PWD\s*=\s*(?P<need_pwd>TRUE|FALSE))?(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?"
|
|
985
|
-
r'(?:\s*,\s+PASSWORD\s*=\s*"(?P<password>[^\s\)]+)")?'
|
|
986
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
987
|
-
),
|
|
988
|
-
x_connect_ora,
|
|
989
|
-
)
|
|
990
|
-
|
|
991
|
-
# ------------------------------------------------------------------
|
|
992
|
-
# RUN / EXECUTE
|
|
993
|
-
# ------------------------------------------------------------------
|
|
994
|
-
mcl.add(
|
|
995
|
-
r'^\s*EXEC(?:UTE)?\s+SCRIPT(?:\s+(?P<exists>IF\s+EXISTS))?\s+(?P<script_id>\w+)(?:(?:\s+WITH)?(?:\s+ARG(?:UMENT)?S?)?\s*\(\s*(?P<argexp>#?\w+\s*=\s*(?:(?:[^"\'\[][^,\)]*)|(?:"[^"]*")|(?:\'[^\']*\')|(?:\[[^\]]*\]))(?:\s*,\s*#?\w+\s*=\s*(?:(?:[^"\'\[][^,\)]*)|(?:"[^"]*")|(?:\'[^\']*\')|(?:\[[^\]]*\])))*)\s*\))?(?:\s+(?P<looptype>WHILE|UNTIL)\s*\(\s*(?P<loopcond>.+)\s*\))?\s*$',
|
|
996
|
-
x_executescript,
|
|
997
|
-
description="EXECUTE SCRIPT",
|
|
998
|
-
category="action",
|
|
999
|
-
)
|
|
1000
|
-
mcl.add(
|
|
1001
|
-
r'^\s*RUN\s+SCRIPT(?:\s+(?P<exists>IF\s+EXISTS))?\s+(?P<script_id>\w+)(?:(?:\s+WITH)?(?:\s+ARG(?:UMENT)?S?)?\s*\(\s*(?P<argexp>#?\w+\s*=\s*(?:(?:[^"\'\[][^,\)]*)|(?:"[^"]*")|(?:\'[^\']*\')|(?:\[[^\]]*\]))(?:\s*,\s*#?\w+\s*=\s*(?:(?:[^"\'\[][^,\)]*)|(?:"[^"]*")|(?:\'[^\']*\')|(?:\[[^\]]*\])))*)\s*\))?(?:\s+(?P<looptype>WHILE|UNTIL)\s*\(\s*(?P<loopcond>.+)\s*\))?\s*$',
|
|
1002
|
-
x_executescript,
|
|
1003
|
-
description="RUN",
|
|
1004
|
-
category="action",
|
|
1005
|
-
)
|
|
1006
|
-
mcl.add(
|
|
1007
|
-
r"^\s*(?P<cmd>RUN|EXECUTE)\s+(?P<queryname>\#?\w+)\s*$",
|
|
1008
|
-
x_execute,
|
|
1009
|
-
description="RUN",
|
|
1010
|
-
category="action",
|
|
1011
|
-
)
|
|
1012
|
-
|
|
1013
|
-
# ------------------------------------------------------------------
|
|
1014
|
-
# ON ERROR_HALT / ON CANCEL_HALT
|
|
1015
|
-
# ------------------------------------------------------------------
|
|
1016
|
-
mcl.add(
|
|
1017
|
-
r"^\s*ON\s+ERROR_HALT\s+WRITE\s+CLEAR\s*$",
|
|
1018
|
-
x_error_halt_write_clear,
|
|
1019
|
-
description="ON ERROR_HALT",
|
|
1020
|
-
category="config",
|
|
1021
|
-
)
|
|
1022
|
-
mcl.add(
|
|
1023
|
-
ins_fn_rxs(
|
|
1024
|
-
r"^\s*ON\s+ERROR_HALT\s+WRITE\s+\'(?P<text>([^\']|\n)*)\'(?:(?:\s+(?P<tee>TEE))?\s+TO\s+",
|
|
1025
|
-
r")?\s*$",
|
|
1026
|
-
),
|
|
1027
|
-
x_error_halt_write,
|
|
1028
|
-
)
|
|
1029
|
-
mcl.add(
|
|
1030
|
-
ins_fn_rxs(
|
|
1031
|
-
r"^\s*ON\s+ERROR_HALT\s+WRITE\s+\[(?P<text>([^\]]|\n)*)\](?:(?:\s+(?P<tee>TEE))?\s+TO\s+",
|
|
1032
|
-
r")?\s*$",
|
|
1033
|
-
),
|
|
1034
|
-
x_error_halt_write,
|
|
1035
|
-
)
|
|
1036
|
-
mcl.add(
|
|
1037
|
-
ins_fn_rxs(
|
|
1038
|
-
r'^\s*ON\s+ERROR_HALT\s+WRITE\s+"(?P<text>([^"]|\n)*)"(?:(?:\s+(?P<tee>TEE))?\s+TO\s+',
|
|
1039
|
-
r")?\s*$",
|
|
1040
|
-
),
|
|
1041
|
-
x_error_halt_write,
|
|
1042
|
-
)
|
|
1043
|
-
mcl.add(r"^\s*ON\s+ERROR_HALT\s+EMAIL\s+CLEAR\s*$", x_error_halt_email_clear)
|
|
1044
|
-
mcl.add(
|
|
1045
|
-
ins_fn_rxs(
|
|
1046
|
-
ins_fn_rxs(
|
|
1047
|
-
r"^\s*ON\s+ERROR_HALT\s+EMAIL\s+"
|
|
1048
|
-
r"FROM\s+(?P<from>[A-Za-z0-9_\-\.!#$%&\'*+/=?^`{|}~]+@[A-Za-z0-9]+(-[A-Za-z0-9]+)*(\.[A-Za-z0-9]+)*)\s+"
|
|
1049
|
-
r"TO\s+(?P<to>[A-Za-z0-9_\-\.!#$%&\'*+/=?^`{|}~]+@[A-Za-z0-9]+(-[A-Za-z0-9]+)*(\.[A-Za-z0-9]+)*"
|
|
1050
|
-
r"([;,]\s*[A-Za-z0-9\-\.!#$%&\'*+/=?^`{|}~]+@[A-Za-z0-9]+(-[A-Za-z0-9]+)*(\.[A-Za-z0-9]+)*)*)\s+"
|
|
1051
|
-
r'SUBJECT "(?P<subject>[^"]+)"\s+'
|
|
1052
|
-
r'MESSAGE\s+"(?P<msg>[^"]*)"'
|
|
1053
|
-
r"(\s+MESSAGE_FILE\s+",
|
|
1054
|
-
r")?(\s+ATTACH(MEANT)?_FILE\s+",
|
|
1055
|
-
"msg_file",
|
|
1056
|
-
),
|
|
1057
|
-
r")?\s*$",
|
|
1058
|
-
"att_file",
|
|
1059
|
-
),
|
|
1060
|
-
x_error_halt_email,
|
|
1061
|
-
)
|
|
1062
|
-
mcl.add(r"^\s*ON\s+ERROR_HALT\s+EXEC\s+CLEAR\s*$", x_error_halt_exec_clear)
|
|
1063
|
-
mcl.add(
|
|
1064
|
-
r"^\s*ON\s+CANCEL_HALT\s+WRITE\s+CLEAR\s*$",
|
|
1065
|
-
x_cancel_halt_write_clear,
|
|
1066
|
-
description="ON CANCEL_HALT",
|
|
1067
|
-
category="config",
|
|
1068
|
-
)
|
|
1069
|
-
mcl.add(
|
|
1070
|
-
ins_fn_rxs(
|
|
1071
|
-
r"^\s*ON\s+CANCEL_HALT\s+WRITE\s+\'(?P<text>([^\']|\n)*)\'(?:(?:\s+(?P<tee>TEE))?\s+TO\s+",
|
|
1072
|
-
r")?\s*$",
|
|
1073
|
-
),
|
|
1074
|
-
x_cancel_halt_write,
|
|
1075
|
-
)
|
|
1076
|
-
mcl.add(
|
|
1077
|
-
ins_fn_rxs(
|
|
1078
|
-
r"^\s*ON\s+CANCEL_HALT\s+WRITE\s+\[(?P<text>([^\]]|\n)*)\](?:(?:\s+(?P<tee>TEE))?\s+TO\s+",
|
|
1079
|
-
r")?\s*$",
|
|
1080
|
-
),
|
|
1081
|
-
x_cancel_halt_write,
|
|
1082
|
-
)
|
|
1083
|
-
mcl.add(
|
|
1084
|
-
ins_fn_rxs(
|
|
1085
|
-
r'^\s*ON\s+CANCEL_HALT\s+WRITE\s+"(?P<text>([^"]|\n)*)"(?:(?:\s+(?P<tee>TEE))?\s+TO\s+',
|
|
1086
|
-
r")?\s*$",
|
|
1087
|
-
),
|
|
1088
|
-
x_cancel_halt_write,
|
|
1089
|
-
)
|
|
1090
|
-
mcl.add(r"^\s*ON\s+CANCEL_HALT\s+EMAIL\s+CLEAR\s*$", x_cancel_halt_email_clear)
|
|
1091
|
-
mcl.add(
|
|
1092
|
-
ins_fn_rxs(
|
|
1093
|
-
ins_fn_rxs(
|
|
1094
|
-
r"^\s*ON\s+CANCEL_HALT\s+EMAIL\s+"
|
|
1095
|
-
r"FROM\s+(?P<from>[A-Za-z0-9_\-\.!#$%&\'*+/=?^`{|}~]+@[A-Za-z0-9]+(-[A-Za-z0-9]+)*(\.[A-Za-z0-9]+)*)\s+"
|
|
1096
|
-
r"TO\s+(?P<to>[A-Za-z0-9_\-\.!#$%&\'*+/=?^`{|}~]+@[A-Za-z0-9]+(-[A-Za-z0-9]+)*(\.[A-Za-z0-9]+)*"
|
|
1097
|
-
r"([;,]\s*[A-Za-z0-9\-\.!#$%&\'*+/=?^`{|}~]+@[A-Za-z0-9]+(-[A-Za-z0-9]+)*(\.[A-Za-z0-9]+)*)*)\s+"
|
|
1098
|
-
r'SUBJECT "(?P<subject>[^"]+)"\s+'
|
|
1099
|
-
r'MESSAGE\s+"(?P<msg>[^"]*)"'
|
|
1100
|
-
r"(\s+MESSAGE_FILE\s+",
|
|
1101
|
-
r")?(\s+ATTACH(MEANT)?_FILE\s+",
|
|
1102
|
-
"msg_file",
|
|
1103
|
-
),
|
|
1104
|
-
r")?\s*$",
|
|
1105
|
-
"att_file",
|
|
1106
|
-
),
|
|
1107
|
-
x_cancel_halt_email,
|
|
1108
|
-
)
|
|
1109
|
-
mcl.add(r"^\s*ON\s+CANCEL_HALT\s+EXEC\s+CLEAR\s*$", x_cancel_halt_exec_clear)
|
|
1110
|
-
|
|
1111
|
-
# ------------------------------------------------------------------
|
|
1112
|
-
# SUB_TEMPFILE
|
|
1113
|
-
# ------------------------------------------------------------------
|
|
1114
|
-
mcl.add(
|
|
1115
|
-
r"^\s*SUB_TEMPFILE\s+(?P<match>[+~]?\w+)\s*$",
|
|
1116
|
-
x_sub_tempfile,
|
|
1117
|
-
description="SUB_TEMPFILE",
|
|
1118
|
-
category="action",
|
|
1119
|
-
)
|
|
1120
|
-
|
|
1121
|
-
# ------------------------------------------------------------------
|
|
1122
|
-
# WRITE CREATE_TABLE (ODS / XLS / CSV / alias)
|
|
1123
|
-
# ------------------------------------------------------------------
|
|
1124
|
-
mcl.add(
|
|
1125
|
-
ins_table_rxs(
|
|
1126
|
-
r"^\s*WRITE\s+CREATE_TABLE\s+",
|
|
1127
|
-
ins_fn_rxs(
|
|
1128
|
-
r"\s+FROM\s+",
|
|
1129
|
-
ins_rxs(
|
|
1130
|
-
(
|
|
1131
|
-
r'"(?P<sheet>[A-Za-z0-9_\.\/\-\\ ]+)"',
|
|
1132
|
-
r"(?P<sheet>[A-Za-z0-9_\.\/\-\\]+)",
|
|
1133
|
-
),
|
|
1134
|
-
r"\s+SHEET\s+",
|
|
1135
|
-
ins_fn_rxs(
|
|
1136
|
-
r'(?:\s+SKIP\s+(?P<skip>\d+))?(?:\s+COMMENT\s+"(?P<comment>[^"]+)")?'
|
|
1137
|
-
r"(?:\s+TO\s+",
|
|
1138
|
-
r")?\s*$",
|
|
1139
|
-
"outfile",
|
|
1140
|
-
),
|
|
1141
|
-
),
|
|
1142
|
-
),
|
|
1143
|
-
),
|
|
1144
|
-
x_write_create_table_ods,
|
|
1145
|
-
description="WRITE CREATE_TABLE",
|
|
1146
|
-
category="action",
|
|
1147
|
-
)
|
|
1148
|
-
mcl.add(
|
|
1149
|
-
ins_table_rxs(
|
|
1150
|
-
r"^\s*WRITE\s+CREATE_TABLE\s+",
|
|
1151
|
-
ins_fn_rxs(
|
|
1152
|
-
r"\s+FROM\s+EXCEL\s+",
|
|
1153
|
-
ins_rxs(
|
|
1154
|
-
(
|
|
1155
|
-
r'"(?P<sheet>[A-Za-z0-9_\.\/\-\\ ]+)"',
|
|
1156
|
-
r"(?P<sheet>[A-Za-z0-9_\.\/\-\\]+)",
|
|
1157
|
-
),
|
|
1158
|
-
r"\s+SHEET\s+",
|
|
1159
|
-
ins_fn_rxs(
|
|
1160
|
-
r"(?:\s+SKIP\s+(?P<skip>\d+))?(?:\s+ENCODING\s+(?P<encoding>\w+))?"
|
|
1161
|
-
r'(?:\s+COMMENT\s+"(?P<comment>[^"]+)")?(?:\s+TO\s+',
|
|
1162
|
-
r")?\s*$",
|
|
1163
|
-
"outfile",
|
|
1164
|
-
),
|
|
1165
|
-
),
|
|
1166
|
-
),
|
|
1167
|
-
),
|
|
1168
|
-
x_write_create_table_xls,
|
|
1169
|
-
)
|
|
1170
|
-
mcl.add(
|
|
1171
|
-
ins_table_rxs(
|
|
1172
|
-
r"^\s*WRITE\s+CREATE_TABLE\s+",
|
|
1173
|
-
ins_table_rxs(
|
|
1174
|
-
r"\s+FROM\s+",
|
|
1175
|
-
ins_fn_rxs(
|
|
1176
|
-
r'\s+IN\s+(?P<alias>[A-Z][A-Z0-9_]*)(?:\s+COMMENT\s+"(?P<comment>[^"]+)")?(?:\s+TO\s+',
|
|
1177
|
-
r")?\s*$",
|
|
1178
|
-
),
|
|
1179
|
-
"1",
|
|
1180
|
-
),
|
|
1181
|
-
),
|
|
1182
|
-
x_write_create_table_alias,
|
|
1183
|
-
)
|
|
1184
|
-
mcl.add(
|
|
1185
|
-
ins_table_rxs(
|
|
1186
|
-
r"^\s*WRITE\s+CREATE_TABLE\s+",
|
|
1187
|
-
ins_fn_rxs(
|
|
1188
|
-
r"\s+FROM\s+",
|
|
1189
|
-
ins_fn_rxs(
|
|
1190
|
-
r'(?:\s+WITH\s+QUOTE\s+(?P<quotechar>NONE|\'|")\s+DELIMITER\s+(?P<delimchar>TAB|UNITSEP|US|,|;|\|))?'
|
|
1191
|
-
r"(?:\s+ENCODING\s+(?P<encoding>\w+))?(?:\s+SKIP\s+(?P<skip>\d+))?"
|
|
1192
|
-
r'(?:\s+COMMENT\s+"(?P<comment>[^"]+)")?(?:\s+TO\s+',
|
|
1193
|
-
r")?\s*$",
|
|
1194
|
-
"outfile",
|
|
1195
|
-
),
|
|
1196
|
-
),
|
|
1197
|
-
),
|
|
1198
|
-
x_write_create_table,
|
|
1199
|
-
)
|
|
1200
|
-
|
|
1201
|
-
# ------------------------------------------------------------------
|
|
1202
|
-
# RESET / SET COUNTER
|
|
1203
|
-
# ------------------------------------------------------------------
|
|
1204
|
-
mcl.add(
|
|
1205
|
-
r"^\s*RESET\s+COUNTER\s+(?P<counter_no>\d+)\s*$",
|
|
1206
|
-
x_reset_counter,
|
|
1207
|
-
description="RESET COUNTER",
|
|
1208
|
-
category="action",
|
|
1209
|
-
)
|
|
1210
|
-
mcl.add(r"^\s*RESET\s+COUNTERS\s*$", x_reset_counters)
|
|
1211
|
-
mcl.add(
|
|
1212
|
-
r"^\s*SET\s+COUNTER\s+(?P<counter_no>\d+)\s+TO\s+(?P<value>[0-9+\-*/() ]+)\s*$",
|
|
1213
|
-
x_set_counter,
|
|
1214
|
-
description="SET COUNTER",
|
|
1215
|
-
category="action",
|
|
1216
|
-
)
|
|
1217
|
-
|
|
1218
|
-
# ------------------------------------------------------------------
|
|
1219
|
-
# PROMPT CREDENTIALS / CONNECT
|
|
1220
|
-
# ------------------------------------------------------------------
|
|
1221
|
-
mcl.add(
|
|
1222
|
-
(
|
|
1223
|
-
r'^\s*PROMPT(?:\s+MESSAGE\s+"(?P<message>(.|\n)*)")?\s+CREDENTIALS\s+(?P<user>\w+)\s+(?P<pw>\w+)\s*$',
|
|
1224
|
-
r'^\s*PROMPT(?:\s+"(?P<message>(.|\n)*)")?\s+CREDENTIALS\s+(?P<user>\w+)\s+(?P<pw>\w+)\s*$',
|
|
1225
|
-
),
|
|
1226
|
-
x_prompt_credentials,
|
|
1227
|
-
description="PROMPT CREDENTIALS",
|
|
1228
|
-
category="prompt",
|
|
1229
|
-
)
|
|
1230
|
-
mcl.add(
|
|
1231
|
-
(
|
|
1232
|
-
r'^\s*PROMPT(?:\s+MESSAGE\s+"(?P<message>(.|\n)*)")?\s+CONNECT\s+AS\s+(?P<alias>\w+)(?:\s+HELP\s+(?P<help>[^\s]+))?\s*$',
|
|
1233
|
-
r'^\s*PROMPT(?:\s+MESSAGE\s+"(?P<message>(.|\n)*)")?\s+CONNECT\s+AS\s+(?P<alias>\w+)(?:\s+HELP\s+"(?P<help>[^"]+)")?\s*$',
|
|
1234
|
-
r'^\s*CONNECT\s+PROMPT(?:\s+MESSAGE\s+"(?P<message>(.|\n)*)")?\s+AS\s+(?P<alias>\w+)(?:\s+HELP\s+(?P<help>[^\s]+))?\s*$',
|
|
1235
|
-
r'^\s*CONNECT\s+PROMPT(?:\s+MESSAGE\s+"(?P<message>(.|\n)*)")?\s+AS\s+(?P<alias>\w+)(?:\s+HELP\s+"(?P<help>[^"]+)")?\s*$',
|
|
1236
|
-
r'^\s*PROMPT(?:\s+"(?P<message>(.|\n)*)")?\s+CONNECT\s+AS\s+(?P<alias>\w+)(?:\s+HELP\s+(?P<help>[^\s]+))?\s*$',
|
|
1237
|
-
r'^\s*PROMPT(?:\s+"(?P<message>(.|\n)*)")?\s+CONNECT\s+AS\s+(?P<alias>\w+)(?:\s+HELP\s+"(?P<help>[^"]+)")?\s*$',
|
|
1238
|
-
r'^\s*CONNECT\s+PROMPT(?:\s+"(?P<message>(.|\n)*)")?\s+AS\s+(?P<alias>\w+)(?:\s+HELP\s+(?P<help>[^\s]+))?\s*$',
|
|
1239
|
-
r'^\s*CONNECT\s+PROMPT(?:\s+"(?P<message>(.|\n)*)")?\s+AS\s+(?P<alias>\w+)(?:\s+HELP\s+"(?P<help>[^"]+)")?\s*$',
|
|
1240
|
-
),
|
|
1241
|
-
x_prompt_connect,
|
|
1242
|
-
description="PROMPT CONNECT",
|
|
1243
|
-
category="prompt",
|
|
1244
|
-
)
|
|
1245
|
-
|
|
1246
|
-
# ------------------------------------------------------------------
|
|
1247
|
-
# TIMER / LOG / SUB_INI
|
|
1248
|
-
# ------------------------------------------------------------------
|
|
1249
|
-
mcl.add(r"^\s*TIMER\s+(?P<onoff>ON|OFF)\s*$", x_timer, description="TIMER", category="config")
|
|
1250
|
-
mcl.add(r'^\s*LOG\s+"(?P<message>.+)"\s*$', x_log, description="LOG", category="action")
|
|
1251
|
-
mcl.add(
|
|
1252
|
-
ins_fn_rxs(r"^\s*SUB_INI\s+(?:FILE\s+)?", r"(?:\s+SECTION)?\s+(?P<section>\w+)\s*$"),
|
|
1253
|
-
x_sub_ini,
|
|
1254
|
-
description="SUB_INI",
|
|
1255
|
-
category="action",
|
|
1256
|
-
)
|
|
1257
|
-
|
|
1258
|
-
# ------------------------------------------------------------------
|
|
1259
|
-
# CONSOLE
|
|
1260
|
-
# ------------------------------------------------------------------
|
|
1261
|
-
mcl.add(
|
|
1262
|
-
r"^\s*CONSOLE\s+(?P<hideshow>HIDE|SHOW)\s*$",
|
|
1263
|
-
x_console_hideshow,
|
|
1264
|
-
description="CONSOLE",
|
|
1265
|
-
category="prompt",
|
|
1266
|
-
)
|
|
1267
|
-
mcl.add(r"^\s*CONSOLE\s+WIDTH\s+(?P<width>\d+)\s*$", x_consolewidth)
|
|
1268
|
-
mcl.add(r"^\s*CONSOLE\s+HEIGHT\s+(?P<height>\d+)\s*$", x_consoleheight)
|
|
1269
|
-
mcl.add(r'^\s*CONSOLE\s+STATUS\s+"(?P<message>.*)"\s*$', x_consolestatus)
|
|
1270
|
-
mcl.add(
|
|
1271
|
-
ins_fn_rxs(r"^\s*CONSOLE\s+SAVE(?:\s+(?P<append>APPEND))?\s+TO\s+", r"\s*$"),
|
|
1272
|
-
x_consolesave,
|
|
1273
|
-
)
|
|
1274
|
-
mcl.add(r'^\s*CONSOLE\s+WAIT(?:\s+"(?P<message>.+)")?\s*$', x_consolewait)
|
|
1275
|
-
mcl.add(
|
|
1276
|
-
r"^\s*CONSOLE\s+PROGRESS\s+(?P<num>[0-9]+(?:\.[0-9]+)?)(?:\s*/\s*(?P<total>[0-9]+(?:\.[0-9]+)?))?\s*$",
|
|
1277
|
-
x_consoleprogress,
|
|
1278
|
-
)
|
|
1279
|
-
mcl.add(r"^\s*CONSOLE\s+(?P<onoff>ON|OFF)\s*$", x_console)
|
|
1280
|
-
|
|
1281
|
-
# ------------------------------------------------------------------
|
|
1282
|
-
# DISCONNECT / AUTOCOMMIT
|
|
1283
|
-
# ------------------------------------------------------------------
|
|
1284
|
-
mcl.add(
|
|
1285
|
-
r"^\s*DISCONNECT(?:(?:\s+FROM)?\s+(?P<alias>[A-Z][A-Z0-9_]*))?\s*$",
|
|
1286
|
-
x_disconnect,
|
|
1287
|
-
description="DISCONNECT",
|
|
1288
|
-
category="action",
|
|
1289
|
-
)
|
|
1290
|
-
mcl.add(
|
|
1291
|
-
r"^\s*AUTOCOMMIT\s+OFF\s*$",
|
|
1292
|
-
x_autocommit_off,
|
|
1293
|
-
description="AUTOCOMMIT",
|
|
1294
|
-
category="action",
|
|
1295
|
-
)
|
|
1296
|
-
mcl.add(r"^\s*AUTOCOMMIT\s+ON(?:\s+WITH\s+(?P<action>COMMIT|ROLLBACK))?\s*$", x_autocommit_on)
|
|
1297
|
-
|
|
1298
|
-
# ------------------------------------------------------------------
|
|
1299
|
-
# WRITE SCRIPT / MAX_INT / PG_VACUUM
|
|
1300
|
-
# ------------------------------------------------------------------
|
|
1301
|
-
mcl.add(
|
|
1302
|
-
ins_fn_rxs(
|
|
1303
|
-
r"^\s*(?:DEBUG\s+)?WRITE\s+SCRIPT\s+(?P<script_id>\w+)(?:\s+(?P<append>APPEND\s+)?TO\s+",
|
|
1304
|
-
r")?\s*$",
|
|
1305
|
-
),
|
|
1306
|
-
x_writescript,
|
|
1307
|
-
description="WRITE SCRIPT",
|
|
1308
|
-
category="action",
|
|
1309
|
-
)
|
|
1310
|
-
mcl.add(r"^\s*MAX_INT\s+(?P<maxint>[0-9]+)\s*$", x_max_int, description="MAX_INT", category="action")
|
|
1311
|
-
mcl.add(r"^\s*PG_VACUUM(?P<vacuum_args>.*)\s*$", x_pg_vacuum, description="PG_VACUUM", category="action")
|
|
1312
|
-
|
|
1313
|
-
# ------------------------------------------------------------------
|
|
1314
|
-
# ZIP
|
|
1315
|
-
# ------------------------------------------------------------------
|
|
1316
|
-
mcl.add(
|
|
1317
|
-
ins_fn_rxs(
|
|
1318
|
-
r"^\s*ZIP\s+(?P<filename>[^ ]+)(?:\s+(?P<append>APPEND))?\s+TO\s+ZIPFILE\s+",
|
|
1319
|
-
r"\s*$",
|
|
1320
|
-
symbolicname="zipfilename",
|
|
1321
|
-
),
|
|
1322
|
-
x_zip,
|
|
1323
|
-
description="ZIP",
|
|
1324
|
-
category="action",
|
|
1325
|
-
)
|
|
1326
|
-
mcl.add(
|
|
1327
|
-
ins_fn_rxs(
|
|
1328
|
-
r'^\s*ZIP\s+"(?P<filename>[^"]+)"(?:\s+(?P<append>APPEND))?\s+TO\s+ZIPFILE\s+',
|
|
1329
|
-
r"\s*$",
|
|
1330
|
-
symbolicname="zipfilename",
|
|
1331
|
-
),
|
|
1332
|
-
x_zip,
|
|
1333
|
-
)
|
|
1334
|
-
|
|
1335
|
-
# ------------------------------------------------------------------
|
|
1336
|
-
# HALT (various forms)
|
|
1337
|
-
# ------------------------------------------------------------------
|
|
1338
|
-
mcl.add(
|
|
1339
|
-
ins_fn_rxs(
|
|
1340
|
-
r'^\s*HALT\s*(?:\s+MESSAGE)?(?:\s+"(?P<errmsg>.+)"(?:\s+(?P<tee>TEE\s+TO\s+',
|
|
1341
|
-
r"))?)?(?:\s+EXIT_STATUS\s+(?P<errorlevel>\d+))?\s*$",
|
|
1342
|
-
),
|
|
1343
|
-
x_halt,
|
|
1344
|
-
description="HALT",
|
|
1345
|
-
category="control",
|
|
1346
|
-
)
|
|
1347
|
-
for errmsg_delim in (r"\[", r"\#", r"\`", r"\'", r"\~", r'"'):
|
|
1348
|
-
# Use the same open/close bracket pair for the errmsg capture
|
|
1349
|
-
open_c = errmsg_delim if not errmsg_delim.startswith("\\") else errmsg_delim[1:]
|
|
1350
|
-
close_c = "]" if open_c == "[" else open_c
|
|
1351
|
-
mcl.add(
|
|
1352
|
-
ins_table_rxs(
|
|
1353
|
-
ins_fn_rxs(
|
|
1354
|
-
rf"^\s*HALT(?:\s+MESSAGE)?\s+{errmsg_delim}(?P<errmsg>(.|\n)*){re.escape(close_c)}"
|
|
1355
|
-
r"(?:\s+(?P<tee>TEE\s+TO\s+",
|
|
1356
|
-
r"))?(?:\s+DISPLAY\s+",
|
|
1357
|
-
),
|
|
1358
|
-
r")?(?:\s+EXIT_STATUS\s+(?P<errorlevel>\d+))?\s*$",
|
|
1359
|
-
),
|
|
1360
|
-
x_halt_msg,
|
|
1361
|
-
)
|
|
1362
|
-
|
|
1363
|
-
# ------------------------------------------------------------------
|
|
1364
|
-
# BEGIN / END BATCH / ROLLBACK
|
|
1365
|
-
# ------------------------------------------------------------------
|
|
1366
|
-
mcl.add(r"^\s*BEGIN\s+BATCH\s*$", x_begin_batch, description="BEGIN BATCH", category="block")
|
|
1367
|
-
mcl.add(r"^\s*END\s+BATCH\s*$", x_end_batch, "END BATCH", run_in_batch=True, category="block")
|
|
1368
|
-
mcl.add(r"^\s*ROLLBACK(:?\s+BATCH)?\s*$", x_rollback, "ROLLBACK BATCH", run_in_batch=True, category="block")
|
|
1369
|
-
|
|
1370
|
-
# ------------------------------------------------------------------
|
|
1371
|
-
# ERROR_HALT / METACOMMAND_ERROR_HALT / CANCEL_HALT
|
|
1372
|
-
# ------------------------------------------------------------------
|
|
1373
|
-
mcl.add(
|
|
1374
|
-
r"\s*ERROR_HALT\s+(?P<onoff>ON|OFF|YES|NO|TRUE|FALSE)\s*$",
|
|
1375
|
-
x_error_halt,
|
|
1376
|
-
description="ERROR_HALT",
|
|
1377
|
-
category="control",
|
|
1378
|
-
)
|
|
1379
|
-
mcl.add(
|
|
1380
|
-
r"\s*METACOMMAND_ERROR_HALT\s+(?P<onoff>ON|OFF|YES|NO|TRUE|FALSE)\s*$",
|
|
1381
|
-
x_metacommand_error_halt,
|
|
1382
|
-
set_error_flag=False,
|
|
1383
|
-
description="METACOMMAND_ERROR_HALT",
|
|
1384
|
-
category="control",
|
|
1385
|
-
)
|
|
1386
|
-
mcl.add(
|
|
1387
|
-
r"^\s*CANCEL_HALT\s+(?P<onoff>ON|OFF|YES|NO|TRUE|FALSE)\s*$",
|
|
1388
|
-
x_cancel_halt,
|
|
1389
|
-
description="CANCEL_HALT",
|
|
1390
|
-
category="control",
|
|
1391
|
-
)
|
|
1392
|
-
|
|
1393
|
-
# ------------------------------------------------------------------
|
|
1394
|
-
# LOOP
|
|
1395
|
-
# ------------------------------------------------------------------
|
|
1396
|
-
mcl.add(
|
|
1397
|
-
r"^\s*LOOP\s+(?P<looptype>WHILE|UNTIL)\s*\(\s*(?P<loopcond>.+)\s*\)\s*$",
|
|
1398
|
-
x_loop,
|
|
1399
|
-
description="LOOP",
|
|
1400
|
-
category="control",
|
|
1401
|
-
)
|
|
1402
|
-
|
|
1403
|
-
# ------------------------------------------------------------------
|
|
1404
|
-
# PAUSE
|
|
1405
|
-
# ------------------------------------------------------------------
|
|
1406
|
-
mcl.add(
|
|
1407
|
-
(
|
|
1408
|
-
r'^\s*PAUSE\s+"(?P<text>.+)"(?:\s+(?P<action>HALT|CONTINUE)\s+AFTER\s+(?P<countdown>\d+(?:\.\d*)?)\s+(?P<timeunit>SECONDS|MINUTES))?\s*$',
|
|
1409
|
-
r"^\s*PAUSE\s+'(?P<text>.+)'(?:\s+(?P<action>HALT|CONTINUE)\s+AFTER\s+(?P<countdown>\d+(?:\.\d*)?)\s+(?P<timeunit>SECONDS|MINUTES))?\s*$",
|
|
1410
|
-
r"^\s*PAUSE\s+\[(?P<text>.+)\](?:\s+(?P<action>HALT|CONTINUE)\s+AFTER\s+(?P<countdown>\d+(?:\.\d*)?)\s+(?P<timeunit>SECONDS|MINUTES))?\s*$",
|
|
1411
|
-
),
|
|
1412
|
-
x_pause,
|
|
1413
|
-
description="PAUSE",
|
|
1414
|
-
category="control",
|
|
1415
|
-
)
|
|
1416
|
-
|
|
1417
|
-
# ------------------------------------------------------------------
|
|
1418
|
-
# PROMPT ENTER_SUB
|
|
1419
|
-
# ------------------------------------------------------------------
|
|
1420
|
-
mcl.add(
|
|
1421
|
-
ins_table_rxs(
|
|
1422
|
-
r'^\s*PROMPT\s+ENTER_SUB\s+(?P<match_str>~?\w+)\s+(?:(?P<password>PASSWORD)\s+)?MESSAGE\s+"(?P<message>([^"]|\n)*)"(?:\s+DISPLAY\s+',
|
|
1423
|
-
r")?(?:\s+TYPE\s+(?P<type>INT|FLOAT|BOOL|IDENT))?(?:\s+(?P<case>LCASE|UCASE))?"
|
|
1424
|
-
r'(?:\s+INITIALLY\s+"(?P<initial>[^"]+)")?(?:\s+HELP\s+(?P<help>[^\s]+))?\s*$',
|
|
1425
|
-
),
|
|
1426
|
-
x_prompt_enter,
|
|
1427
|
-
description="PROMPT ENTER_SUB",
|
|
1428
|
-
category="prompt",
|
|
1429
|
-
)
|
|
1430
|
-
mcl.add(
|
|
1431
|
-
ins_table_rxs(
|
|
1432
|
-
r'^\s*PROMPT\s+ENTER_SUB\s+(?P<match_str>~?\w+)\s+(?:(?P<password>PASSWORD)\s+)?MESSAGE\s+"(?P<message>([^"]|\n)*)"(?:\s+DISPLAY\s+',
|
|
1433
|
-
r")?(?:\s+TYPE\s+(?P<type>INT|FLOAT|BOOL|IDENT))?(?:\s+(?P<case>LCASE|UCASE))?"
|
|
1434
|
-
r'(?:\s+INITIALLY\s+"(?P<initial>[^"]+)")?(?:\s+HELP\s+"(?P<help>[^+]+)")?\s*$',
|
|
1435
|
-
),
|
|
1436
|
-
x_prompt_enter,
|
|
1437
|
-
)
|
|
1438
|
-
|
|
1439
|
-
# ------------------------------------------------------------------
|
|
1440
|
-
# PROMPT ENTRY_FORM
|
|
1441
|
-
# ------------------------------------------------------------------
|
|
1442
|
-
mcl.add(
|
|
1443
|
-
ins_table_rxs(
|
|
1444
|
-
r"^\s*PROMPT\s+ENTRY_FORM\s+",
|
|
1445
|
-
ins_table_rxs(
|
|
1446
|
-
r'(?:\s+HELP\s+(?P<help>[^\s]+))?\s+MESSAGE\s+"(?P<message>(.|\n)*)"(?:\s+DISPLAY\s+',
|
|
1447
|
-
r")?\s*$",
|
|
1448
|
-
suffix="disp",
|
|
1449
|
-
),
|
|
1450
|
-
),
|
|
1451
|
-
x_prompt_entryform,
|
|
1452
|
-
description="PROMPT ENTRY_FORM",
|
|
1453
|
-
category="prompt",
|
|
1454
|
-
)
|
|
1455
|
-
mcl.add(
|
|
1456
|
-
ins_table_rxs(
|
|
1457
|
-
r"^\s*PROMPT\s+ENTRY_FORM\s+",
|
|
1458
|
-
ins_table_rxs(
|
|
1459
|
-
r'(?:\s+HELP\s+"(?P<help>[^"]+)")?\s+MESSAGE\s+"(?P<message>(.|\n)*)"(?:\s+DISPLAY\s+',
|
|
1460
|
-
r")?\s*$",
|
|
1461
|
-
suffix="disp",
|
|
1462
|
-
),
|
|
1463
|
-
),
|
|
1464
|
-
x_prompt_entryform,
|
|
1465
|
-
)
|
|
1466
|
-
|
|
1467
|
-
# ------------------------------------------------------------------
|
|
1468
|
-
# PROMPT SELECT_SUB
|
|
1469
|
-
# ------------------------------------------------------------------
|
|
1470
|
-
mcl.add(
|
|
1471
|
-
ins_table_rxs(
|
|
1472
|
-
r"^\s*PROMPT\s+SELECT_SUB\s+",
|
|
1473
|
-
r'\s+MESSAGE\s+"(?P<msg>(.|\n)*)"(?:\s+(?P<cont>CONTINUE))?(?:\s+HELP\s(?P<help>[^\s]+))?\s*$',
|
|
1474
|
-
),
|
|
1475
|
-
x_prompt_selectsub,
|
|
1476
|
-
description="PROMPT SELECT_SUB",
|
|
1477
|
-
category="prompt",
|
|
1478
|
-
)
|
|
1479
|
-
mcl.add(
|
|
1480
|
-
ins_table_rxs(
|
|
1481
|
-
r"^\s*PROMPT\s+SELECT_SUB\s+",
|
|
1482
|
-
r'\s+MESSAGE\s+"(?P<msg>(.|\n)*)"(?:\s+(?P<cont>CONTINUE))?(?:\s+HELP\s"(?P<help>[^"]+)")?\s*$',
|
|
1483
|
-
),
|
|
1484
|
-
x_prompt_selectsub,
|
|
1485
|
-
)
|
|
1486
|
-
|
|
1487
|
-
# ------------------------------------------------------------------
|
|
1488
|
-
# PROMPT PAUSE
|
|
1489
|
-
# ------------------------------------------------------------------
|
|
1490
|
-
mcl.add(
|
|
1491
|
-
(
|
|
1492
|
-
r'^\s*PROMPT\s+PAUSE\s+"(?P<text>.+)"(?:\s+(?P<action>HALT|CONTINUE)\s+AFTER\s+(?P<countdown>\d+(?:\.\d*)?)\s+(?P<timeunit>SECONDS|MINUTES))?\s*$',
|
|
1493
|
-
r"^\s*PROMPT\s+PAUSE\s+'(?P<text>.+)'(?:\s+(?P<action>HALT|CONTINUE)\s+AFTER\s+(?P<countdown>\d+(?:\.\d*)?)\s+(?P<timeunit>SECONDS|MINUTES))?\s*$",
|
|
1494
|
-
r"^\s*PROMPT\s+PAUSE\s+\[(?P<text>.+)\](?:\s+(?P<action>HALT|CONTINUE)\s+AFTER\s+(?P<countdown>\d+(?:\.\d*)?)\s+(?P<timeunit>SECONDS|MINUTES))?\s*$",
|
|
1495
|
-
),
|
|
1496
|
-
x_prompt_pause,
|
|
1497
|
-
description="PROMPT PAUSE",
|
|
1498
|
-
category="prompt",
|
|
1499
|
-
)
|
|
1500
|
-
|
|
1501
|
-
# ------------------------------------------------------------------
|
|
1502
|
-
# ASK
|
|
1503
|
-
# ------------------------------------------------------------------
|
|
1504
|
-
mcl.add(
|
|
1505
|
-
(
|
|
1506
|
-
r'^\s*ASK\s+"(?P<question>.+)"\s+SUB\s+(?P<match>~?\w+)\s*$',
|
|
1507
|
-
r"^\s*ASK\s+'(?P<question>.+)'\s+SUB\s+(?P<match>~?\w+)\s*$",
|
|
1508
|
-
r"^\s*ASK\s+\[(?P<question>.+)\]\s+SUB\s+(?P<match>~?\w+)\s*$",
|
|
1509
|
-
),
|
|
1510
|
-
x_ask,
|
|
1511
|
-
description="ASK",
|
|
1512
|
-
category="prompt",
|
|
1513
|
-
)
|
|
1514
|
-
|
|
1515
|
-
# ------------------------------------------------------------------
|
|
1516
|
-
# PROMPT COMPARE / PROMPT ASK COMPARE
|
|
1517
|
-
# ------------------------------------------------------------------
|
|
1518
|
-
mcl.add(
|
|
1519
|
-
ins_table_rxs(
|
|
1520
|
-
r"^\s*PROMPT\s+COMPARE\s+",
|
|
1521
|
-
ins_table_rxs(
|
|
1522
|
-
r"(?:\s+IN\s+(?P<alias1>\w+))?\s+(?P<orient>AND|BESIDE)\s+",
|
|
1523
|
-
r'(?:\s+IN\s+(?P<alias2>\w+))?\s+(?:PK|KEY)\s*\((?P<pks>(("[A-Z_0-9]+")|[A-Z_0-9]+)'
|
|
1524
|
-
r'(\s*,\s*(("[A-Z_0-9]+")|[A-Z_0-9]+))*)\)(?:\s+HELP\s+(?P<help>[^\s]+))?\s+MESSAGE\s+"(?P<msg>(.|\n)*)"\s*$',
|
|
1525
|
-
suffix="2",
|
|
1526
|
-
),
|
|
1527
|
-
suffix="1",
|
|
1528
|
-
),
|
|
1529
|
-
x_prompt_compare,
|
|
1530
|
-
description="PROMPT COMPARE",
|
|
1531
|
-
category="prompt",
|
|
1532
|
-
)
|
|
1533
|
-
mcl.add(
|
|
1534
|
-
ins_table_rxs(
|
|
1535
|
-
r"^\s*PROMPT\s+COMPARE\s+",
|
|
1536
|
-
ins_table_rxs(
|
|
1537
|
-
r"(?:\s+IN\s+(?P<alias1>\w+))?\s+(?P<orient>AND|BESIDE)\s+",
|
|
1538
|
-
r'(?:\s+IN\s+(?P<alias2>\w+))?\s+(?:PK|KEY)\s*\((?P<pks>(("[A-Z_0-9]+")|[A-Z_0-9]+)'
|
|
1539
|
-
r'(\s*,\s*(("[A-Z_0-9]+")|[A-Z_0-9]+))*)\)(?:\s+HELP\s+"(?P<help>[^"]+)")?\s+MESSAGE\s+"(?P<msg>(.|\n)*)"\s*$',
|
|
1540
|
-
suffix="2",
|
|
1541
|
-
),
|
|
1542
|
-
suffix="1",
|
|
1543
|
-
),
|
|
1544
|
-
x_prompt_compare,
|
|
1545
|
-
)
|
|
1546
|
-
mcl.add(
|
|
1547
|
-
ins_table_rxs(
|
|
1548
|
-
r'^\s*PROMPT\s+ASK\s+"(?P<msg>(.|\n)*)"\s+SUB\s+(?P<match>~?\w+)\s+COMPARE\s+',
|
|
1549
|
-
ins_table_rxs(
|
|
1550
|
-
r"(?:\s+IN\s+(?P<alias1>\w+))?\s+(?P<orient>AND|BESIDE)\s+",
|
|
1551
|
-
r'(?:\s+IN\s+(?P<alias2>\w+))?\s+(?:PK|KEY)\s*\((?P<pks>(("[A-Z_0-9]+")|[A-Z_0-9]+)'
|
|
1552
|
-
r'(\s*,\s*(("[A-Z_0-9]+")|[A-Z_0-9]+))*)\)(?:\s+HELP\s+(?P<help>[^\s]+))?\s*$',
|
|
1553
|
-
suffix="2",
|
|
1554
|
-
),
|
|
1555
|
-
suffix="1",
|
|
1556
|
-
),
|
|
1557
|
-
x_prompt_ask_compare,
|
|
1558
|
-
description="PROMPT ASK COMPARE",
|
|
1559
|
-
category="prompt",
|
|
1560
|
-
)
|
|
1561
|
-
mcl.add(
|
|
1562
|
-
ins_table_rxs(
|
|
1563
|
-
r'^\s*PROMPT\s+ASK\s+"(?P<msg>(.|\n)*)"\s+SUB\s+(?P<match>~?\w+)\s+COMPARE\s+',
|
|
1564
|
-
ins_table_rxs(
|
|
1565
|
-
r"(?:\s+IN\s+(?P<alias1>\w+))?\s+(?P<orient>AND|BESIDE)\s+",
|
|
1566
|
-
r'(?:\s+IN\s+(?P<alias2>\w+))?\s+(?:PK|KEY)\s*\((?P<pks>(("[A-Z_0-9]+")|[A-Z_0-9]+)'
|
|
1567
|
-
r'(\s*,\s*(("[A-Z_0-9]+")|[A-Z_0-9]+))*)\)(?:\s+HELP\s+"(?P<help>[^"]+)")?\s*$',
|
|
1568
|
-
suffix="2",
|
|
1569
|
-
),
|
|
1570
|
-
suffix="1",
|
|
1571
|
-
),
|
|
1572
|
-
x_prompt_ask_compare,
|
|
1573
|
-
)
|
|
1574
|
-
|
|
1575
|
-
# ------------------------------------------------------------------
|
|
1576
|
-
# PROMPT MAP
|
|
1577
|
-
# ------------------------------------------------------------------
|
|
1578
|
-
mcl.add(
|
|
1579
|
-
ins_table_rxs(
|
|
1580
|
-
r'^\s*PROMPT\s+MESSAGE\s+"(?P<message>(.|\n)*)"\s+MAP\s+',
|
|
1581
|
-
r"\s*LAT\s+(?P<lat_col>\w+)\s+LON\s+(?P<lon_col>\w+)"
|
|
1582
|
-
r"(?:\s+LABEL\s+(?P<label_col>\w+))?(?:\s+COLOR\s+(?P<color_col>\w+))?"
|
|
1583
|
-
r"(?:\s+SYMBOL\s+(?P<symbol_col>\w+))?\s*$",
|
|
1584
|
-
),
|
|
1585
|
-
x_prompt_map,
|
|
1586
|
-
description="PROMPT MAP",
|
|
1587
|
-
category="prompt",
|
|
1588
|
-
)
|
|
1589
|
-
mcl.add(
|
|
1590
|
-
ins_table_rxs(
|
|
1591
|
-
r'^\s*PROMPT\s+MESSAGE\s+"(?P<message>(.|\n)*)"\s+MAP\s+',
|
|
1592
|
-
r'\s*LAT\s+"(?P<lat_col>[\w+ ])"\s+LON\s+"(?P<lon_col>[\w+ ])"'
|
|
1593
|
-
r'(?:\s+LABEL\s+"(?P<label_col>[\w+ ])")?(?:\s+COLOR\s+"(?P<color_col>[\w+ ])")?'
|
|
1594
|
-
r'(?:\s+SYMBOL\s+"(?P<symbol_col>[\w+ ])")?\s*$',
|
|
1595
|
-
),
|
|
1596
|
-
x_prompt_map,
|
|
1597
|
-
)
|
|
1598
|
-
|
|
1599
|
-
# ------------------------------------------------------------------
|
|
1600
|
-
# EMAIL
|
|
1601
|
-
# ------------------------------------------------------------------
|
|
1602
|
-
mcl.add(
|
|
1603
|
-
ins_fn_rxs(
|
|
1604
|
-
ins_fn_rxs(
|
|
1605
|
-
r"^\s*EMAIL\s+"
|
|
1606
|
-
r"FROM\s+(?P<from>[A-Za-z0-9_\-\.!#$%&\'*+/=?^`{|}~]+@[A-Za-z0-9]+(-[A-Za-z0-9]+)*(\.[A-Za-z0-9]+)*)\s+"
|
|
1607
|
-
r"TO\s+(?P<to>[A-Za-z0-9_\-\.!#$%&\'*+/=?^`{|}~]+@[A-Za-z0-9]+(-[A-Za-z0-9]+)*(\.[A-Za-z0-9]+)*"
|
|
1608
|
-
r"([;,]\s*[A-Za-z0-9\-\.!#$%&\'*+/=?^`{|}~]+@[A-Za-z0-9]+(-[A-Za-z0-9]+)*(\.[A-Za-z0-9]+)*)*)\s+"
|
|
1609
|
-
r'SUBJECT "(?P<subject>[^"]+)"\s+'
|
|
1610
|
-
r'MESSAGE\s+"(?P<msg>[^"]*)"'
|
|
1611
|
-
r"(\s+MESSAGE_FILE\s+",
|
|
1612
|
-
r")?(\s+ATTACH(MEANT)?_FILE\s+",
|
|
1613
|
-
"msg_file",
|
|
1614
|
-
),
|
|
1615
|
-
r")?\s*$",
|
|
1616
|
-
"att_file",
|
|
1617
|
-
),
|
|
1618
|
-
x_email,
|
|
1619
|
-
description="EMAIL",
|
|
1620
|
-
category="action",
|
|
1621
|
-
)
|
|
1622
|
-
|
|
1623
|
-
# ------------------------------------------------------------------
|
|
1624
|
-
# EXPORT_METADATA
|
|
1625
|
-
# ------------------------------------------------------------------
|
|
1626
|
-
mcl.add(
|
|
1627
|
-
ins_fn_rxs(
|
|
1628
|
-
ins_fn_rxs(
|
|
1629
|
-
r"^\s*EXPORT_METADATA(?:\s+(?P<append>APPEND))?(?:\s+(?P<all>ALL))?\s+TO\s+",
|
|
1630
|
-
r"(?:\s+IN\s+ZIPFILE\s+",
|
|
1631
|
-
),
|
|
1632
|
-
rf")?\s+AS\s+(?P<format>{'|'.join(METADATA_FORMATS)})",
|
|
1633
|
-
symbolicname="zipfilename",
|
|
1634
|
-
),
|
|
1635
|
-
x_export_metadata,
|
|
1636
|
-
description="EXPORT_METADATA",
|
|
1637
|
-
category="action",
|
|
1638
|
-
)
|
|
1639
|
-
mcl.add(
|
|
1640
|
-
ins_table_rxs(
|
|
1641
|
-
r"^\s*EXPORT_METADATA(?:\s+(?P<all>ALL))?\s+INTO(?:\s+(?P<new>NEW|REPLACEMENT))?\s+TABLE\s+",
|
|
1642
|
-
r"\s*$",
|
|
1643
|
-
),
|
|
1644
|
-
x_export_metadata_table,
|
|
1645
|
-
)
|
|
1646
|
-
|
|
1647
|
-
# ------------------------------------------------------------------
|
|
1648
|
-
# SUB operations
|
|
1649
|
-
# ------------------------------------------------------------------
|
|
1650
|
-
mcl.add(
|
|
1651
|
-
r"^\s*SUB_EMPTY\s+(?P<match>[+~]?\w+)\s*$",
|
|
1652
|
-
x_sub_empty,
|
|
1653
|
-
description="SUB_EMPTY",
|
|
1654
|
-
category="action",
|
|
1655
|
-
)
|
|
1656
|
-
mcl.add(
|
|
1657
|
-
r"^\s*SUB_ADD\s+(?P<match>[+~]?\w+)\s+(?P<increment>[+\-0-9\.*/() ]+)\s*$",
|
|
1658
|
-
x_sub_add,
|
|
1659
|
-
description="SUB_ADD",
|
|
1660
|
-
category="action",
|
|
1661
|
-
)
|
|
1662
|
-
mcl.add(
|
|
1663
|
-
r"^\s*SUB_APPEND\s+(?P<match>[+~]?\w+)\s(?P<repl>(.|\n)*)$",
|
|
1664
|
-
x_sub_append,
|
|
1665
|
-
description="SUB_APPEND",
|
|
1666
|
-
category="action",
|
|
1667
|
-
)
|
|
1668
|
-
|
|
1669
|
-
# ------------------------------------------------------------------
|
|
1670
|
-
# IF / ORIF / ANDIF / ELSEIF / ELSE / ENDIF
|
|
1671
|
-
# ------------------------------------------------------------------
|
|
1672
|
-
mcl.add(
|
|
1673
|
-
r"^\s*ORIF\s*\(\s*(?P<condtest>.+)\s*\)\s*$",
|
|
1674
|
-
x_if_orif,
|
|
1675
|
-
description="ORIF",
|
|
1676
|
-
run_when_false=True,
|
|
1677
|
-
category="control",
|
|
1678
|
-
)
|
|
1679
|
-
mcl.add(
|
|
1680
|
-
r"^\s*ELSEIF\s*\(\s*(?P<condtest>.+)\s*\)\s*$",
|
|
1681
|
-
x_if_elseif,
|
|
1682
|
-
description="ELSEIF",
|
|
1683
|
-
run_when_false=True,
|
|
1684
|
-
category="control",
|
|
1685
|
-
)
|
|
1686
|
-
mcl.add(r"^\s*ANDIF\s*\(\s*(?P<condtest>.+)\s*\)\s*$", x_if_andif, description="ANDIF", category="control")
|
|
1687
|
-
mcl.add(r"^\s*ELSE\s*$", x_if_else, description="ELSE", run_when_false=True, category="control")
|
|
1688
|
-
mcl.add(
|
|
1689
|
-
r"^\s*IF\s*\(\s*(?P<condtest>.+)\s*\)\s*{\s*(?P<condcmd>.+)\s*}\s*$",
|
|
1690
|
-
x_if,
|
|
1691
|
-
description="IF",
|
|
1692
|
-
category="control",
|
|
1693
|
-
)
|
|
1694
|
-
mcl.add(r"^\s*IF\s*\(\s*(?P<condtest>.+)\s*\)\s*$", x_if_block, run_when_false=True, category="control")
|
|
1695
|
-
mcl.add(r"^\s*ENDIF\s*$", x_if_end, description="ENDIF", run_when_false=True, category="control")
|
|
1696
|
-
|
|
1697
|
-
# ------------------------------------------------------------------
|
|
1698
|
-
# CONNECT — SQL Server
|
|
1699
|
-
# ------------------------------------------------------------------
|
|
1700
|
-
mcl.add(
|
|
1701
|
-
(
|
|
1702
|
-
r"^CONNECT\s+USER\s+TO\s+SQLSERVER\s*\(\s*SERVER\s*=\s*(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)\s*,\s*"
|
|
1703
|
-
r"DB\s*=\s*(?P<db_name>[A-Z][A-Z0-9_\-]*)(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?"
|
|
1704
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
1705
|
-
r'^CONNECT\s+USER\s+TO\s+SQLSERVER\s*\(\s*SERVER\s*=\s*"(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)"\s*,\s*'
|
|
1706
|
-
r'DB\s*=\s*"(?P<db_name>[A-Z][A-Z0-9_\- ]*)"(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?'
|
|
1707
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
1708
|
-
),
|
|
1709
|
-
x_connect_user_ssvr,
|
|
1710
|
-
)
|
|
1711
|
-
mcl.add(
|
|
1712
|
-
(
|
|
1713
|
-
r"^CONNECT\s+TO\s+SQLSERVER\s*\(\s*SERVER\s*=\s*(?P<server>[A-Z0-9][A-Z0-9_\/\\\-\.]*)\s*,\s*"
|
|
1714
|
-
r"DB\s*=\s*(?P<db_name>[A-Z][A-Z0-9_\-]*)(?:\s*,\s*USER\s*=\s*(?P<user>[A-Z][A-Z0-9_~`!@#$%^&\*\+=\/\?\.-]*)"
|
|
1715
|
-
r"\s*,\s*NEED_PWD\s*=\s*(?P<need_pwd>TRUE|FALSE))?(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?"
|
|
1716
|
-
r"(?:\s*,\s+PASSWORD\s*=\s*(?P<password>[^\s\)]+))?"
|
|
1717
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
1718
|
-
r'^CONNECT\s+TO\s+SQLSERVER\s*\(\s*SERVER\s*=\s*"(?P<server>[A-Z0-9][A-Z0-9_\/\\\s\-\.]*)"\s*,\s*'
|
|
1719
|
-
r'DB\s*=\s*"(?P<db_name>[A-Z][A-Z0-9_\-\s]*)"(?:\s*,\s*USER\s*=\s*(?P<user>[A-Z][A-Z0-9_~`!@#$%^&\*\+=\/\?\.-]*)'
|
|
1720
|
-
r"\s*,\s*NEED_PWD\s*=\s*(?P<need_pwd>TRUE|FALSE))?(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?"
|
|
1721
|
-
r"(?:\s*,\s+PASSWORD\s*=\s*(?P<password>[^\s\)]+))?"
|
|
1722
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
1723
|
-
),
|
|
1724
|
-
x_connect_ssvr,
|
|
1725
|
-
)
|
|
1726
|
-
|
|
1727
|
-
# ------------------------------------------------------------------
|
|
1728
|
-
# COPY QUERY / COPY
|
|
1729
|
-
# ------------------------------------------------------------------
|
|
1730
|
-
mcl.add(
|
|
1731
|
-
ins_table_rxs(
|
|
1732
|
-
r"^COPY QUERY\s+<<\s*(?P<query>.*;)\s*>>\s+FROM\s+(?P<alias1>[A-Z][A-Z0-9_]*)\s+TO\s+(?:(?P<new>NEW|REPLACEMENT)\s+)?",
|
|
1733
|
-
r" IN\s+(?P<alias2>[A-Z][A-Z0-9_]*)\s*$",
|
|
1734
|
-
),
|
|
1735
|
-
x_copy_query,
|
|
1736
|
-
description="COPY QUERY",
|
|
1737
|
-
category="action",
|
|
1738
|
-
)
|
|
1739
|
-
mcl.add(
|
|
1740
|
-
(
|
|
1741
|
-
r"^COPY\s+(?:(?P<schema1>[A-Z][A-Z0-9_\-\/\:]*)\.)?(?P<table1>[A-Z][A-Z0-9_\-\/\:]*)\s+FROM\s+(?P<alias1>[A-Z][A-Z0-9_]*)\s+TO\s+(?:(?P<new>NEW|REPLACEMENT)\s+)?(?:(?P<schema2>[A-Z][A-Z0-9_\-\/\:]*)\.)?(?P<table2>[A-Z][A-Z0-9_\-\/\:]*)\s+IN\s+(?P<alias2>[A-Z][A-Z0-9_]*)\s*$",
|
|
1742
|
-
r'^COPY\s+(?:"(?P<schema1>[A-Z][A-Z0-9_\-\/\: ]*)"\.)?"(?P<table1>[A-Z][A-Z0-9_\-\/\: ]*)"\s+FROM\s+(?P<alias1>[A-Z][A-Z0-9_]*)\s+TO\s+(?:(?P<new>NEW|REPLACEMENT)\s+)?(?:"(?P<schema2>[A-Z][A-Z0-9_\-\/\:]*)"\.)?"(?P<table2>[A-Z][A-Z0-9_\-\/\:]*)"\s+IN\s+(?P<alias2>[A-Z][A-Z0-9_]*)\s*$',
|
|
1743
|
-
r'^COPY\s+(?:(?P<schema1>[A-Z][A-Z0-9_\-\/\:]*)\.)?(?P<table1>[A-Z][A-Z0-9_\-\/\:]*)\s+FROM\s+(?P<alias1>[A-Z][A-Z0-9_]*)\s+TO\s+(?:(?P<new>NEW|REPLACEMENT)\s+)?(?:"(?P<schema2>[A-Z][A-Z0-9_\-\/\:]*)"\.)?"(?P<table2>[A-Z][A-Z0-9_\-\/\:]*)"\s+IN\s+(?P<alias2>[A-Z][A-Z0-9_]*)\s*$',
|
|
1744
|
-
r'^COPY\s+(?:"(?P<schema1>[A-Z][A-Z0-9_\-\/\: ]*)"\.)?"(?P<table1>[A-Z][A-Z0-9_\-\/\: ]*)"\s+FROM\s+(?P<alias1>[A-Z][A-Z0-9_]*)\s+TO\s+(?:(?P<new>NEW|REPLACEMENT)\s+)?(?:(?P<schema2>[A-Z][A-Z0-9_\-\/\:]*)\.)?(?P<table2>[A-Z][A-Z0-9_\-\/\:]*)\s+IN\s+(?P<alias2>[A-Z][A-Z0-9_]*)\s*$',
|
|
1745
|
-
r"^COPY\s+(?:\[(?P<schema1>[A-Z][A-Z0-9_\-\/\: ]*)\]\.)?\[(?P<table1>[A-Z][A-Z0-9_\-\/\: ]*)\]\s+FROM\s+(?P<alias1>[A-Z][A-Z0-9_]*)\s+TO\s+(?:(?P<new>NEW|REPLACEMENT)\s+)?(?:\[(?P<schema2>[A-Z][A-Z0-9_\-\/\:]*)\]\.)?\[(?P<table2>[A-Z][A-Z0-9_\-\/\:]*)\]\s+IN\s+(?P<alias2>[A-Z][A-Z0-9_]*)\s*$",
|
|
1746
|
-
),
|
|
1747
|
-
x_copy,
|
|
1748
|
-
description="COPY",
|
|
1749
|
-
category="action",
|
|
1750
|
-
)
|
|
1751
|
-
|
|
1752
|
-
# ------------------------------------------------------------------
|
|
1753
|
-
# APPEND/EXTEND SCRIPT
|
|
1754
|
-
# ------------------------------------------------------------------
|
|
1755
|
-
mcl.add(
|
|
1756
|
-
r"\s*APPEND\s+SCRIPT\s+(?P<script1>\w+)\s+TO\s+(?P<script2>\w+)\s*$",
|
|
1757
|
-
x_extendscript,
|
|
1758
|
-
description="APPEND SCRIPT",
|
|
1759
|
-
category="action",
|
|
1760
|
-
)
|
|
1761
|
-
mcl.add(
|
|
1762
|
-
r"\s*EXTEND\s+SCRIPT\s+(?P<script>\w+)\s+WITH\s+METACOMMAND\s+(?P<cmd>.+)\s*$",
|
|
1763
|
-
x_extendscript_metacommand,
|
|
1764
|
-
description="EXTEND SCRIPT",
|
|
1765
|
-
category="action",
|
|
1766
|
-
)
|
|
1767
|
-
mcl.add(
|
|
1768
|
-
r"\s*EXTEND\s+SCRIPT\s+(?P<script>\w+)\s+WITH\s+SQL\s+(?P<sql>.+;)\s*$",
|
|
1769
|
-
x_extendscript_sql,
|
|
1770
|
-
)
|
|
1771
|
-
|
|
1772
|
-
# ------------------------------------------------------------------
|
|
1773
|
-
# CONNECT — DuckDB / SQLite / PostgreSQL / MySQL
|
|
1774
|
-
# ------------------------------------------------------------------
|
|
1775
|
-
mcl.add(
|
|
1776
|
-
ins_fn_rxs(
|
|
1777
|
-
r"^CONNECT\s+TO\s+DUCKDB\s*\(\s*FILE\s*=\s*",
|
|
1778
|
-
r"(?:\s*,\s*(?P<new>NEW))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
1779
|
-
),
|
|
1780
|
-
x_connect_duckdb,
|
|
1781
|
-
)
|
|
1782
|
-
mcl.add(
|
|
1783
|
-
ins_fn_rxs(
|
|
1784
|
-
r"^CONNECT\s+TO\s+SQLITE\s*\(\s*FILE\s*=\s*",
|
|
1785
|
-
r"(?:\s*,\s*(?P<new>NEW))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
1786
|
-
),
|
|
1787
|
-
x_connect_sqlite,
|
|
1788
|
-
)
|
|
1789
|
-
mcl.add(
|
|
1790
|
-
(
|
|
1791
|
-
r"^CONNECT\s+USER\s+TO\s+POSTGRESQL\s*\(\s*SERVER\s*=\s*(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)\s*,\s*"
|
|
1792
|
-
r"DB\s*=\s*(?P<db_name>[A-Z][A-Z0-9_\-]*)(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?"
|
|
1793
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
1794
|
-
r'^CONNECT\s+USER\s+TO\s+POSTGRESQL\s*\(\s*SERVER\s*=\s*"(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)"\s*,\s*'
|
|
1795
|
-
r'DB\s*=\s*"(?P<db_name>[A-Z][A-Z0-9_\-]*)"(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?'
|
|
1796
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
1797
|
-
),
|
|
1798
|
-
x_connect_user_pg,
|
|
1799
|
-
)
|
|
1800
|
-
mcl.add(
|
|
1801
|
-
(
|
|
1802
|
-
r"^CONNECT\s+TO\s+POSTGRESQL\s*\(\s*SERVER\s*=\s*(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)\s*,\s*"
|
|
1803
|
-
r"DB\s*=\s*(?P<db_name>[A-Z][A-Z0-9_\-]*)(?:\s*,\s*USER\s*=\s*(?P<user>[A-Z][A-Z0-9_\-@\.]*)\s*,\s*"
|
|
1804
|
-
r"NEED_PWD\s*=\s*(?P<need_pwd>TRUE|FALSE))?(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?"
|
|
1805
|
-
r"(?:\s*,\s+PASSWORD\s*=\s*(?P<password>[^\s\)]+))?"
|
|
1806
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?(?:\s*,\s*(?P<new>NEW))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
1807
|
-
r'^CONNECT\s+TO\s+POSTGRESQL\s*\(\s*SERVER\s*=\s*"(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)"\s*,\s*'
|
|
1808
|
-
r'DB\s*=\s*"(?P<db_name>[A-Z][A-Z0-9_\-]*)"(?:\s*,\s*USER\s*=\s*"(?P<user>[A-Z][A-Z0-9_\-@\.]*)"\s*,\s*'
|
|
1809
|
-
r"NEED_PWD\s*=\s*(?P<need_pwd>TRUE|FALSE))?(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?"
|
|
1810
|
-
r'(?:\s*,\s+PASSWORD\s*=\s*"(?P<password>[^\s\)]+)")?'
|
|
1811
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?(?:\s*,\s*(?P<new>NEW))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
1812
|
-
),
|
|
1813
|
-
x_connect_pg,
|
|
1814
|
-
)
|
|
1815
|
-
mcl.add(
|
|
1816
|
-
(
|
|
1817
|
-
r"^CONNECT\s+USER\s+TO\s+MYSQL\s*\(\s*SERVER\s*=\s*(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)\s*,\s*"
|
|
1818
|
-
r"DB\s*=\s*(?P<db_name>[A-Z][A-Z0-9_\-]*)(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?"
|
|
1819
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
1820
|
-
r'^CONNECT\s+USER\s+TO\s+MYSQL\s*\(\s*SERVER\s*=\s*"(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)"\s*,\s*'
|
|
1821
|
-
r'DB\s*=\s*"(?P<db_name>[A-Z][A-Z0-9_\-]*)"(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?'
|
|
1822
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
1823
|
-
r"^CONNECT\s+USER\s+TO\s+MARIADB\s*\(\s*SERVER\s*=\s*(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)\s*,\s*"
|
|
1824
|
-
r"DB\s*=\s*(?P<db_name>[A-Z][A-Z0-9_\-]*)(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?"
|
|
1825
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
1826
|
-
r'^CONNECT\s+USER\s+TO\s+MARIADB\s*\(\s*SERVER\s*=\s*"(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)"\s*,\s*'
|
|
1827
|
-
r'DB\s*=\s*"(?P<db_name>[A-Z][A-Z0-9_\-]*)"(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?'
|
|
1828
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
1829
|
-
),
|
|
1830
|
-
x_connect_user_mysql,
|
|
1831
|
-
)
|
|
1832
|
-
mcl.add(
|
|
1833
|
-
(
|
|
1834
|
-
r"^CONNECT\s+TO\s+MYSQL\s*\(\s*SERVER\s*=\s*(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)\s*,\s*"
|
|
1835
|
-
r"DB\s*=\s*(?P<db_name>[A-Z][A-Z0-9_\-]*)(?:\s*,\s*USER\s*=\s*(?P<user>[A-Z][A-Z0-9_@\-\.]*)\s*,\s*"
|
|
1836
|
-
r"NEED_PWD\s*=\s*(?P<need_pwd>TRUE|FALSE))?(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?"
|
|
1837
|
-
r"(?:\s*,\s+PASSWORD\s*=\s*(?P<password>[^\s]+))?"
|
|
1838
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
1839
|
-
r"^CONNECT\s+TO\s+MARIADB\s*\(\s*SERVER\s*=\s*(?P<server>[A-Z0-9][A-Z0-9_\-\.]*)\s*,\s*"
|
|
1840
|
-
r"DB\s*=\s*(?P<db_name>[A-Z][A-Z0-9_\-]*)(?:\s*,\s*USER\s*=\s*(?P<user>[A-Z][A-Z0-9_&\-\.]*)\s*,\s*"
|
|
1841
|
-
r"NEED_PWD\s*=\s*(?P<need_pwd>TRUE|FALSE))?(?:\s*,\s*PORT\s*=\s*(?P<port>\d+))?"
|
|
1842
|
-
r"(?:\s*,\s+PASSWORD\s*=\s*(?P<password>[^\s]+))?"
|
|
1843
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
1844
|
-
),
|
|
1845
|
-
x_connect_mysql,
|
|
1846
|
-
)
|
|
1847
|
-
|
|
1848
|
-
# ------------------------------------------------------------------
|
|
1849
|
-
# CONNECT DSN
|
|
1850
|
-
# ------------------------------------------------------------------
|
|
1851
|
-
mcl.add(
|
|
1852
|
-
r"^CONNECT\s+TO\s+DSN\s*\(\s*DSN\s*=\s*(?P<dsn>[A-Z0-9][A-Z0-9_\-\.]*)\s*"
|
|
1853
|
-
r"(?:\s*,\s*USER\s*=\s*(?P<user>[A-Z][A-Z0-9_@\-\.]*)\s*,\s*NEED_PWD\s*=\s*(?P<need_pwd>TRUE|FALSE))?"
|
|
1854
|
-
r"(?:\s*,\s+PASSWORD\s*=\s*(?P<password>[^\s\)]+))?"
|
|
1855
|
-
r"(?:\s*,\s*ENCODING\s*=\s*(?P<encoding>[A-Z][A-Z0-9_-]+))?\s*\)\s+AS\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$",
|
|
1856
|
-
x_connect_dsn,
|
|
1857
|
-
)
|
|
1858
|
-
|
|
1859
|
-
# ------------------------------------------------------------------
|
|
1860
|
-
# USE
|
|
1861
|
-
# ------------------------------------------------------------------
|
|
1862
|
-
mcl.add(r"^USE\s+(?P<db_alias>[A-Z][A-Z0-9_]*)\s*$", x_use, description="USE", category="action")
|
|
1863
|
-
|
|
1864
|
-
# ------------------------------------------------------------------
|
|
1865
|
-
# SYSTEM_CMD
|
|
1866
|
-
# ------------------------------------------------------------------
|
|
1867
|
-
mcl.add(
|
|
1868
|
-
r"^\s*SYSTEM_CMD\s*\(\s*(?P<command>.+)\s*\)(?:\s+(?P<continue>CONTINUE))?\s*$",
|
|
1869
|
-
x_system_cmd,
|
|
1870
|
-
description="SYSTEM_CMD",
|
|
1871
|
-
category="action",
|
|
1872
|
-
)
|
|
1873
|
-
|
|
1874
|
-
# ------------------------------------------------------------------
|
|
1875
|
-
# INCLUDE
|
|
1876
|
-
# ------------------------------------------------------------------
|
|
1877
|
-
mcl.add(
|
|
1878
|
-
ins_fn_rxs(r"^\s*INCLUDE(?P<exists>\s+IF\s+EXISTS?)?\s+", r"\s*$"),
|
|
1879
|
-
x_include,
|
|
1880
|
-
description="INCLUDE",
|
|
1881
|
-
category="action",
|
|
1882
|
-
)
|
|
1883
|
-
|
|
1884
|
-
# ------------------------------------------------------------------
|
|
1885
|
-
# IMPORT (CSV / delimited)
|
|
1886
|
-
# ------------------------------------------------------------------
|
|
1887
|
-
mcl.add(
|
|
1888
|
-
ins_table_rxs(
|
|
1889
|
-
r"^\s*IMPORT\s+TO\s+(?:(?P<new>NEW|REPLACEMENT)\s+)?",
|
|
1890
|
-
ins_fn_rxs(
|
|
1891
|
-
r"\s+FROM\s+",
|
|
1892
|
-
r'(?:\s+WITH)?(?:\s+QUOTE\s+(?P<quotechar>NONE|\'|")\s+DELIMITER\s+'
|
|
1893
|
-
r"(?P<delimchar>TAB|UNITSEP|US|,|;|\|))?(?:\s+ENCODING\s+(?P<encoding>\w+))?"
|
|
1894
|
-
r"(?:\s+SKIP\s+(?P<skip>\d+))?\s*$",
|
|
1895
|
-
),
|
|
1896
|
-
),
|
|
1897
|
-
x_import,
|
|
1898
|
-
)
|
|
1899
|
-
|
|
1900
|
-
# ------------------------------------------------------------------
|
|
1901
|
-
# RM_FILE / RM_SUB
|
|
1902
|
-
# ------------------------------------------------------------------
|
|
1903
|
-
mcl.add(
|
|
1904
|
-
(
|
|
1905
|
-
r"^RM_FILE\s+(?P<filename>.+)\s*$",
|
|
1906
|
-
r'^RM_FILE\s+"(?P<filename>.+)"\s*$',
|
|
1907
|
-
),
|
|
1908
|
-
x_rm_file,
|
|
1909
|
-
description="RM_FILE",
|
|
1910
|
-
category="action",
|
|
1911
|
-
)
|
|
1912
|
-
mcl.add(r"^\s*RM_SUB\s+(?P<match>~?\w+)\s*$", x_rm_sub, description="RM_SUB", category="action")
|
|
1913
|
-
|
|
1914
|
-
# ------------------------------------------------------------------
|
|
1915
|
-
# SELECT_SUB / SUBDATA
|
|
1916
|
-
# ------------------------------------------------------------------
|
|
1917
|
-
mcl.add(r"^\s*SELECT_SUB\s+(?P<datasource>.+)\s*$", x_selectsub, description="SELECT_SUB", category="action")
|
|
1918
|
-
mcl.add(
|
|
1919
|
-
r"^\s*SUBDATA\s+(?P<match>[+~]?\w+)\s+(?P<datasource>.+)\s*$",
|
|
1920
|
-
x_subdata,
|
|
1921
|
-
description="SUBDATA",
|
|
1922
|
-
category="action",
|
|
1923
|
-
)
|
|
1924
|
-
|
|
1925
|
-
# ------------------------------------------------------------------
|
|
1926
|
-
# PROMPT ASK (simple)
|
|
1927
|
-
# ------------------------------------------------------------------
|
|
1928
|
-
mcl.add(
|
|
1929
|
-
ins_table_rxs(
|
|
1930
|
-
r'^\s*PROMPT\s+ASK\s+"(?P<question>[^"]+)"\s+SUB\s+(?P<match>~?\w+)(?:\s+DISPLAY\s+',
|
|
1931
|
-
r')?(?:\s+HELP\s+"(?P<help>[^"]+)")?\s*$',
|
|
1932
|
-
),
|
|
1933
|
-
x_prompt_ask,
|
|
1934
|
-
description="PROMPT ASK",
|
|
1935
|
-
category="prompt",
|
|
1936
|
-
)
|
|
1937
|
-
|
|
1938
|
-
# ------------------------------------------------------------------
|
|
1939
|
-
# PROMPT DISPLAY (table viewer)
|
|
1940
|
-
# ------------------------------------------------------------------
|
|
1941
|
-
mcl.add(
|
|
1942
|
-
ins_table_rxs(
|
|
1943
|
-
r'^\s*PROMPT\s+MESSAGE\s+"(?P<message>(.|\n)*)"\s+DISPLAY\s+',
|
|
1944
|
-
r"(?:\s+HELP\s+(?P<help>[^\s]+))?(?:\s+(?P<free>FREE))?\s*$",
|
|
1945
|
-
),
|
|
1946
|
-
x_prompt,
|
|
1947
|
-
description="PROMPT DISPLAY",
|
|
1948
|
-
category="prompt",
|
|
1949
|
-
)
|
|
1950
|
-
mcl.add(
|
|
1951
|
-
ins_table_rxs(
|
|
1952
|
-
r'^\s*PROMPT\s+MESSAGE\s+"(?P<message>(.|\n)*)"\s+DISPLAY\s+',
|
|
1953
|
-
r'(?:\s+HELP\s+"(?P<help>[^"]+)")?(?:\s+(?P<free>FREE))?\s*$',
|
|
1954
|
-
),
|
|
1955
|
-
x_prompt,
|
|
1956
|
-
)
|
|
1957
|
-
mcl.add(
|
|
1958
|
-
ins_table_rxs(
|
|
1959
|
-
r"^\s*PROMPT\s+DISPLAY\s+",
|
|
1960
|
-
r'\s+MESSAGE\s+"(?P<message>(.|\n)*)"(?:\s+HELP\s+(?P<help>[^\s]+))?(?:\s+(?P<free>FREE))?\s*$',
|
|
1961
|
-
),
|
|
1962
|
-
x_prompt,
|
|
1963
|
-
)
|
|
1964
|
-
mcl.add(
|
|
1965
|
-
ins_table_rxs(
|
|
1966
|
-
r"^\s*PROMPT\s+DISPLAY\s+",
|
|
1967
|
-
r'\s+MESSAGE\s+"(?P<message>(.|\n)*)"(?:\s+HELP\s+"(?P<help>[^"]+)")?(?:\s+(?P<free>FREE))?\s*$',
|
|
1968
|
-
),
|
|
1969
|
-
x_prompt,
|
|
1970
|
-
)
|
|
1971
|
-
|
|
1972
|
-
# ------------------------------------------------------------------
|
|
1973
|
-
# PROMPT MESSAGE (simple message / MSG)
|
|
1974
|
-
# ------------------------------------------------------------------
|
|
1975
|
-
mcl.add(
|
|
1976
|
-
r'^\s*PROMPT(?:\s+MESSAGE)?\s+"(?P<message>(.|\n)*)"\s*$',
|
|
1977
|
-
x_msg,
|
|
1978
|
-
description="PROMPT MESSAGE",
|
|
1979
|
-
category="prompt",
|
|
1980
|
-
)
|
|
1981
|
-
|
|
1982
|
-
# ------------------------------------------------------------------
|
|
1983
|
-
# WRITE
|
|
1984
|
-
# ------------------------------------------------------------------
|
|
1985
|
-
mcl.add(
|
|
1986
|
-
ins_fn_rxs(
|
|
1987
|
-
r"^\s*WRITE\s+\~(?P<text>([^\~]|\n)*)\~(?:(?:\s+(?P<tee>TEE))?\s+TO\s+",
|
|
1988
|
-
r")?\s*$",
|
|
1989
|
-
),
|
|
1990
|
-
x_write,
|
|
1991
|
-
description="WRITE",
|
|
1992
|
-
category="action",
|
|
1993
|
-
)
|
|
1994
|
-
mcl.add(
|
|
1995
|
-
ins_fn_rxs(
|
|
1996
|
-
r"^\s*WRITE\s+\#(?P<text>([^\#]|\n)*)\#(?:(?:\s+(?P<tee>TEE))?\s+TO\s+",
|
|
1997
|
-
r")?\s*$",
|
|
1998
|
-
),
|
|
1999
|
-
x_write,
|
|
2000
|
-
)
|
|
2001
|
-
mcl.add(
|
|
2002
|
-
ins_fn_rxs(
|
|
2003
|
-
r"^\s*WRITE\s+\`(?P<text>([^\`]|\n)*)\`(?:(?:\s+(?P<tee>TEE))?\s+TO\s+",
|
|
2004
|
-
r")?\s*$",
|
|
2005
|
-
),
|
|
2006
|
-
x_write,
|
|
2007
|
-
)
|
|
2008
|
-
mcl.add(
|
|
2009
|
-
ins_fn_rxs(
|
|
2010
|
-
r"^\s*WRITE\s+\[(?P<text>([^\]]|\n)*)\](?:(?:\s+(?P<tee>TEE))?\s+TO\s+",
|
|
2011
|
-
r")?\s*$",
|
|
2012
|
-
),
|
|
2013
|
-
x_write,
|
|
2014
|
-
)
|
|
2015
|
-
mcl.add(
|
|
2016
|
-
ins_fn_rxs(
|
|
2017
|
-
r"^\s*WRITE\s+\'(?P<text>([^\']|\n)*)\'(?:(?:\s+(?P<tee>TEE))?\s+TO\s+",
|
|
2018
|
-
r")?\s*$",
|
|
2019
|
-
),
|
|
2020
|
-
x_write,
|
|
2021
|
-
)
|
|
2022
|
-
mcl.add(
|
|
2023
|
-
ins_fn_rxs(
|
|
2024
|
-
r'^\s*WRITE\s+"(?P<text>([^"]|\n)*)"(?:(?:\s+(?P<tee>TEE))?\s+TO\s+',
|
|
2025
|
-
r")?\s*$",
|
|
2026
|
-
),
|
|
2027
|
-
x_write,
|
|
2028
|
-
)
|
|
2029
|
-
|
|
2030
|
-
# ------------------------------------------------------------------
|
|
2031
|
-
# SUB (top-level variable assignment — kept near end so more specific
|
|
2032
|
-
# SUB_* patterns above take precedence)
|
|
2033
|
-
# ------------------------------------------------------------------
|
|
2034
|
-
mcl.add(
|
|
2035
|
-
r"^\s*SUB\s+(?P<match>[+~]?\w+)\s+(?P<repl>.+)$",
|
|
2036
|
-
x_sub,
|
|
2037
|
-
description="SUB",
|
|
2038
|
-
category="action",
|
|
2039
|
-
)
|
|
2040
|
-
|
|
2041
|
-
return mcl
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
251
|
# ---------------------------------------------------------------------------
|
|
2045
252
|
# Module-level DISPATCH_TABLE — built once at import time.
|
|
2046
253
|
# ---------------------------------------------------------------------------
|
|
254
|
+
from execsql.metacommands.dispatch import build_dispatch_table # noqa: E402
|
|
255
|
+
|
|
2047
256
|
DISPATCH_TABLE = build_dispatch_table()
|