@palbase/backend 36.0.0 → 36.0.2

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.
@@ -2501,10 +2501,15 @@ function createMockDB() {
2501
2501
  inserted: false,
2502
2502
  row: existing
2503
2503
  };
2504
- const record = {
2505
- id: crypto.randomUUID(),
2504
+ const data = resolveInsertValues("claim", table, {
2506
2505
  ...unique,
2507
2506
  ...extra
2507
+ });
2508
+ assertUsableWriteValues("claim", table, Object.keys(data), data);
2509
+ assertNoExpressionHandles("claim", table, Object.keys(data), data);
2510
+ const record = {
2511
+ id: crypto.randomUUID(),
2512
+ ...data
2508
2513
  };
2509
2514
  rowsOf(table).push(record);
2510
2515
  track(tracked.inserted, table, record);
@@ -2594,6 +2599,18 @@ function createMockDB() {
2594
2599
  async findMany(table, query, opts) {
2595
2600
  assertUsableFilter("findMany", table, query);
2596
2601
  refuseFragment("findMany", table, query);
2602
+ const { limit, offset } = opts ?? {};
2603
+ if (limit !== void 0 && (!Number.isInteger(limit) || limit < 0)) {
2604
+ throw new Error(`findMany: limit bir negatif olmayan tam say\u0131 olmal\u0131 (geldi: ${String(limit)})`);
2605
+ }
2606
+ if (offset !== void 0) {
2607
+ if (!Number.isInteger(offset) || offset < 0) {
2608
+ throw new Error(`findMany: offset bir negatif olmayan tam say\u0131 olmal\u0131 (geldi: ${String(offset)})`);
2609
+ }
2610
+ if (limit === void 0) {
2611
+ throw new Error("findMany: offset yaln\u0131z limit ile birlikte verilir \u2014 limitsiz offset bir sayfa de\u011Fil, s\u0131n\u0131rs\u0131z bir kuyru\u011Fun kayd\u0131r\u0131lm\u0131\u015F\u0131d\u0131r");
2612
+ }
2613
+ }
2597
2614
  if (opts?.with !== void 0 && Object.keys(opts.with).length > 0) {
2598
2615
  throw new Error(`findMany(${table}): fakeDatabase \`with\` desteklemiyor \u2014 ili\u015Fki grafi\u011Fi yabanc\u0131 anahtarlardan T\xDCRET\u0130L\u0130YOR ve fake \u015Femay\u0131 okumuyor. \u0130li\u015Fkili sat\u0131rlar\u0131 \xF6l\xE7en bir test ger\xE7ek motoru kullanmal\u0131; fake ile \xF6l\xE7mek istiyorsan\u0131z ilgili sat\u0131rlar\u0131 \`seed\` ile ayr\u0131 koyup ayr\u0131 sorgulay\u0131n.`);
2599
2616
  }
@@ -2625,7 +2642,8 @@ function createMockDB() {
2625
2642
  return 0;
2626
2643
  });
2627
2644
  }
2628
- const page = opts?.limit === void 0 ? out : out.slice(0, opts.limit);
2645
+ const start = offset ?? 0;
2646
+ const page = limit === void 0 ? out : out.slice(start, start + limit);
2629
2647
  const cols = opts?.select;
2630
2648
  if (cols === void 0 || cols.length === 0) return page;
2631
2649
  return page.map((row) => Object.fromEntries(cols.map((c) => [