You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: resources/faq.mdx
+31-15Lines changed: 31 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,62 +8,78 @@ mode: wide
8
8
<Accordiontitle="What versions of Postgres are supported?">
9
9
PowerSync supports Postgres 11+
10
10
</Accordion>
11
+
11
12
<Accordiontitle="How is a client-side sync triggered? Does the SDK use polling or real-time sync?">
12
-
**PowerSync uses near real-time streaming of changes to the client (< 1s delay).**
13
+
**PowerSync uses near real-time streaming of changes to the client (\< 1s delay).**
13
14
14
-
A persistent connection is used to continuously stream changes to the client.
15
+
A persistent connection is used to continuously stream changes to the client.
15
16
16
-
The is implemented using a standard HTTP/2 request with a streaming response, or WebSockets.
17
+
The is implemented using a standard HTTP/2 request with a streaming response, or WebSockets.
17
18
18
-
A polling API will also be available for cases where the client only needs to update data periodically, and prefer to not keep a connection open.
19
+
A polling API will also be available for cases where the client only needs to update data periodically, and prefer to not keep a connection open.
19
20
20
-
The real-time streaming is not designed for "update as you type" — it still depends on explicitly saving changes. Real-time collaboration is supported as long as users do not edit the same data (same columns of the same rows) at the same time.
21
+
The real-time streaming is not designed for "update as you type" — it still depends on explicitly saving changes. Real-time collaboration is supported as long as users do not edit the same data (same columns of the same rows) at the same time.
21
22
22
-
Concurrently working on text documents is not supported out of the box. This is solved better by CRDTs — see the [CRDTs](/usage/use-case-examples/crdts) section.
23
+
Concurrently working on text documents is not supported out of the box. This is solved better by CRDTs — see the [CRDTs](/usage/use-case-examples/crdts) section.
23
24
</Accordion>
25
+
24
26
<Accordiontitle="What data volumes are supported?">
25
27
See the section on [Performance and Limits](/resources/performance-and-limits).
26
28
</Accordion>
29
+
27
30
<Accordiontitle="What happens when a user is offline for a long time?">
28
-
If no sync rule changes were deployed in this period, the user will only need to download the incremental changes that happened since the user was last connected.
31
+
If no sync rule changes were deployed in this period, the user will only need to download the incremental changes that happened since the user was last connected.
29
32
</Accordion>
33
+
30
34
<Accordiontitle="Can a client track whether changes have been processed?">
31
-
_For example, a new record should not be displayed until the server received it, or it should be displayed as pending, or the entire screen must block with a spinner._
35
+
*For example, a new record should not be displayed until the server received it, or it should be displayed as pending, or the entire screen must block with a spinner.*
32
36
33
-
**While PowerSync does not have out-of-the-box support for this due to the great variety of requirements, this is easy to build on top of the sync system.** A simple approach is to store a “status” or “pending changes” column on the table, and set that whenever the client makes a change. When the server receives the change, it then sets it to “processed” / “no pending changes”. So when the server has processed the change, the client automatically syncs that status back.For more granular information, record individual changes in a separate table, as explained in [Custom Conflict Resolution](/usage/lifecycle-maintenance/handling-update-conflicts/custom-conflict-resolution).Note: Blocking the entire screen with a spinner is not recommended, since the change may take a very long time to be processed if the user is offline.
37
+
**While PowerSync does not have out-of-the-box support for this due to the great variety of requirements, this is easy to build on top of the sync system.** A simple approach is to store a “status” or “pending changes” column on the table, and set that whenever the client makes a change. When the server receives the change, it then sets it to “processed” / “no pending changes”. So when the server has processed the change, the client automatically syncs that status back.For more granular information, record individual changes in a separate table, as explained in [Custom Conflict Resolution](/usage/lifecycle-maintenance/handling-update-conflicts/custom-conflict-resolution).Note: Blocking the entire screen with a spinner is not recommended, since the change may take a very long time to be processed if the user is offline.
34
38
</Accordion>
39
+
35
40
<Accordiontitle="I don’t have direct database access, and can only access data via an API. Can I use PowerSync for this?">
36
41
**Right now, we don’t have support for replicating data via APIs.** A workaround would be to have custom code to replicate the data from the API to a PostgreSQL instance, then sync that with PowerSync.We may add a way in the future to replicate the data directly from an API to the PowerSync service, without a database in between.
37
42
</Accordion>
43
+
38
44
<Accordiontitle="Are “live queries” supported?">
39
-
**Yes.**The PowerSync client SDKs support real-time streaming of changes, and can automatically rerun a query if the underlying data changed.It does not support incrementally updating the result set yet, but it should be fast if the query is indexed appropriately, and the result set is small enough.
45
+
\*\*Yes.\*\*The PowerSync client SDKs support real-time streaming of changes, and can automatically rerun a query if the underlying data changed.It does not support incrementally updating the result set yet, but it should be fast if the query is indexed appropriately, and the result set is small enough.
40
46
</Accordion>
47
+
41
48
<Accordiontitle="What features are available for debugging issues?">
42
49
See [Troubleshooting](/resources/troubleshooting)
43
50
</Accordion>
51
+
44
52
<Accordiontitle="Are transactions supported?">
45
53
**Client-side transactions are supported**, and use standard SQLite locking to avoid conflicts.**Client-server transactions are not supported.** This would require online connectivity to detect conflicts and retry the transaction, which is not possible for changes made offline. Instead, it is recommended to model the data to allow atomic changes (see previous sections on conflict detection).
46
54
</Accordion>
55
+
47
56
<Accordiontitle="Can auto-incrementing IDs be used?">
48
57
**This is generally not recommended, but it can be used in some cases, with caveats.**
49
58
50
59
See the section on [client ID](/usage/sync-rules/client-id) for details.
51
60
</Accordion>
61
+
52
62
<Accordiontitle="Can attachments (files) be synced?">
53
63
**An attachment sync or caching system can be built on top of PowerSync.**
54
64
55
-
See the section on [Attachments](/usage/use-case-examples/attachments-files) for details.
65
+
See the section on [Attachments](/usage/use-case-examples/attachments-files) for details.
56
66
</Accordion>
67
+
57
68
<Accordiontitle="My backend application uses GraphQL. Can I use PowerSync?">
58
69
Currently, PowerSync can only read from Postgres databases directly. GraphQL or REST APIs can be used for the write path by the PowerSync SDK
59
70
</Accordion>
71
+
60
72
<Accordiontitle="Is the system susceptible to SQL Injection?">
61
-
By default PowerSync is not susceptible to SQL injection. The PowerSync execute API is parameterized, and as long as developers use that, SQL injection is not possible. It is however the developer's responsibility to ensure that they use the parameterized API and don't directly insert user-provided data into underlying SQLite tables.
73
+
By default PowerSync is not susceptible to SQL injection. The PowerSync execute API is parameterized, and as long as developers use that, SQL injection is not possible. It is however the developer's responsibility to ensure that they use the parameterized API and don't directly insert user-provided data into underlying SQLite tables.
62
74
</Accordion>
63
-
<Accordiontitle="When should I use getCrudBatch() instead of getNextCrudTransaction() ?">
64
75
76
+
<Accordiontitle="When should I use getCrudBatch() instead of getNextCrudTransaction() ?">
0 commit comments