@expo/entity-database-adapter-knex 0.48.0 → 0.50.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/entity-database-adapter-knex",
3
- "version": "0.48.0",
3
+ "version": "0.50.0",
4
4
  "description": "Knex database adapter for @expo/entity",
5
5
  "files": [
6
6
  "build",
@@ -28,14 +28,14 @@
28
28
  "author": "Expo",
29
29
  "license": "MIT",
30
30
  "dependencies": {
31
- "@expo/entity": "^0.48.0",
31
+ "@expo/entity": "^0.50.0",
32
32
  "knex": "^3.1.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@expo/entity-testing-utils": "^0.48.0",
35
+ "@expo/entity-testing-utils": "^0.50.0",
36
36
  "@jest/globals": "^30.0.0",
37
37
  "pg": "8.14.1",
38
38
  "typescript": "^5.8.3"
39
39
  },
40
- "gitHead": "7b4bec8f841fecdb30af306441b540c0efae1603"
40
+ "gitHead": "59e024eb19fd7a6f6d0b8f1577970b26049bc411"
41
41
  }
@@ -1,4 +1,9 @@
1
- import { OrderByOrdering, TransactionIsolationLevel, ViewerContext } from '@expo/entity';
1
+ import {
2
+ EntityDatabaseAdapterEmptyUpdateResultError,
3
+ OrderByOrdering,
4
+ TransactionIsolationLevel,
5
+ ViewerContext,
6
+ } from '@expo/entity';
2
7
  import { createUnitTestEntityCompanionProvider } from '@expo/entity-testing-utils';
3
8
  import { enforceAsyncResult } from '@expo/results';
4
9
  import { afterAll, beforeAll, beforeEach, describe, expect, it, test } from '@jest/globals';
@@ -56,6 +61,23 @@ describe('postgres entity integration', () => {
56
61
  expect(loadedEntity.getField('hasADog')).toBe(false);
57
62
  });
58
63
 
64
+ it('throws an appropriate error when updating a deleted row', async () => {
65
+ const vc = new ViewerContext(createKnexIntegrationTestEntityCompanionProvider(knexInstance));
66
+ const vc2 = new ViewerContext(createKnexIntegrationTestEntityCompanionProvider(knexInstance));
67
+
68
+ const entity = await PostgresTestEntity.creator(vc)
69
+ .setField('name', 'hello')
70
+ .setField('hasACat', false)
71
+ .createAsync();
72
+
73
+ const entityLoadedVC2 = await PostgresTestEntity.loader(vc2).loadByIDAsync(entity.getID());
74
+ await PostgresTestEntity.deleter(entityLoadedVC2).deleteAsync();
75
+
76
+ await expect(
77
+ PostgresTestEntity.updater(entity).setField('hasACat', true).updateAsync(),
78
+ ).rejects.toThrow(EntityDatabaseAdapterEmptyUpdateResultError);
79
+ });
80
+
59
81
  describe('empty creates and updates', () => {
60
82
  it('allows empty create', async () => {
61
83
  const vc = new ViewerContext(createKnexIntegrationTestEntityCompanionProvider(knexInstance));
@@ -256,7 +278,7 @@ describe('postgres entity integration', () => {
256
278
  });
257
279
  });
258
280
 
259
- describe.only('BYTEA fields', () => {
281
+ describe('BYTEA fields', () => {
260
282
  it('supports BYTEA fields', async () => {
261
283
  const vc1 = new ViewerContext(createKnexIntegrationTestEntityCompanionProvider(knexInstance));
262
284