|
| 1 | +# Raindrop |
| 2 | + |
| 3 | +Insert/delete and query your raindrop.io bookmarks with SQL. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +```bash |
| 8 | +anyquery install raindrop |
| 9 | +``` |
| 10 | + |
| 11 | +## Configuration |
| 12 | + |
| 13 | +1. Go to [https://app.raindrop.io/settings/integrations](https://app.raindrop.io/settings/integrations) |
| 14 | +2. Click on "Create new app" |
| 15 | +  |
| 16 | +3. Give it the name you want and click on "Create" |
| 17 | +4. Click on the app you just created |
| 18 | +5. Click "Create test token" and copy the token |
| 19 | +  |
| 20 | +6. Fill it in when requested by `anyquery` in the installation process |
| 21 | + |
| 22 | +## Usage |
| 23 | + |
| 24 | +```sql |
| 25 | +-- Insert a bookmark |
| 26 | +INSERT INTO raindrop_items(title, link, created_at, reminder) VALUES ('A cool SQL tool', 'https://anyquery.dev', '2024-07-10', '2024-07-20'); |
| 27 | +-- Delete a bookmark |
| 28 | +DELETE FROM raindrop_items WHERE title = 'A cool SQL tool'; |
| 29 | +-- Query all bookmarks |
| 30 | +SELECT * FROM raindrop_items; |
| 31 | +``` |
| 32 | + |
| 33 | +## Schema |
| 34 | + |
| 35 | +| Column index | Column name | type | |
| 36 | +| ------------ | --------------- | ------- | |
| 37 | +| 0 | id | INTEGER | |
| 38 | +| 1 | link | TEXT | |
| 39 | +| 2 | title | TEXT | |
| 40 | +| 3 | excerpt | TEXT | |
| 41 | +| 4 | note | TEXT | |
| 42 | +| 5 | user_id | TEXT | |
| 43 | +| 6 | cover | TEXT | |
| 44 | +| 7 | tags | TEXT | |
| 45 | +| 8 | important | INTEGER | |
| 46 | +| 9 | removed | INTEGER | |
| 47 | +| 10 | created_at | TEXT | |
| 48 | +| 11 | last_updated_at | TEXT | |
| 49 | +| 12 | domain | TEXT | |
| 50 | +| 13 | collection_id | INTEGER | |
| 51 | +| 14 | reminder | TEXT | |
| 52 | + |
| 53 | +## Known limitations |
| 54 | + |
| 55 | +- The plugin does not support the `UPDATE` operation due to rate limiting issues with the Raindrop API. See items.go:377 in the source code for more information. |
| 56 | +- The plugin caches your bookmarks for an hour. If you want to clear the cache, you can run `SELECT clear_plugin_cache('raindrop')`, and then restart `anyquery`. |
| 57 | +- The plugin buffers the INSERT/DELETE operations and sends them in batches to the Raindrop API. This can lead to a delay in the changes appearing in your Raindrop account. If you want to flush the buffer, run a simple SELECT query like `SELECT * FROM raindrop_items LIMIT 1`. |
| 58 | +- When you insert a row, not all fields will be populated in [raindrop.io](https://raindrop.io). For example, id, user_id, removed, domain, etc. |
| 59 | +- Tags are represented as a JSON array in the database. You can use the [JSON operator](https://www.sqlite.org/json1.html#the_and_operators) like in PostgreSQL to query the data. For example, `SELECT tags ->> '$[0]' FROM raindrop_items;` will return the first tag. When inserting data, it is expected that you provide a JSON array of tags. |
| 60 | +- Date are flexible. While they are always returned as [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) strings, you can insert them in the following formats : YYYY-MM-DD, YYYY-MM-DDTHH:MM:SSZ, HH:MM:SS, or a Unix timestamp. |
0 commit comments