diff --git a/cli/api/BUILD b/cli/api/BUILD index ce1504de..91d1c969 100644 --- a/cli/api/BUILD +++ b/cli/api/BUILD @@ -11,6 +11,11 @@ ts_library( exclude = [ "utils/**/*.*", "**/*_test.ts", + # Postgres adapter — relocated from api/ in Phase 2. + # Excluded until Phase 3 (interface alignment + proto IJDBC → + # PostgresConnection rewrite) makes it compile against the + # current IDbAdapter contract. + "dbadapters/postgres.ts", ], ), deps = [ diff --git a/api/dbadapters/postgres.ts b/cli/api/dbadapters/postgres.ts similarity index 95% rename from api/dbadapters/postgres.ts rename to cli/api/dbadapters/postgres.ts index 541f005e..975b248a 100644 --- a/api/dbadapters/postgres.ts +++ b/cli/api/dbadapters/postgres.ts @@ -1,12 +1,10 @@ import * as pg from "pg"; -import { Credentials } from "sa/api/commands/credentials"; -import { IDbAdapter, IDbClient } from "sa/api/dbadapters/index"; -import { SSHTunnelProxy } from "sa/api/ssh_tunnel_proxy"; -import { parseRedshiftEvalError } from "sa/api/utils/error_parsing"; -import { convertFieldType, PgPoolExecutor } from "sa/api/utils/postgres"; +import { Credentials } from "sa/cli/api/commands/credentials"; +import { IDbAdapter, IDbClient } from "sa/cli/api/dbadapters/index"; +import { collectEvaluationQueries, QueryOrAction } from "sa/cli/api/dbadapters/execution_sql"; +import { convertFieldType, PgPoolExecutor } from "sa/cli/api/utils/postgres"; import { ErrorWithCause } from "sa/common/errors/errors"; -import { collectEvaluationQueries, QueryOrAction } from "sa/core/adapters"; import { sqlanvil } from "sa/protos/ts"; interface IPostgresAdapterOptions { diff --git a/cli/api/utils/BUILD b/cli/api/utils/BUILD index 42393bcd..8f68d608 100644 --- a/cli/api/utils/BUILD +++ b/cli/api/utils/BUILD @@ -4,7 +4,13 @@ load("//tools:ts_library.bzl", "ts_library") ts_library( name = "utils", - srcs = glob(["**/*.ts"]), + srcs = glob( + ["**/*.ts"], + # Postgres helper — relocated from api/utils/ in Phase 2. + # Excluded until Phase 3 wires it through cli/api's BUILD with + # the right pg/pg-query-stream deps and an updated import surface. + exclude = ["postgres.ts"], + ), deps = [ "//common/protos", "//common/strings", diff --git a/api/utils/postgres.ts b/cli/api/utils/postgres.ts similarity index 98% rename from api/utils/postgres.ts rename to cli/api/utils/postgres.ts index 79755e24..8d05ffe1 100644 --- a/api/utils/postgres.ts +++ b/cli/api/utils/postgres.ts @@ -1,7 +1,7 @@ import * as pg from "pg"; import QueryStream from "pg-query-stream"; -import { LimitedResultSet } from "sa/api/utils/results"; +import { LimitedResultSet } from "sa/cli/api/utils/results"; import { sqlanvil } from "sa/protos/ts"; const maybeInitializePg = (() => {