@pol-studios/db 1.0.18 → 1.0.21

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
@@ -26,7 +26,7 @@ import {
26
26
  useHasConflicts,
27
27
  usePendingConflicts,
28
28
  useSupabaseUpload
29
- } from "./chunk-ZFM6AGWV.js";
29
+ } from "./chunk-2T6WTCP4.js";
30
30
  import {
31
31
  ADAPTER_STRATEGIES,
32
32
  AdapterAutoDetector,
@@ -81,7 +81,7 @@ import {
81
81
  useUpsertChangelog,
82
82
  useUpsertChangelogEntry,
83
83
  useUpsertChangelogMedia
84
- } from "./chunk-XOPORVJG.js";
84
+ } from "./chunk-R5B2XMN5.js";
85
85
  import {
86
86
  LiveChangeContext,
87
87
  LiveChangeContextProvider,
@@ -119,6 +119,11 @@ interface PowerSyncDatabase {
119
119
  * select: "*, EquipmentFixture(*), ProjectDatabase(name)"
120
120
  * });
121
121
  */
122
+ /**
123
+ * Function type for resolving table names to PowerSync aliases.
124
+ * Used to map schema-qualified names like "core.Profile" to aliases like "CoreProfile".
125
+ */
126
+ type TableNameResolver = (table: string) => string;
122
127
  declare class PowerSyncAdapter implements TableDataAdapter, CapableDataAdapter {
123
128
  private db;
124
129
  private schema;
@@ -134,13 +139,28 @@ declare class PowerSyncAdapter implements TableDataAdapter, CapableDataAdapter {
134
139
  * The underlying query executor
135
140
  */
136
141
  private executor;
142
+ /**
143
+ * Optional custom table name resolver.
144
+ * If not provided, uses default auto-alias generation.
145
+ */
146
+ private tableNameResolver?;
137
147
  /**
138
148
  * Create a new PowerSyncAdapter
139
149
  *
140
150
  * @param db - PowerSync database instance
141
151
  * @param schema - Database schema for relationship resolution
152
+ * @param tableNameResolver - Optional custom resolver for table names to PowerSync aliases
153
+ */
154
+ constructor(db: PowerSyncDatabase, schema: DatabaseSchema, tableNameResolver?: TableNameResolver);
155
+ /**
156
+ * Resolve a table name to its PowerSync alias.
157
+ * Schema-qualified names like "chat.Conversation" become "Conversation" (schema stripped).
158
+ * Unqualified names pass through unchanged.
159
+ *
160
+ * @param table - Original table name (may be schema-qualified)
161
+ * @returns The PowerSync alias to use in SQLite queries
142
162
  */
143
- constructor(db: PowerSyncDatabase, schema: DatabaseSchema);
163
+ private resolveTableName;
144
164
  /**
145
165
  * Execute a query and return results with optional count for pagination.
146
166
  *
@@ -15,7 +15,7 @@ import {
15
15
  useHasConflicts,
16
16
  usePendingConflicts,
17
17
  useSupabaseUpload
18
- } from "./chunk-ZFM6AGWV.js";
18
+ } from "./chunk-2T6WTCP4.js";
19
19
  import {
20
20
  ADAPTER_STRATEGIES,
21
21
  AdapterAutoDetector,
@@ -70,7 +70,7 @@ import {
70
70
  useUpsertChangelog,
71
71
  useUpsertChangelogEntry,
72
72
  useUpsertChangelogMedia
73
- } from "./chunk-XOPORVJG.js";
73
+ } from "./chunk-R5B2XMN5.js";
74
74
  import {
75
75
  LiveChangeContext,
76
76
  LiveChangeContextProvider,
package/dist/index.web.js CHANGED
@@ -57,7 +57,7 @@ import {
57
57
  useUpsertChangelog,
58
58
  useUpsertChangelogEntry,
59
59
  useUpsertChangelogMedia
60
- } from "./chunk-XOPORVJG.js";
60
+ } from "./chunk-R5B2XMN5.js";
61
61
  import {
62
62
  LiveChangeContext,
63
63
  LiveChangeContextProvider,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pol-studios/db",
3
- "version": "1.0.18",
3
+ "version": "1.0.21",
4
4
  "description": "Database layer for React applications with Supabase and PowerSync support",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -95,6 +95,55 @@
95
95
  "files": [
96
96
  "dist"
97
97
  ],
98
+ "typesVersions": {
99
+ "*": {
100
+ "client": [
101
+ "./dist/client/index.d.ts"
102
+ ],
103
+ "core": [
104
+ "./dist/core/index.d.ts"
105
+ ],
106
+ "query": [
107
+ "./dist/query/index.d.ts"
108
+ ],
109
+ "mutation": [
110
+ "./dist/mutation/index.d.ts"
111
+ ],
112
+ "realtime": [
113
+ "./dist/realtime/index.d.ts"
114
+ ],
115
+ "parser": [
116
+ "./dist/parser/index.d.ts"
117
+ ],
118
+ "hooks": [
119
+ "./dist/hooks/index.d.ts"
120
+ ],
121
+ "types": [
122
+ "./dist/types/index.d.ts"
123
+ ],
124
+ "gen": [
125
+ "./dist/gen/index.d.ts"
126
+ ],
127
+ "auth": [
128
+ "./dist/auth/index.d.ts"
129
+ ],
130
+ "auth/context": [
131
+ "./dist/auth/context.d.ts"
132
+ ],
133
+ "auth/hooks": [
134
+ "./dist/auth/hooks.d.ts"
135
+ ],
136
+ "auth/guards": [
137
+ "./dist/auth/guards.d.ts"
138
+ ],
139
+ "with-auth": [
140
+ "./dist/with-auth/index.d.ts"
141
+ ],
142
+ "powersync-bridge": [
143
+ "./dist/powersync-bridge/index.d.ts"
144
+ ]
145
+ }
146
+ },
98
147
  "keywords": [
99
148
  "database",
100
149
  "supabase",
@@ -104,20 +153,14 @@
104
153
  "offline-first",
105
154
  "sync"
106
155
  ],
107
- "scripts": {
108
- "build": "NODE_OPTIONS='--max-old-space-size=8192' tsup",
109
- "dev": "tsup --watch",
110
- "typecheck": "tsc --noEmit",
111
- "prepublishOnly": "pnpm build"
112
- },
113
156
  "peerDependencies": {
114
- "@pol-studios/powersync": "workspace:*",
115
157
  "@powersync/react-native": ">=1.0.8",
116
158
  "@react-native-community/netinfo": ">=9.0.0",
117
159
  "@supabase/supabase-js": ">=2.0.0",
118
160
  "@tanstack/react-query": ">=5.0.0",
119
161
  "react": ">=18.0.0",
120
- "react-native": ">=0.70.0"
162
+ "react-native": ">=0.70.0",
163
+ "@pol-studios/powersync": "1.0.5"
121
164
  },
122
165
  "peerDependenciesMeta": {
123
166
  "@pol-studios/powersync": {
@@ -139,16 +182,21 @@
139
182
  },
140
183
  "devDependencies": {
141
184
  "@babel/core": "^7.28.0",
142
- "@pol-studios/hooks": "workspace:*",
143
- "@pol-studios/utils": "workspace:*",
144
185
  "@supabase-cache-helpers/postgrest-core": "^0.12.3",
145
186
  "@supabase-cache-helpers/postgrest-react-query": "^1.0.0",
146
187
  "@types/flat": "^5.0.5",
147
188
  "babel-plugin-react-compiler": "^1.0.0",
148
189
  "tsup": "^8.0.0",
149
- "typescript": "^5.0.0"
190
+ "typescript": "^5.0.0",
191
+ "@pol-studios/hooks": "1.0.9",
192
+ "@pol-studios/utils": "1.0.9"
150
193
  },
151
194
  "publishConfig": {
152
195
  "access": "public"
196
+ },
197
+ "scripts": {
198
+ "build": "NODE_OPTIONS='--max-old-space-size=8192' tsup",
199
+ "dev": "tsup --watch",
200
+ "typecheck": "tsc --noEmit"
153
201
  }
154
- }
202
+ }