supabase-typed-query 0.11.0 → 0.12.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.
package/dist/index.js CHANGED
@@ -555,10 +555,10 @@ const createMappedQuery = (sourceQuery, mapFn) => {
555
555
  }
556
556
  };
557
557
  };
558
- const createQuery = (client, table, where = {}, is, wherein, order, softDeleteConfig, schema) => {
558
+ const createQuery = (client, table, where = {}, is, wherein, order, softDeleteConfig, schema, comparison) => {
559
559
  const config = {
560
560
  table,
561
- conditions: [{ where, is, wherein }],
561
+ conditions: [{ where, is, wherein, ...comparison }],
562
562
  order,
563
563
  softDeleteMode: softDeleteConfig?.mode,
564
564
  softDeleteAppliedByDefault: softDeleteConfig?.appliedByDefault,
@@ -868,7 +868,7 @@ function createGetItemQuery(client, name, whereConditions, is, softDeleteMode, s
868
868
  schema
869
869
  );
870
870
  }
871
- function createGetItemsQuery(client, name, whereConditions, is, wherein, order, softDeleteMode, schema) {
871
+ function createGetItemsQuery(client, name, whereConditions, is, wherein, order, softDeleteMode, schema, comparison) {
872
872
  return createQuery(
873
873
  client,
874
874
  name,
@@ -880,7 +880,8 @@ function createGetItemsQuery(client, name, whereConditions, is, wherein, order,
880
880
  mode: softDeleteMode,
881
881
  appliedByDefault: true
882
882
  },
883
- schema
883
+ schema,
884
+ comparison
884
885
  );
885
886
  }
886
887
  function createAddItemsMutation(client, name, items, schema) {
@@ -936,7 +937,19 @@ function makeGetItem(client, name, softDeleteMode, schema) {
936
937
  };
937
938
  }
938
939
  function makeGetItems(client, name, softDeleteMode, schema) {
939
- return function getItems({ where, is, wherein, order } = {}) {
940
+ return function getItems({
941
+ where,
942
+ is,
943
+ wherein,
944
+ order,
945
+ gte,
946
+ gt,
947
+ lte,
948
+ lt,
949
+ neq,
950
+ like,
951
+ ilike
952
+ } = {}) {
940
953
  return createGetItemsQuery(
941
954
  client,
942
955
  name,
@@ -945,7 +958,8 @@ function makeGetItems(client, name, softDeleteMode, schema) {
945
958
  wherein,
946
959
  order,
947
960
  softDeleteMode,
948
- schema
961
+ schema,
962
+ { gte, gt, lte, lt, neq, like, ilike }
949
963
  );
950
964
  };
951
965
  }
@@ -963,7 +977,7 @@ function makePartitionedGetItem(client, name, partitionField, softDeleteMode, sc
963
977
  };
964
978
  }
965
979
  function makePartitionedGetItems(client, name, partitionField, softDeleteMode, schema) {
966
- return function getItems(partitionKey, { where, is, wherein, order } = {}) {
980
+ return function getItems(partitionKey, { where, is, wherein, order, gte, gt, lte, lt, neq, like, ilike } = {}) {
967
981
  const whereConditions = buildWhereWithPartition(partitionField, partitionKey, where);
968
982
  return createGetItemsQuery(
969
983
  client,
@@ -973,7 +987,8 @@ function makePartitionedGetItems(client, name, partitionField, softDeleteMode, s
973
987
  wherein,
974
988
  order,
975
989
  softDeleteMode,
976
- schema
990
+ schema,
991
+ { gte, gt, lte, lt, neq, like, ilike }
977
992
  );
978
993
  };
979
994
  }