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