Skip to content

Commit 316d4e9

Browse files
committed
Docs: fix internal links
1 parent 616eb0b commit 316d4e9

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

README.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ SQLite Sync is ideal for building collaborative and distributed apps across web,
9494
- **Collaborative Design Tools**: Merge visual edits and annotations offline.
9595
- **Educational Apps**: Shared learning content with per-student access controls.
9696

97-
## 📋 Documentation
97+
## Documentation
9898

9999
For detailed information on all available functions, their parameters, and examples, refer to the [comprehensive API Reference](./API.md).
100100

101-
## 📦 Installation
101+
## Installation
102102

103103
### Pre-built Binaries
104104

@@ -122,12 +122,42 @@ SELECT load_extension('./cloudsync');
122122

123123
### Usage
124124

125-
```
125+
Here's a quick example to get started with `sqlite-sync`:
126+
127+
```sql
128+
-- Load the extension
129+
.load ./cloudsync
130+
131+
-- Create a table you want to synchronize
132+
CREATE TABLE IF NOT EXISTS my_data (
133+
id TEXT PRIMARY KEY,
134+
value TEXT
135+
);
136+
137+
-- Initialize synchronization for the table
138+
-- This sets up internal metadata tables and triggers for CRDT functionality.
139+
SELECT cloudsync_init('my_data');
140+
141+
-- Insert some data. These changes will be tracked for synchronization.
142+
INSERT INTO my_data (id, value) VALUES (cloudsync_uuid(), 'Hello from device A!');
143+
144+
-- Configure network settings to connect to your SQLite Cloud database.
145+
-- Replace <your_connection_string> with your actual connection details.
146+
-- Example: 'sqlitecloud://<projectid>.sqlite.cloud/<db>.sqlite'
147+
SELECT cloudsync_network_init('<your_connection_string>');
148+
149+
-- Set your API key or authentication token.
150+
-- Use cloudsync_network_set_token() if you have an access token.
151+
SELECT cloudsync_network_set_apikey('YOUR_API_KEY');
126152

127-
// sample code and API explain here
153+
-- Manually trigger a synchronization cycle.
154+
-- This sends local changes to the cloud and pulls down remote changes.
155+
SELECT cloudsync_network_sync();
128156

157+
-- On another device (after loading extension and initializing the same table):
158+
-- Running SELECT cloudsync_network_sync(); would pull changes from device A.
129159
```
130160

131161
## License
132162

133-
This project is licensed under the [Elastic License 2.0](./LICENSE.md). You can use, copy, modify, and distribute it under the terms of the license for non-production use. For production or managed service use, please [contact SQLite Cloud, Inc](mailto:[email protected]) for a commercial license.
163+
This project is licensed under the [Elastic License 2.0](./LICENSE.md). You can use, copy, modify, and distribute it under the terms of the license for non-production use. For production or managed service use, please [contact SQLite Cloud, Inc](mailto:[email protected]) for a commercial license.

0 commit comments

Comments
 (0)