Skip to content

Commit

Permalink
Refactor platform specific connections (#503)
Browse files Browse the repository at this point in the history
* Refact platform specific connections

* Fix path
  • Loading branch information
whscullin committed Aug 28, 2024
1 parent 28aedb1 commit e348121
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 70 deletions.
111 changes: 68 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -588,15 +588,15 @@
},
"dependencies": {
"@lit-labs/observers": "^2.0.2",
"@malloydata/db-bigquery": "0.0.169",
"@malloydata/db-duckdb": "0.0.169",
"@malloydata/db-postgres": "0.0.169",
"@malloydata/db-snowflake": "0.0.169",
"@malloydata/db-trino": "0.0.169",
"@malloydata/malloy": "0.0.169",
"@malloydata/malloy-sql": "0.0.169",
"@malloydata/render": "0.0.169",
"@malloydata/syntax-highlight": "0.0.169",
"@malloydata/db-bigquery": "0.0.176",
"@malloydata/db-duckdb": "0.0.176",
"@malloydata/db-postgres": "0.0.176",
"@malloydata/db-snowflake": "0.0.176",
"@malloydata/db-trino": "0.0.176",
"@malloydata/malloy": "0.0.176",
"@malloydata/malloy-sql": "0.0.176",
"@malloydata/render": "0.0.176",
"@malloydata/syntax-highlight": "0.0.176",
"@vscode/webview-ui-toolkit": "^1.2.1",
"duckdb": "1.0.0",
"lit": "^3.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/server/connections/browser/connection_factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
ConnectionBackend,
ConnectionConfig,
} from '../../../common/types/connection_manager_types';
import {createDuckDbWasmConnection} from '../duckdb_wasm_connection';
import {createDuckDbWasmConnection} from './duckdb_wasm_connection';
import {DuckDBWASMConnection} from '@malloydata/db-duckdb/wasm';
import {GenericConnection} from '../../../common/types/worker_message_types';
import {errorMessage} from '../../../common/errors';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import {DuckDBWASMConnection} from '@malloydata/db-duckdb/wasm';
import {
ConfigOptions,
DuckDBConnectionConfig,
} from '../../common/types/connection_manager_types';
import {GenericConnection} from '../../common/types/worker_message_types';
} from '../../../common/types/connection_manager_types';
import {GenericConnection} from '../../../common/types/worker_message_types';

export const createDuckDbWasmConnection = async (
client: GenericConnection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import {BigQueryConnection} from '@malloydata/db-bigquery';
import {
ConfigOptions,
BigQueryConnectionConfig,
} from '../../common/types/connection_manager_types';
import {convertToBytes} from '../../common/convert_to_bytes';
} from '../../../common/types/connection_manager_types';
import {convertToBytes} from '../../../common/convert_to_bytes';

export const createBigQueryConnection = async (
connectionConfig: BigQueryConnectionConfig,
Expand Down
12 changes: 6 additions & 6 deletions src/server/connections/node/connection_factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ import {
ConnectionBackend,
ConnectionConfig,
} from '../../../common/types/connection_manager_types';
import {createBigQueryConnection} from '../bigquery_connection';
import {createDuckDbConnection} from '../duckdb_connection';
import {createPostgresConnection} from '../postgres_connection';
import {createSnowflakeConnection} from '../snowflake_connection';
import {createTrinoConnection} from '../trino_connection';
import {createBigQueryConnection} from './bigquery_connection';
import {createDuckDbConnection} from './duckdb_connection';
import {createPostgresConnection} from './postgres_connection';
import {createSnowflakeConnection} from './snowflake_connection';
import {createTrinoConnection} from './trino_connection';

import {fileURLToPath} from 'url';
import {GenericConnection} from '../../../common/types/worker_message_types';
import {TrinoExecutor} from '@malloydata/db-trino';
import {createPrestoConnection} from '../presto_connection';
import {createPrestoConnection} from './presto_connection';

export class NodeConnectionFactory implements ConnectionFactory {
connectionCache: Record<string, TestableConnection> = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import {DuckDBConnection} from '@malloydata/db-duckdb';
import {
ConfigOptions,
DuckDBConnectionConfig,
} from '../../common/types/connection_manager_types';
import {isDuckDBAvailable} from '../../common/duckdb_availability';
import {GenericConnection} from '../../common/types/worker_message_types';
} from '../../../common/types/connection_manager_types';
import {isDuckDBAvailable} from '../../../common/duckdb_availability';
import {GenericConnection} from '../../../common/types/worker_message_types';

export const createDuckDbConnection = async (
client: GenericConnection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import {PostgresConnection} from '@malloydata/db-postgres';
import {
PostgresConnectionConfig,
ConfigOptions,
} from '../../common/types/connection_manager_types';
import {GenericConnection} from '../../common/types/worker_message_types';
} from '../../../common/types/connection_manager_types';
import {GenericConnection} from '../../../common/types/worker_message_types';

export const createPostgresConnection = async (
client: GenericConnection,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import {SnowflakeConnection} from '@malloydata/db-snowflake';
import {
ConfigOptions,
SnowflakeConnectionConfig,
} from '../../common/types/connection_manager_types';
import {GenericConnection} from '../../common/types/worker_message_types';
} from '../../../common/types/connection_manager_types';
import {GenericConnection} from '../../../common/types/worker_message_types';

export const createSnowflakeConnection = async (
client: GenericConnection,
Expand Down
File renamed without changes.

0 comments on commit e348121

Please sign in to comment.