diff --git a/docs/user-guide/integrations/mindsdb.md b/docs/user-guide/integrations/mindsdb.md new file mode 100644 index 000000000..25186880d --- /dev/null +++ b/docs/user-guide/integrations/mindsdb.md @@ -0,0 +1,35 @@ +--- +keywords: [MindsDB, machine learning, data source, configuration, SQL] +description: Guide on configuring GreptimeCloud as a data source in MindsDB for machine learning capabilities. +--- + +# MindsDB + +[MindsDB](https://mindsdb.com/) is an open-source machine learning platform that +enables developers to easily incorporate advanced machine learning capabilities +with existing databases. + +Your GreptimeDB instance work out of box as using GreptimeDB extension with +MindsDB. You can configure GreptimeDB as a data source in MindsDB using MySQL protocol: + +```sql +CREATE DATABASE greptime_datasource +WITH ENGINE = 'greptimedb', +PARAMETERS = { + "host": "", + "port": 4002, + "database": "", + "user": "", + "password": "", + "ssl": True +}; + +``` + +- `` is the hostname or IP address of your GreptimeDB instance. +- `` is the name of the database you want to connect to. +- `` and `` are your [GreptimeDB credentials](/deployments/authentication/static.md). + +MindsDB is a great gateway for many machine learning features, including +time-series forecasting, for your time series data stored in our instance. See +[MindsDB docs](https://docs.mindsdb.com/what-is-mindsdb) for more information. diff --git a/docs/user-guide/integrations/streamlit.md b/docs/user-guide/integrations/streamlit.md new file mode 100644 index 000000000..0d87a5cab --- /dev/null +++ b/docs/user-guide/integrations/streamlit.md @@ -0,0 +1,33 @@ +--- +keywords: [Streamlit, data apps, SQL connection, MySQL protocol, Python] +description: Instructions for using GreptimeCloud with Streamlit to build data apps, including creating a SQL connection and running SQL queries. +--- + +# Streamlit + +[Streamlit](https://streamlit.io/) is a faster way to build and share data apps. +It's possible to build streamlit based data apps based on GreptimeDB. + +To use GreptimeDB data in your application, you will need to create a SQL +connection. Thanks to GreptimeDB's [MySQL protocol compatibility](/user-guide/protocols/mysql.md), +you can treat GreptimeDB as MySQL when connecting to it. + +Here is an example code snippet to connect to GreptimeDB from Streamlit: + +```python +import streamlit as st + +st.title('GreptimeDB Streamlit Demo') +conn = st.connection("greptimedb", type="sql", url="mysql://:@:4002/") + +df = conn.query("SELECT * FROM ...") +``` + +- The `` is the hostname or IP address of your GreptimeDB instance. +- The `` is the name of the database you want to connect to. +- The `` and `` are your [GreptimeDB credentials](/user-guide/deployments/authentication/static.md). + +Once you have created the connection, you can run SQL query against your +GreptimeDB instance. The resultset is automatically converted to Pandas +dataframe just like normal data source in streamlit. + diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/integrations/mindsdb.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/integrations/mindsdb.md new file mode 100644 index 000000000..c7b111359 --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/integrations/mindsdb.md @@ -0,0 +1,33 @@ +--- +keywords: [MindsDB, 机器学习平台, 数据库集成, 配置示例, SQL] +description: 介绍如何使用 MindsDB 将 GreptimeCloud 实例集成到机器学习平台,并提供了配置示例。 +--- + +# MindsDB + +[MindsDB](https://mindsdb.com/) 是一个开源的机器学习平台,使开发人员能够轻松地将 +先进的机器学习能力与现有数据库集成。 + +使用 MindsDB 扩展,你的 GreptimeDB 实例可以开箱即用。 +你可以使用 MySQL 协议将 GreptimeDB 配置为 MindsDB 中的数据源: + +```sql +CREATE DATABASE greptime_datasource +WITH ENGINE = 'greptimedb', +PARAMETERS = { + "host": "", + "port": 4002, + "database": "", + "user": "", + "password": "", + "ssl": True +}; + +``` + +- `` 是你的 GreptimeDB 实例的主机名或 IP 地址。 +- `` 是你想要连接的数据库名称。 +- `` 和 `` 是你 [GreptimeDB 的鉴权信息](/deployments/authentication/static.md)。 + +MindsDB 是许多机器学习功能的优秀门户,包括您存储在我们实例中的时间序列数据的时间序列预测。 +访问 [MindsDB docs](https://docs.mindsdb.com/what-is-mindsdb) 了解更多。 diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/integrations/streamlit.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/integrations/streamlit.md new file mode 100644 index 000000000..b51730865 --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/integrations/streamlit.md @@ -0,0 +1,29 @@ +--- +keywords: [Streamlit, 数据应用, SQL 连接, MySQL 协议, Python] +description: 使用 GreptimeCloud 和 Streamlit 构建数据应用的说明,包括创建 SQL 连接和运行 SQL 查询。 +--- + +# Streamlit + +[Streamlit](https://streamlit.io/) 是一种更快的构建和分享数据应用的方式。 +可以基于 GreptimeDB 构建基于 Streamlit 的数据应用。 + +你需要创建一个 SQL 连接在应用程序中使用 GreptimeDB 数据。 +由于 GreptimeDB 的 [MySQL 协议兼容性](/user-guide/protocols/mysql.md),你可以在连接时将 GreptimeDB 视为 MySQL。 + +以下是从 Streamlit 连接到 GreptimeDB 的示例代码片段: + +```python +import streamlit as st + +st.title('GreptimeDB Streamlit 演示') +conn = st.connection("greptimedb", type="sql", url="mysql://:@:4002/") + +df = conn.query("SELECT * FROM ...") +``` + +- `` 是 GreptimeDB 实例的主机名或 IP 地址。 +- `` 是要连接的数据库的名称。 +- `` 和 `` 是 [GreptimeDB 鉴权认证信息](/user-guide/deployments/authentication/static.md)。 + +创建连接后,你可以对 GreptimeDB 实例运行 SQL 查询。结果集会自动转换为 Pandas dataframe,就像在 Streamlit 中使用普通数据源一样。 diff --git a/sidebars.ts b/sidebars.ts index 088ee3f22..f308d21fc 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -112,6 +112,8 @@ const sidebars: SidebarsConfig = { 'user-guide/integrations/emqx', 'user-guide/integrations/dbeaver', 'user-guide/integrations/alloy', + 'user-guide/integrations/streamlit', + 'user-guide/integrations/mindsdb', ], }, {