diff --git a/.github/workflows/tests-linux.yml b/.github/workflows/tests-linux.yml index 3f3b25580..a3594a156 100644 --- a/.github/workflows/tests-linux.yml +++ b/.github/workflows/tests-linux.yml @@ -300,6 +300,7 @@ jobs: - run: npm ci - run: cat ormconfig.sample.json | jq 'map(select(.name == "oracle"))' > ormconfig.json - run: docker compose up oracle --no-recreate --wait + - run: sleep 10 - run: npx c8 npm run test:ci - name: Coveralls Parallel diff --git a/.pr_agent.toml b/.pr_agent.toml new file mode 100644 index 000000000..18da7712d --- /dev/null +++ b/.pr_agent.toml @@ -0,0 +1,14 @@ +[github_app] +pr_commands = [ + "/review", + "/improve", +] + +handle_push_trigger = true +push_commands = [ + "/improve", +] + +[auto_best_practices] +enable_auto_best_practices = true +utilize_auto_best_practices = true \ No newline at end of file diff --git a/src/driver/postgres/PostgresDriver.ts b/src/driver/postgres/PostgresDriver.ts index 149be5695..81e7f63bd 100644 --- a/src/driver/postgres/PostgresDriver.ts +++ b/src/driver/postgres/PostgresDriver.ts @@ -73,7 +73,8 @@ export class PostgresDriver implements Driver { options: PostgresConnectionOptions /** - * Version of Postgres. Requires a SQL query to the DB, so it is not always set + * Version of Postgres. Requires a SQL query to the DB, so it is set on the first + * connection attempt. */ version?: string @@ -362,20 +363,24 @@ export class PostgresDriver implements Driver { this.master = await this.createPool(this.options, this.options) } - const queryRunner = this.createQueryRunner("master") + if (!this.version || !this.database || !this.searchSchema) { + const queryRunner = this.createQueryRunner("master") - this.version = await queryRunner.getVersion() + if (!this.version) { + this.version = await queryRunner.getVersion() + } - if (!this.database) { - this.database = await queryRunner.getCurrentDatabase() + if (!this.database) { + this.database = await queryRunner.getCurrentDatabase() + } + + if (!this.searchSchema) { + this.searchSchema = await queryRunner.getCurrentSchema() + } + + await queryRunner.release() } - if (!this.searchSchema) { - this.searchSchema = await queryRunner.getCurrentSchema() - } - - await queryRunner.release() - if (!this.schema) { this.schema = this.searchSchema } diff --git a/src/index.ts b/src/index.ts index d082c0c0d..1eeaf9f6e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -160,6 +160,10 @@ export { WhereExpression } from "./query-builder/WhereExpressionBuilder" export { InsertResult } from "./query-builder/result/InsertResult" export { UpdateResult } from "./query-builder/result/UpdateResult" export { DeleteResult } from "./query-builder/result/DeleteResult" +export { + QueryPartialEntity, + QueryDeepPartialEntity, +} from "./query-builder/QueryPartialEntity" export { QueryResult } from "./query-runner/QueryResult" export { QueryRunner } from "./query-runner/QueryRunner" export { MongoEntityManager } from "./entity-manager/MongoEntityManager"