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
fix: correct Microsoft Graph docs and add column-name delete (#44)
Reconciles the Microsoft Graph README sections with the registered functions (resolves#43), adds a column-name overload + site param to graph_excel_delete_rows, and renames graph_team_members to graph_teams_members for consistency.
`graph_sharepoint_create_item`, `graph_sharepoint_update_item`, and `graph_sharepoint_delete_item` are table functions — use them in `SELECT` or with a lateral join for per-row mutations.
829
+
`graph_sharepoint_create_item` is a **table function** returning the new `item_id`; use it in `SELECT` or with a `LATERAL` join. `graph_sharepoint_update_item` and `graph_sharepoint_delete_item` are **scalar functions** returning `BOOLEAN` (true on success) — note their `secret` is the **last positional argument**, not a named parameter.
830
830
831
831
```sql
832
-
-- Create a new item (fields as JSON object)
833
-
SELECT item_id, item_url
832
+
-- Create a new item (fields as JSON object) — returns the new item_id
833
+
SELECT item_id
834
834
FROM graph_sharepoint_create_item(
835
835
'Finance',
836
836
'Budget',
837
837
'{"Title": "New Entry", "Status": "Draft", "Amount": 1500}',
838
838
secret :='ms_graph'
839
839
);
840
840
841
-
-- Update an existing item by ID
842
-
SELECT item_id, item_url
843
-
FROM graph_sharepoint_update_item(
844
-
'Finance',
845
-
'Budget',
846
-
'item-id-here',
841
+
-- Update an existing item by ID — scalar, returns true on success (secret is positional)
842
+
SELECT graph_sharepoint_update_item(
843
+
'Finance', 'Budget', 'item-id-here',
847
844
'{"Status": "Approved"}',
848
-
secret :='ms_graph'
849
-
);
845
+
'ms_graph'
846
+
)AS updated;
850
847
851
-
-- Delete an item by ID
852
-
SELECT item_id
853
-
FROM graph_sharepoint_delete_item('Finance', 'Budget', 'item-id-here', secret :='ms_graph');
848
+
-- Delete an item by ID — scalar, returns true on success (secret is positional)
849
+
SELECT graph_sharepoint_delete_item('Finance', 'Budget', 'item-id-here', 'ms_graph') AS deleted;
854
850
855
851
-- Bulk-create items from a query result
856
852
SELECTsrc.title, p.item_id
@@ -895,27 +891,27 @@ File paths and drive locations accept either a **friendly name** (`site := 'Fina
895
891
896
892
```sql
897
893
-- Files accessible in OneDrive/SharePoint (by name or raw drive_id)
Functions: `graph_excel_delete_rows(file_path, table_name, column, col_value, [secret, drive, site])` — `column` is a column name (resolved against the table header) or a 0-based index; `col_value` is always compared as a string.
0 commit comments