@lika85456/s3qlite 0.2.0 → 0.2.1

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.
Files changed (2) hide show
  1. package/README.md +15 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -116,6 +116,20 @@ Pulls changes from remote and applies them to the local database without pushing
116
116
 
117
117
  Uploads local changes to the remote. If the remote has any changes that are not present locally (the local database is not pulled to the latest remote state), this operation will fail - this might also happen when other instances push their changes between your pull & push operations - use sync to not worry about this.
118
118
 
119
+ Push fails with typed errors in the Effect API:
120
+
121
+ - `ConflictError` when the remote changed during push and the CAS update is rejected.
122
+
123
+ ## .fork(name: string): Promise<void>
124
+
125
+ Creates a new database name that starts from the current remote of the source database. This copies only the metadata, so the fork reuses the same referenced snapshot and batch objects already stored in S3. After the fork, both databases can diverge independently.
126
+
127
+ Fork fails with typed errors in the Effect API:
128
+
129
+ - `SameNameError` when the target name matches the source database name.
130
+ - `AlreadyExistsError` when the target database already exists.
131
+ - `SourceDoesNotExistError` when the source database does not exist remotely.
132
+
119
133
  # How does it work?
120
134
 
121
135
  S3Qlite uses Turso CDC to store locally created changes. During sync these changes are batched and synced to/from the provided S3 bucket and applied, so multiple instances can do work at the same time on the same database with minimal S3 requests and minimal transfered data. Thanks to this approach a point in-time state of the database can be reconstructed as well as easily forking the database without additional overhead.
@@ -123,4 +137,4 @@ S3Qlite uses Turso CDC to store locally created changes. During sync these chang
123
137
  # Limitations
124
138
 
125
139
  - Due to the last push wins strategy, a unwanted "corruption" of data might occur. Have in mind that the synchronization is just application of CDC rows - if two instances update the same row, the last pushed edit wins. Try to avoid autoincrement and prefer other databases for more transactional workloads. S3Qlite however does support fully transactional model - sync before & after every operation.
126
- - Currently fork or checkpointing is not implemented, it is planned for future.
140
+ - Checkpointing is not implemented yet.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lika85456/s3qlite",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "dependencies": {