# Microsoft OneDrive

Cloud file storage from Microsoft

- Category: Files & storage
- Runs in: the Phloem cloud

Lets you and Hamming query spreadsheets and data files in your OneDrive with SQL.

## What Phloem reads
- CSV, TSV, Excel (`.xlsx`, `.xls`), JSON and Parquet files in the files and folders you pick, including subfolders up to ten levels deep. Each file is one table.
- Each file's columns, listed in Trace

Phloem reads the OneDrive of the Microsoft account that signs in.

## What you need
- A Microsoft account that can open the files
- Your consent to read your files (`Files.Read.All`), read SharePoint sites (`Sites.Read.All`), read your profile (`User.Read`) and stay signed in (`offline_access`)

## Connect
1. In the console, open **Connectors**, choose **Add connector**, then **Microsoft OneDrive**.
2. Choose **Sign in with Microsoft**. Your browser goes through your Phloem account to Microsoft, where you approve access, then back to the console.
3. On **Select Files**, pick the files and folders to connect.
4. On **Save Connection**, name the connection and save it.

## What Hamming can do
- Run SQL over the connected files: query, sample rows, count rows, list columns

Nothing it does changes your OneDrive.

## Notes
- A table is named after its file: lowercase, extension dropped, other characters turned into underscores (`Q3 Results.xlsx` → `q3_results`).
- Only the first sheet of an Excel file is read.
- Files are downloaded at each query, so results match the current file.
- If Phloem loses access, choose **Reconnect** on the connector's page and sign in again.
