pqb 0.18.22 → 0.18.23

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
@@ -6011,76 +6011,18 @@ const maybeUnNameColumn = (column, isSubQuery) => {
6011
6011
  return isSubQuery && column.data.name ? setColumnData(column, "name", void 0) : column;
6012
6012
  };
6013
6013
  class Select {
6014
- /**
6015
- * Takes a list of columns to be selected, and by default, the query builder will select all columns of the table.
6016
- *
6017
- * Pass an object to select columns with aliases. Keys of the object are column aliases, value can be a column name, sub-query, or raw expression.
6018
- *
6019
- * ```ts
6020
- * // select columns of the table:
6021
- * db.table.select('id', 'name', { idAlias: 'id' });
6022
- *
6023
- * // accepts columns with table names:
6024
- * db.table.select('user.id', 'user.name', { nameAlias: 'user.name' });
6025
- *
6026
- * // table name may refer to the current table or a joined table:
6027
- * db.table
6028
- * .join(Message, 'authorId', 'id')
6029
- * .select('user.name', 'message.text', { textAlias: 'message.text' });
6030
- *
6031
- * // select value from the sub-query,
6032
- * // this sub-query should return a single record and a single column:
6033
- * db.table.select({
6034
- * subQueryResult: Otherdb.table.select('column').take(),
6035
- * });
6036
- *
6037
- * // select raw SQL value, the first argument of `raw` is a column type, it is used for return type of the query
6038
- * db.table.select({
6039
- * raw: db.table.sql((t) => t.integer())`1 + 2`,
6040
- * });
6041
- *
6042
- * // same raw SQL query as above, but raw value is returned from a callback
6043
- * db.table.select({
6044
- * raw: (q) => q.sql((t) => t.integer())`1 + 2`,
6045
- * });
6046
- * ```
6047
- *
6048
- * When you use the ORM and defined relations, `select` can also accept callbacks with related table queries:
6049
- *
6050
- * ```ts
6051
- * await db.author.select({
6052
- * allBooks: (q) => q.books,
6053
- * firstBook: (q) => q.books.order({ createdAt: 'ASC' }).take(),
6054
- * booksCount: (q) => q.books.count(),
6055
- * });
6056
- * ```
6057
- *
6058
- * When you're selecting a relation that's connected via `belongsTo` or `hasOne`, it becomes available to use in `order` or in `where`:
6059
- *
6060
- * ```ts
6061
- * // select books with their authors included, order by author name and filter by author column:
6062
- * await db.books
6063
- * .select({
6064
- * author: (q) => q.author,
6065
- * })
6066
- * .order('author.name')
6067
- * .where({ 'author.isPopular': true });
6068
- * ```
6069
- */
6014
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6070
6015
  select(...args) {
6071
6016
  return this.clone()._select(...args);
6072
6017
  }
6018
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6073
6019
  _select(...args) {
6074
6020
  if (!args.length) {
6075
6021
  return this;
6076
6022
  }
6077
6023
  const as = this.q.as || this.table;
6078
6024
  const selectArgs = args.map((item) => processSelectArg(this, as, item));
6079
- return pushQueryArray(
6080
- this,
6081
- "select",
6082
- selectArgs
6083
- );
6025
+ return pushQueryArray(this, "select", selectArgs);
6084
6026
  }
6085
6027
  /**
6086
6028
  * When querying the table or creating records, all columns are selected by default,