pqb 0.40.2 → 0.40.4

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.mjs CHANGED
@@ -6381,7 +6381,9 @@ const makeColumnsByType = (schema) => {
6381
6381
  jsonb: schema.json,
6382
6382
  smallserial: t.smallSerial,
6383
6383
  serial: t.serial,
6384
- bigserial: t.bigSerial
6384
+ bigserial: t.bigSerial,
6385
+ // requires citext extension
6386
+ citext: t.citext
6385
6387
  };
6386
6388
  };
6387
6389
 
@@ -11157,7 +11159,7 @@ class QueryUpsertOrCreate {
11157
11159
  *
11158
11160
  * ```ts
11159
11161
  * await User.selectAll()
11160
- * .find({ email: 'some@email.com' })
11162
+ * .findBy({ email: 'some@email.com' })
11161
11163
  * .upsert({
11162
11164
  * data: {
11163
11165
  * // update record's name
@@ -11171,7 +11173,7 @@ class QueryUpsertOrCreate {
11171
11173
  *
11172
11174
  * // the same as above but using `update` and `create`
11173
11175
  * await User.selectAll()
11174
- * .find({ email: 'some@email.com' })
11176
+ * .findBy({ email: 'some@email.com' })
11175
11177
  * .upsert({
11176
11178
  * update: {
11177
11179
  * name: 'updated user',
@@ -11188,7 +11190,7 @@ class QueryUpsertOrCreate {
11188
11190
  *
11189
11191
  * ```ts
11190
11192
  * await User.selectAll()
11191
- * .find({ email: 'some@email.com' })
11193
+ * .findBy({ email: 'some@email.com' })
11192
11194
  * .upsert({
11193
11195
  * update: {
11194
11196
  * name: 'updated user',
@@ -11201,7 +11203,7 @@ class QueryUpsertOrCreate {
11201
11203
  *
11202
11204
  * // the same as above using `data`
11203
11205
  * await User.selectAll()
11204
- * .find({ email: 'some@email.com' })
11206
+ * .findBy({ email: 'some@email.com' })
11205
11207
  * .upsert({
11206
11208
  * data: {
11207
11209
  * name: 'updated user',
@@ -11218,7 +11220,7 @@ class QueryUpsertOrCreate {
11218
11220
  *
11219
11221
  * ```ts
11220
11222
  * const user = await User.selectAll()
11221
- * .find({ email: 'some@email.com' })
11223
+ * .findBy({ email: 'some@email.com' })
11222
11224
  * .upsert({
11223
11225
  * data: {
11224
11226
  * name: 'updated user',
@@ -11258,17 +11260,19 @@ class QueryUpsertOrCreate {
11258
11260
  * By default, it is not returning columns, place `get`, `select`, or `selectAll` before `orCreate` to specify returning columns.
11259
11261
  *
11260
11262
  * ```ts
11261
- * const user = await User.selectAll().find({ email: 'some@email.com' }).orCreate({
11262
- * email: 'some@email.com',
11263
- * name: 'created user',
11264
- * });
11263
+ * const user = await User.selectAll()
11264
+ * .findBy({ email: 'some@email.com' })
11265
+ * .orCreate({
11266
+ * email: 'some@email.com',
11267
+ * name: 'created user',
11268
+ * });
11265
11269
  * ```
11266
11270
  *
11267
11271
  * The data may be returned from a function, it won't be called if the record was found:
11268
11272
  *
11269
11273
  * ```ts
11270
11274
  * const user = await User.selectAll()
11271
- * .find({ email: 'some@email.com' })
11275
+ * .findBy({ email: 'some@email.com' })
11272
11276
  * .orCreate(() => ({
11273
11277
  * email: 'some@email.com',
11274
11278
  * name: 'created user',
@@ -11369,11 +11373,11 @@ class QueryMap {
11369
11373
  /**
11370
11374
  * Use `map` to transform individual records of a query result.
11371
11375
  *
11372
- * It accepts a single record and should return a single transformed record.
11376
+ * Use `map` to transform individual records of a query result. If the query returns multiple, `map` function going to transform records one by one.
11373
11377
  *
11374
- * For transforming the whole result of a query, consider using [transform](#transform) instead.
11378
+ * For an optional query result (`findOptional`, `getOptional`, etc.), `map` is **not** called for empty results.
11375
11379
  *
11376
- * The [hooks](/guide/hooks) that are going to run after the query will receive the query result **before** transformation.
11380
+ * For transforming the result of a query as a whole, consider using {@link Query.transform} instead.
11377
11381
  *
11378
11382
  * ```ts
11379
11383
  * // add a `titleLength` to every post