metal-orm 1.0.97 → 1.0.98

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.cjs CHANGED
@@ -7583,6 +7583,24 @@ var SelectQueryBuilder = class _SelectQueryBuilder {
7583
7583
  const builder = this.ensureDefaultSelection();
7584
7584
  return executePagedQuery(builder, session, options, (sess) => builder.count(sess));
7585
7585
  }
7586
+ /**
7587
+ * Executes the query and returns an array of values for a single column.
7588
+ * This is a convenience method to avoid manual `.map(r => r.column)`.
7589
+ *
7590
+ * @param column - The column name to extract
7591
+ * @param ctx - ORM session context
7592
+ * @returns Promise of an array containing only the values of the specified column
7593
+ * @example
7594
+ * const acronyms = await selectFromEntity(Organization)
7595
+ * .select('acronym')
7596
+ * .distinct(O.acronym)
7597
+ * .pluck('acronym', session);
7598
+ * // ['NASA', 'UN', 'WHO']
7599
+ */
7600
+ async pluck(column, ctx) {
7601
+ const rows = await this.executePlain(ctx);
7602
+ return rows.map((r) => r[column]);
7603
+ }
7586
7604
  /**
7587
7605
  * Executes the query with provided execution and hydration contexts
7588
7606
  * @param execCtx - Execution context