A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
add database UI - add text to help users (#8675)
Shahmir Varqhad2f56b2c14ca
diff --git a/docs/_static/docs-add-remote-storage-ui.png b/docs/_static/docs-add-remote-storage-ui.pngnew file mode 100644index 0000000000..45734a9688Binary files /dev/null and b/docs/_static/docs-add-remote-storage-ui.png differdiff --git a/docs/_static/docs-remote-storage-panel.png b/docs/_static/docs-remote-storage-panel.pngnew file mode 100644index 0000000000..cef932634fBinary files /dev/null and b/docs/_static/docs-remote-storage-panel.png differdiff --git a/docs/guides/working_with_data/remote_storage.md b/docs/guides/working_with_data/remote_storage.mdindex 750a801a06..724eca39f5 100644--- a/docs/guides/working_with_data/remote_storage.md+++ b/docs/guides/working_with_data/remote_storage.md@@ -22,11 +22,26 @@ marimo auto-discovers variables that are instances of:| [fsspec](https://filesystem-spec.readthedocs.io/) | `fsspec.AbstractFileSystem` | `S3FileSystem`, `GithubFileSystem`, `FTPFileSystem`, `DatabricksFileSystem`, and [many more](https://filesystem-spec.readthedocs.io/en/latest/api.html#built-in-implementations) |-## Quick start+## Creating a storage connection-Create a storage connection in any cell. marimo will pick it up automatically after the cell executes.+You can either create a storage connection using the UI or code.-### Obstore+### 1. Using the UI++From the Files panel in the sidebar, expand the **Remote Storage** section and click the **Add remote storage** button. The UI will guide you through entering your storage connection details.++<div align="center">+ <figure>+ <img width="700" src="/_static/docs-add-remote-storage-ui.png" alt="Add a storage connection through the UI" />+ </figure>+</div>++If you'd like to connect to a storage that isn't supported by the UI, you can use the code method below, or submit a [feature request](https://github.com/marimo-team/marimo/issues/new?title=Add%20new%20storage%20connection%20UI:&labels=enhancement&template=feature_request.yaml).+++### 2. Using code++#### Obstore```pythonfrom obstore.store import S3Store@@ -38,7 +53,7 @@ store = S3Store.from_url()```-### fsspec+#### fsspec```pythonfrom fsspec.implementations.github import GithubFileSystem@@ -46,20 +61,13 @@ from fsspec.implementations.github import GithubFileSystemrepo = GithubFileSystem(org="marimo-team", repo="marimo")```-After the cell runs, the **Remote Storage** section in the Files sidebar panel will show your connection with its detected protocol and root path.---## Using the panel+After the cell runs, the **Remote Storage** section will populate with your connection, its detected protocol, and root path.-The storage inspector appears as a collapsible **Remote storage** section at the top of the **Files** sidebar panel.--| Action | How |-|--------|-----|-| **Browse** | Click a directory to expand it. Entries are fetched lazily. |-| **Search** | Type in the search box to filter loaded entries by name. Expand directories first to include their contents. |-| **Copy URL** | Right-click or use the `⋮` menu on any entry to copy its full URL (e.g., `s3://bucket/path/to/file.parquet`). |-| **Download** | Use the `⋮` menu on a file to download it through the marimo server. |-| **Refresh** | Click the refresh icon on a namespace header to re-fetch its entries. |+<div align="center">+ <figure>+ <img width="700" src="/_static/docs-remote-storage-panel.png" alt="Remote storage panel" />+ </figure>+</div>## Multiple connectionsdiff --git a/frontend/src/components/editor/connections/add-connection-dialog.tsx b/frontend/src/components/editor/connections/add-connection-dialog.tsxindex 8a63b661cb..15d2a19a04 100644--- a/frontend/src/components/editor/connections/add-connection-dialog.tsx+++ b/frontend/src/components/editor/connections/add-connection-dialog.tsx@@ -37,6 +37,8 @@ export const AddConnectionDialogContent: React.FC<{defaultTab?: ConnectionTab;onClose: () => void;}> = ({ defaultTab = "databases", onClose }) => {+ const [activeTab, setActiveTab] = useState<ConnectionTab>(defaultTab);+const tabHeader = (<TabsList className="w-full mb-4"><TabsTrigger value="databases" className="flex-1">@@ -48,6 +50,25 @@ export const AddConnectionDialogContent: React.FC<{</TabsList>);+ const codeSnippetHint =+ activeTab === "databases" ? (+ <>+ Don't see your database or connection method? A{" "}+ <ExternalLink href="https://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database">+ code snippet+ </ExternalLink>{" "}+ is all you need.+ </>+ ) : (+ <>+ Don't see your storage or connection method? A{" "}+ <ExternalLink href="https://docs.marimo.io/guides/working_with_data/remote_storage/#creating-a-storage-connection">+ code snippet+ </ExternalLink>{" "}+ is all you need.+ </>+ );+return (<DialogContent className="max-h-[75vh] overflow-y-auto"><DialogHeader>@@ -61,10 +82,14 @@ export const AddConnectionDialogContent: React.FC<{<ExternalLink href="https://docs.marimo.io/guides/working_with_data/remote_storage/">remote storage</ExternalLink>{" "}- to work with data directly from your notebook.+ directly from your notebook.+ <span className="block">{codeSnippetHint}</span></DialogDescription></DialogHeader>- <Tabs defaultValue={defaultTab}>+ <Tabs+ value={activeTab}+ onValueChange={(v) => setActiveTab(v as ConnectionTab)}+ ><TabsContentvalue="databases"className="mt-0 focus-visible:ring-0 focus-visible:ring-offset-0"