pqb 0.1.9 → 0.2.0
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.
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +6 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/db.ts +1 -1
- package/src/queryMethods/queryMethods.test.ts +0 -5
- package/src/queryMethods/queryMethods.ts +6 -18
- package/src/queryMethods/where.test.ts +68 -58
- package/src/queryMethods/where.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -153,7 +153,7 @@ declare type WhereInValues<T extends QueryBase, Column extends WhereInColumn<T>>
|
|
|
153
153
|
length: number;
|
|
154
154
|
} ? Column['length'] : never;
|
|
155
155
|
})[] | Query | RawExpression;
|
|
156
|
-
declare type WhereResult<T extends QueryBase> =
|
|
156
|
+
declare type WhereResult<T extends QueryBase> = T & {
|
|
157
157
|
hasWhere: true;
|
|
158
158
|
};
|
|
159
159
|
declare type WhereInArg<T extends Pick<Query, 'selectable'>> = {
|
|
@@ -1185,7 +1185,7 @@ interface Db<Table extends string | undefined = undefined, Shape extends Columns
|
|
|
1185
1185
|
columnsParsers?: ColumnsParsers;
|
|
1186
1186
|
result: Pick<Shape, DefaultSelectColumns<Shape>[number]>;
|
|
1187
1187
|
hasSelect: false;
|
|
1188
|
-
hasWhere:
|
|
1188
|
+
hasWhere: boolean;
|
|
1189
1189
|
selectable: {
|
|
1190
1190
|
[K in keyof Shape]: {
|
|
1191
1191
|
as: K;
|
package/dist/index.esm.js
CHANGED
|
@@ -5098,7 +5098,7 @@ class QueryUpsert {
|
|
|
5098
5098
|
|
|
5099
5099
|
class QueryMethods {
|
|
5100
5100
|
all() {
|
|
5101
|
-
return this.
|
|
5101
|
+
return this.clone()._all();
|
|
5102
5102
|
}
|
|
5103
5103
|
_all() {
|
|
5104
5104
|
this.query.returnType = "all";
|
|
@@ -5106,7 +5106,7 @@ class QueryMethods {
|
|
|
5106
5106
|
return this;
|
|
5107
5107
|
}
|
|
5108
5108
|
take() {
|
|
5109
|
-
return this.
|
|
5109
|
+
return this.clone()._take();
|
|
5110
5110
|
}
|
|
5111
5111
|
_take() {
|
|
5112
5112
|
this.query.returnType = "oneOrThrow";
|
|
@@ -5114,7 +5114,7 @@ class QueryMethods {
|
|
|
5114
5114
|
return this;
|
|
5115
5115
|
}
|
|
5116
5116
|
takeOptional() {
|
|
5117
|
-
return this.
|
|
5117
|
+
return this.clone()._takeOptional();
|
|
5118
5118
|
}
|
|
5119
5119
|
_takeOptional() {
|
|
5120
5120
|
this.query.returnType = "one";
|
|
@@ -5122,7 +5122,7 @@ class QueryMethods {
|
|
|
5122
5122
|
return this;
|
|
5123
5123
|
}
|
|
5124
5124
|
rows() {
|
|
5125
|
-
return this.
|
|
5125
|
+
return this.clone()._rows();
|
|
5126
5126
|
}
|
|
5127
5127
|
_rows() {
|
|
5128
5128
|
this.query.returnType = "rows";
|
|
@@ -5130,7 +5130,7 @@ class QueryMethods {
|
|
|
5130
5130
|
return this;
|
|
5131
5131
|
}
|
|
5132
5132
|
pluck(select) {
|
|
5133
|
-
return this.
|
|
5133
|
+
return this.clone()._pluck(select);
|
|
5134
5134
|
}
|
|
5135
5135
|
_pluck(select) {
|
|
5136
5136
|
this.query.returnType = "pluck";
|
|
@@ -5140,7 +5140,7 @@ class QueryMethods {
|
|
|
5140
5140
|
return this;
|
|
5141
5141
|
}
|
|
5142
5142
|
exec() {
|
|
5143
|
-
return this.
|
|
5143
|
+
return this.clone()._exec();
|
|
5144
5144
|
}
|
|
5145
5145
|
_exec() {
|
|
5146
5146
|
this.query.returnType = "void";
|