objection 2.2.2 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,6 +6,7 @@ class InternalOptions {
|
|
|
6
6
|
this.keepImplicitJoinProps = false;
|
|
7
7
|
this.isInternalQuery = false;
|
|
8
8
|
this.debug = false;
|
|
9
|
+
this.schema = undefined;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
clone() {
|
|
@@ -15,6 +16,7 @@ class InternalOptions {
|
|
|
15
16
|
copy.keepImplicitJoinProps = this.keepImplicitJoinProps;
|
|
16
17
|
copy.isInternalQuery = this.isInternalQuery;
|
|
17
18
|
copy.debug = this.debug;
|
|
19
|
+
copy.schema = this.schema;
|
|
18
20
|
|
|
19
21
|
return copy;
|
|
20
22
|
}
|
|
@@ -844,8 +844,11 @@ class QueryBuilder extends QueryBuilderBase {
|
|
|
844
844
|
const knex = this.knex();
|
|
845
845
|
const tableParts = table.split('.');
|
|
846
846
|
const columnInfoQuery = knex(last(tableParts)).columnInfo();
|
|
847
|
+
const schema = this.internalOptions().schema;
|
|
847
848
|
|
|
848
|
-
if (
|
|
849
|
+
if (schema) {
|
|
850
|
+
columnInfoQuery.withSchema(schema);
|
|
851
|
+
} else if (tableParts.length > 1) {
|
|
849
852
|
columnInfoQuery.withSchema(tableParts[0]);
|
|
850
853
|
}
|
|
851
854
|
|
|
@@ -857,6 +860,7 @@ class QueryBuilder extends QueryBuilderBase {
|
|
|
857
860
|
}
|
|
858
861
|
|
|
859
862
|
withSchema(schema) {
|
|
863
|
+
this.internalOptions().schema = schema;
|
|
860
864
|
this.internalContext().onBuild.push(builder => {
|
|
861
865
|
if (!builder.has(/withSchema/)) {
|
|
862
866
|
// Need to push this operation to the front because knex doesn't use the
|