Skip to content

Commit d0ff315

Browse files
committed
add demo link
1 parent 5ce5c0b commit d0ff315

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,27 @@ It has the ability to edit cell data by posting their contents to another SQLpag
5252
- **wrap_strategy_clip** If present, text is clipped if it exceeds cell width
5353
- **wrap_strategy_wrap** If present, text wraps within the cell
5454
- **text_direction_rtl** If present, text direction is right-to-left
55+
56+
### Example
57+
58+
#### `index.sql`
59+
```sql
60+
select 'spreadsheet' as component,
61+
'spreadsheet_update.sql' as update_link;
62+
63+
select
64+
row_number() over (order by created_at) as x, -- x-axis: chronological order
65+
1 as y, -- y-axis: second row
66+
todo_item as value, -- cell content: todo item
67+
todo_id as id -- cell id (used for update link)
68+
'#80cbc4' as color -- light teal
69+
from todos
70+
order by created_at;
71+
```
72+
#### `spreadsheet_update.sql`
73+
74+
```sql
75+
update todos set todo_item = :value where id = :id;
76+
```
77+
78+
See the [full example](./demo/spreadsheet.sql) in the demo folder.

0 commit comments

Comments
 (0)