@atscript/db-postgres 0.1.129 → 0.1.130

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
@@ -1,5 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let _atscript_db = require("@atscript/db");
3
+ let _atscript_db_agg = require("@atscript/db/agg");
3
4
  let _atscript_db_sql_tools = require("@atscript/db-sql-tools");
4
5
  //#region src/sql-builder.ts
5
6
  /**
@@ -603,7 +604,8 @@ var PostgresAdapter = class PostgresAdapter extends _atscript_db.BaseDbAdapter {
603
604
  return parseCount((await this._exec().get(sql, params))?.cnt);
604
605
  }
605
606
  async aggregate(query) {
606
- const where = buildWhere(query.filter);
607
+ const search = (0, _atscript_db_agg.resolveAggregateSearch)(query.controls);
608
+ const where = search ? this._buildSearchWhere(search.text, query, search.indexName) : buildWhere(query.filter);
607
609
  const tableName = this.resolveTableName();
608
610
  if (query.controls.$count) {
609
611
  const { sql, params } = buildAggregateCount(tableName, where, query.controls);
package/dist/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { BaseDbAdapter, DbError, DbSpace } from "@atscript/db";
2
+ import { resolveAggregateSearch } from "@atscript/db/agg";
2
3
  import { buildAggregateCount, buildAggregateSelect, buildCreateView, buildDelete, buildGeoSearchCount, buildGeoSearchSelect, buildInsert, buildSelect, buildUpdate, buildWhere as buildWhere$1, defaultValueForType, defaultValueToSqlLiteral, fillReplacePayload, finalizeParams, geoWindowFromControls, normalizeGeoPointValue, parseRegexString, refActionToSql, renameGeoDistance, replaceColumnsFor } from "@atscript/db-sql-tools";
3
4
  //#region src/sql-builder.ts
4
5
  /**
@@ -602,7 +603,8 @@ var PostgresAdapter = class PostgresAdapter extends BaseDbAdapter {
602
603
  return parseCount((await this._exec().get(sql, params))?.cnt);
603
604
  }
604
605
  async aggregate(query) {
605
- const where = buildWhere(query.filter);
606
+ const search = resolveAggregateSearch(query.controls);
607
+ const where = search ? this._buildSearchWhere(search.text, query, search.indexName) : buildWhere(query.filter);
606
608
  const tableName = this.resolveTableName();
607
609
  if (query.controls.$count) {
608
610
  const { sql, params } = buildAggregateCount$1(tableName, where, query.controls);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/db-postgres",
3
- "version": "0.1.129",
3
+ "version": "0.1.130",
4
4
  "description": "PostgreSQL adapter for @atscript/db with pg (node-postgres) driver support.",
5
5
  "keywords": [
6
6
  "atscript",
@@ -55,8 +55,8 @@
55
55
  "@atscript/typescript": "^0.1.92",
56
56
  "@uniqu/core": "^0.1.8",
57
57
  "pg": ">=8.0.0",
58
- "@atscript/db": "^0.1.129",
59
- "@atscript/db-sql-tools": "^0.1.129"
58
+ "@atscript/db": "^0.1.130",
59
+ "@atscript/db-sql-tools": "^0.1.130"
60
60
  },
61
61
  "peerDependenciesMeta": {
62
62
  "pg": {