MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / tokenize_options

Function tokenize_options

web/pgadmin/browser/server_groups/servers/utils.py:174–194  ·  view source on GitHub ↗

This function will tokenize the string stored in database e.g. database store the value as below key1=value1, key2=value2, key3=value3, .... This function will extract key and value from above string Args: options_from_db: Options from database option_name: Opti

(options_from_db, option_name, option_value)

Source from the content-addressed store, hash-verified

172
173
174def tokenize_options(options_from_db, option_name, option_value):
175 """
176 This function will tokenize the string stored in database
177 e.g. database store the value as below
178 key1=value1, key2=value2, key3=value3, ....
179 This function will extract key and value from above string
180
181 Args:
182 options_from_db: Options from database
183 option_name: Option Name
184 option_value: Option Value
185
186 Returns:
187 Tokenized options
188 """
189 options = []
190 if options_from_db is not None:
191 for fdw_option in options_from_db:
192 k, v = fdw_option.split('=', 1)
193 options.append({option_name: k, option_value: v})
194 return options
195
196
197def validate_options(options, option_name, option_value):

Callers 10

listMethod · 0.90
_fetch_propertiesMethod · 0.90
get_sqlMethod · 0.90
sqlMethod · 0.90
_fetch_propertiesMethod · 0.90
get_sqlMethod · 0.90
sqlMethod · 0.90
_fetch_propertiesMethod · 0.90
get_sqlMethod · 0.90
sqlMethod · 0.90

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected