@foretag/tanstack-db-surrealdb 0.2.0 → 0.2.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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # TanstackDB SurrealDB Collections
2
2
 
3
- Add Offline / Local First Caching & Syncing to your SurrealDB app with TanstackDB and Loro (CRDTs). For SurrealDB v3-alpha.16 and SurrealDB JS SDK v2 (and above).
3
+ Add Offline / Local First Caching & Syncing to your SurrealDB app with TanstackDB and Loro (CRDTs). Designed for SurrealDB v3.beta-1 and SurrealDB JS SDK v2 (and above).
4
4
 
5
5
  - Local / Offline first applications with TanstackDB and Loro
6
6
  - High performance with Low resource consumption
@@ -35,7 +35,7 @@ await db.connect('ws://localhost:8000/rpc');
35
35
  await db.use({ ns: 'ns', db: 'db' });
36
36
 
37
37
  // collections/products.ts
38
- import { expr, eq } from 'surrealdb';
38
+ import { eq } from 'surrealdb';
39
39
  import { db } from '../db';
40
40
  import { createCollection } from '@tanstack/db';
41
41
  import { surrealCollectionOptions } from '@foretag/tanstack-db-surrealdb';
@@ -53,7 +53,7 @@ export const products = createCollection(
53
53
  useLoro: true, // Optional if you need CRDTs
54
54
  table: {
55
55
  name: 'products',
56
- where: expr(eq('store', '123')),
56
+ where: eq('store', '123'),
57
57
  fields: ['name', 'price'] // Optional or defaults to *
58
58
  },
59
59
  });
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CollectionConfig, UtilsRecord } from '@tanstack/db';
2
2
  import { Container } from 'loro-crdt';
3
- import { RecordId, Surreal, ExprLike, BoundQuery } from 'surrealdb';
3
+ import { RecordId, Surreal, ExprLike } from 'surrealdb';
4
4
 
5
5
  type WithId<T> = T & {
6
6
  id: string | RecordId;
@@ -11,8 +11,8 @@ type SyncedTable<T> = WithId<T & {
11
11
  }>;
12
12
  type TableOptions<T> = {
13
13
  name: string;
14
- where?: ExprLike | BoundQuery;
15
14
  fields?: (keyof T)[];
15
+ where?: ExprLike;
16
16
  };
17
17
  type SurrealCollectionConfig<T extends {
18
18
  id: string | RecordId;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CollectionConfig, UtilsRecord } from '@tanstack/db';
2
2
  import { Container } from 'loro-crdt';
3
- import { RecordId, Surreal, ExprLike, BoundQuery } from 'surrealdb';
3
+ import { RecordId, Surreal, ExprLike } from 'surrealdb';
4
4
 
5
5
  type WithId<T> = T & {
6
6
  id: string | RecordId;
@@ -11,8 +11,8 @@ type SyncedTable<T> = WithId<T & {
11
11
  }>;
12
12
  type TableOptions<T> = {
13
13
  name: string;
14
- where?: ExprLike | BoundQuery;
15
14
  fields?: (keyof T)[];
15
+ where?: ExprLike;
16
16
  };
17
17
  type SurrealCollectionConfig<T extends {
18
18
  id: string | RecordId;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@foretag/tanstack-db-surrealdb",
3
3
  "description": "Add Offline / Local First Caching & Syncing to your SurrealDB app with TanstackDB and Loro (CRDTs)",
4
- "version": "0.2.0",
4
+ "version": "0.2.2",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
@@ -40,17 +40,16 @@
40
40
  "build": "tsup src/index.ts --dts --format esm,cjs"
41
41
  },
42
42
  "dependencies": {
43
- "loro-crdt": "^1.10.3"
43
+ "loro-crdt": "^1.10.4"
44
44
  },
45
45
  "peerDependencies": {
46
- "@tanstack/db": "^0.5.16",
47
- "@tanstack/query-db-collection": "^1.0.0",
48
- "surrealdb": "2.0.0-alpha.15"
46
+ "@tanstack/db": "^0.5.18",
47
+ "surrealdb": "2.0.0-alpha.16"
49
48
  },
50
49
  "devDependencies": {
51
50
  "@biomejs/biome": "^2.3.11",
52
- "@tanstack/svelte-db": "^0.1.59",
53
- "surrealdb": "2.0.0-alpha.15",
51
+ "@tanstack/svelte-db": "^0.1.61",
52
+ "surrealdb": "2.0.0-alpha.16",
54
53
  "tsup": "^8.5.1"
55
54
  }
56
55
  }