Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cli/api/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
10 changes: 4 additions & 6 deletions api/dbadapters/postgres.ts → cli/api/dbadapters/postgres.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
8 changes: 7 additions & 1 deletion cli/api/utils/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion api/utils/postgres.ts → cli/api/utils/postgres.ts
Original file line number Diff line number Diff line change
@@ -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 = (() => {
Expand Down