@fachkraftfreund/n8n-nodes-supabase 1.3.14 → 1.4.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.
@@ -565,7 +565,7 @@ class Supabase {
565
565
  displayOptions: {
566
566
  show: {
567
567
  resource: ['database'],
568
- operation: ['read'],
568
+ operation: ['read', 'count'],
569
569
  },
570
570
  },
571
571
  options: [
@@ -786,12 +786,22 @@ async function handleCount(supabase, itemIndex, hostUrl) {
786
786
  const table = this.getNodeParameter('table', itemIndex);
787
787
  (0, supabaseClient_1.validateTableName)(table);
788
788
  const filters = getFilters(this, itemIndex);
789
- const overhead = (0, supabaseClient_1.estimateUrlOverhead)(hostUrl, table, undefined, filters);
789
+ const joins = this.getNodeParameter('joins.join', itemIndex, []);
790
+ let selectWithJoins = '*';
791
+ for (const j of joins) {
792
+ if (!j.table)
793
+ continue;
794
+ const cols = j.columns || '*';
795
+ const hint = j.joinType === 'inner' ? `${j.table}!inner` : j.table;
796
+ selectWithJoins += `,${hint}(${cols})`;
797
+ }
798
+ const overhead = (0, supabaseClient_1.estimateUrlOverhead)(hostUrl, table, selectWithJoins, filters);
790
799
  const maxInChars = Math.max(500, supabaseClient_1.MAX_SAFE_URL_LENGTH - overhead);
791
- const filterChunks = (0, supabaseClient_1.expandChunkedFilters)(filters, maxInChars);
800
+ const maxItems = (0, supabaseClient_1.computeMaxIdsPerChunk)(selectWithJoins);
801
+ const filterChunks = (0, supabaseClient_1.expandChunkedFilters)(filters, maxInChars, maxItems);
792
802
  let totalCount = 0;
793
803
  for (const chunkFilters of filterChunks) {
794
- let query = supabase.from(table).select('*', { count: 'exact', head: true });
804
+ let query = supabase.from(table).select(selectWithJoins, { count: 'exact', head: true });
795
805
  for (const filter of chunkFilters) {
796
806
  const operator = (0, supabaseClient_1.convertFilterOperator)(filter.operator);
797
807
  query = query.filter(filter.column, operator, (0, supabaseClient_1.normalizeFilterValue)(filter.operator, filter.value));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fachkraftfreund/n8n-nodes-supabase",
3
- "version": "1.3.14",
3
+ "version": "1.4.0",
4
4
  "description": "Comprehensive n8n community node for Supabase with database and storage operations",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",