Skip to content

Commit e6e3435

Browse files
committed
fix: build errors
1 parent 2aa1206 commit e6e3435

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/remote/remote-controller.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test("controller syncs correctly", async () => {
4343
expect(syncResult.status).toEqual(200);
4444

4545
const pool = new Pool({
46-
connectionString: target.withDatabaseName(Remote.optimizingDbName).toString(),
46+
connectionString: target.withDatabaseName(Remote.defaultOptimizingDbPrefix).toString(),
4747
});
4848
const tablesAfter =
4949
await pool.query("select tablename from pg_tables where schemaname = 'public'");
@@ -95,7 +95,7 @@ test("creating an index via endpoint adds it to the optimizing db", async () =>
9595
expect(syncResult.status).toEqual(200);
9696

9797
const pool = new Pool({
98-
connectionString: target.withDatabaseName(Remote.optimizingDbName).toString(),
98+
connectionString: target.withDatabaseName(Remote.defaultOptimizingDbPrefix).toString(),
9999
});
100100

101101
// Verify no indexes exist initially

src/remote/remote.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ test("syncs correctly", async () => {
9494
expect(indexNames).toEqual(expect.arrayContaining(["testing_1234"]));
9595

9696
const pool = new Pool({
97-
connectionString: target.withDatabaseName(Remote.optimizingDbName).toString(),
97+
connectionString: target.withDatabaseName(Remote.defaultOptimizingDbPrefix).toString(),
9898
});
9999

100100
const indexesAfter =

src/remote/remote.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ type RemoteEvents = {
3636
export class Remote extends EventEmitter<RemoteEvents> {
3737
static readonly baseDbName = PgIdentifier.fromString("postgres");
3838
private static readonly optimizingDbPrefix = "optimizing_db";
39+
static defaultOptimizingDbPrefix = PgIdentifier.fromString(`${Remote.optimizingDbPrefix}_0`)
40+
3941
/* Threshold that we determine is "too few rows" for Postgres to start using indexes
4042
* and not defaulting to table scan.
4143
*/
@@ -74,7 +76,7 @@ export class Remote extends EventEmitter<RemoteEvents> {
7476
super();
7577
this.baseDbURL = targetURL.withDatabaseName(Remote.baseDbName);
7678
this.optimizingDbUDRL = targetURL.withDatabaseName(
77-
PgIdentifier.fromString(`${Remote.optimizingDbPrefix}_0`),
79+
Remote.defaultOptimizingDbPrefix,
7880
);
7981
this.optimizer = new QueryOptimizer(manager, this.optimizingDbUDRL);
8082
}

0 commit comments

Comments
 (0)