Line data Source code
1 1 : export const HYPERDB_WASM_ENGINE_SETTINGS = Object.freeze({
2 1 : default_database_version: 4,
3 1 : identifier_resolution: 'case_insensitive',
4 1 : experimental_view_creation: true,
5 1 : experimental_persisted_view_creation: true,
6 1 : experimental_hyper_introspection_functions: true,
7 1 : experimental_data_type_persistence: true,
8 1 : experimental_multidimensional_arrays: true,
9 1 : experimental_external_http_location: true,
10 1 : experimental_external_metaquery: true,
11 1 : experimental_persisted_external_tables: true,
12 1 : enable_raw_sql: true,
13 1 : raw_sql_format_table_scan: true,
14 1 : enable_row_types: true,
15 1 : http_location_allowlist: ['*'],
16 1 : log_json_export: false,
17 1 : log_file_size_limit: '1M',
18 1 : log_file_max_count: 10,
19 : // Log the process memory and the load every second, also without load, for the live connection overview.
20 : // An event has about 3KB, the log files then rotate about every 5 minutes.
21 1 : log_resource_usage_interval: '1s',
22 1 : log_resource_usage_always: 1,
23 1 : });
24 :
25 : /// The setting that runs the queries on the experimental execution backend of the wasm module.
26 : /// Builds of hyperdb-wasm without the backend reject it, see isUnknownHyperDBSettingError().
27 1 : export const EXPERIMENTAL_WASM_BACKEND_SETTING = 'experimental_wasm_backend';
28 :
29 : /// Did the engine reject a startup setting that it does not know?
30 : /// The engine names the setting in the detail of the error, the test clients put the whole error into the message.
31 1 : export function isUnknownHyperDBSettingError(error: unknown, setting: string): boolean {
32 1 : const message = error instanceof Error ? error.message : String(error);
33 1 : const detail = error instanceof Error && 'detail' in error ? String(error.detail) : '';
34 1 : const unknown = `No internal setting named '${setting}'`;
35 1 : return message.includes(unknown) || detail.includes(unknown);
36 1 : }
|