diff --git a/docs/reference/sql-tools.md b/docs/reference/sql-tools.md new file mode 100644 index 000000000..acaa009c6 --- /dev/null +++ b/docs/reference/sql-tools.md @@ -0,0 +1,279 @@ +# SQL Tools + +GreptimeDB uses SQL as its main query language and supports many popular SQL tools. +This document guides you on how to use SQL tools with GreptimeDB. + +## Language drivers + +It is recommended to use mature SQL drivers to query data. + +### Recommended libraries + + + + Java Database Connectivity (JDBC) is the JavaSoft specification of a standard application programming interface (API) that allows Java programs to access database management systems. + + Many databases, such as MySQL or PostgreSQL, have implemented their own drivers based on the JDBC API. + Since GreptimeDB supports [multiple protocols](/user-guide/protocols/overview.md), we use MySQL as an example to demonstrate how to use JDBC. + If you want to use other protocols, just replace the MySQL driver with the corresponding driver. + + + It is recommended to use the [GORM](https://gorm.io/) library, which is popular and developer-friendly. + + + +### Installation + + + + If you are using [Maven](https://maven.apache.org/), add the following to your `pom.xml` dependencies list: + + ```xml + + mysql + mysql-connector-java + 8.0.33 + + ``` + + + + Use the following command to install the GORM library: + + ```shell + go get -u gorm.io/gorm + ``` + + Then install the MySQL driver: + + ```shell + go get -u gorm.io/driver/mysql + ``` + + Import the libraries in your code: + + ```go + import ( + "gorm.io/gorm" + "gorm.io/driver/mysql" + ) + ``` + + + +### Connect to database + +The following use MySQL as an example to demonstrate how to connect to GreptimeDB. + + + + ```java + public static Connection getConnection() throws IOException, ClassNotFoundException, SQLException { + Properties prop = new Properties(); + prop.load(QueryJDBC.class.getResourceAsStream("/db-connection.properties")); + + String dbName = (String) prop.get("db.database-driver"); + String dbConnUrl = (String) prop.get("db.url"); + String dbUserName = (String) prop.get("db.username"); + String dbPassword = (String) prop.get("db.password"); + + Class.forName(dbName); + Connection dbConn = DriverManager.getConnection(dbConnUrl, dbUserName, dbPassword); + + return Objects.requireNonNull(dbConn, "Failed to make connection!"); + } + ``` + + You need a properties file to store the DB connection information. Place it in the resources directory and name it `db-connection.properties`. The file content is as follows: + + ```txt + # DataSource + db.database-driver=com.mysql.cj.jdbc.Driver + db.url=jdbc:mysql://localhost:4002/public + db.username= + db.password= + ``` + + Or you can get the file from [here](https://github.com/GreptimeTeam/greptimedb-ingester-java/blob/main/ingester-example/src/main/resources/db-connection.properties). + + + ```go + type Mysql struct { + Host string + Port string + User string + Password string + Database string + + DB *gorm.DB + } + + m := &Mysql{ + Host: "127.0.0.1", + Port: "4002", // default port for MySQL + User: "username", + Password: "password", + Database: "public", + } + + dsn := fmt.Sprintf("tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local", + m.Host, m.Port, m.Database) + dsn = fmt.Sprintf("%s:%s@%s", m.User, m.Password, dsn) + db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{}) + if err != nil { + // error handling + } + m.DB = db + ``` + + + +#### Time zone + + + + Set the JDBC time zone by setting URL parameters: + + ```txt + jdbc:mysql://127.0.0.1:4002?connectionTimeZone=Asia/Shanghai&forceConnectionTimeZoneToSession=true + ``` + + * `connectionTimeZone={LOCAL|SERVER|user-defined-time-zone}` specifies the connection time zone. + * `forceConnectionTimeZoneToSession=true` sets the session `time_zone` variable to the value specified in `connectionTimeZone`. + + + Set the time zone in the DSN. For example, set the time zone to `Asia/Shanghai`: + + ```go + dsn := fmt.Sprintf("tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local&time_zone=%27Asia%2FShanghai%27", + m.Host, m.Port, m.Database) + ``` + + For more information, see the [MySQL Driver Documentation](https://github.com/go-sql-driver/mysql?tab=readme-ov-file#system-variables). + + + +### Raw SQL + +It is recommended to use raw SQL to experience the full features of GreptimeDB. +The following example shows how to use raw SQL to query data. + + + + ```java + try (Connection conn = getConnection()) { + Statement statement = conn.createStatement(); + + // DESC table; + ResultSet rs = statement.executeQuery("DESC cpu_metric"); + LOG.info("Column | Type | Key | Null | Default | Semantic Type "); + while (rs.next()) { + LOG.info("{} | {} | {} | {} | {} | {}", + rs.getString(1), + rs.getString(2), + rs.getString(3), + rs.getString(4), + rs.getString(5), + rs.getString(6)); + } + + // SELECT COUNT(*) FROM cpu_metric; + rs = statement.executeQuery("SELECT COUNT(*) FROM cpu_metric"); + while (rs.next()) { + LOG.info("Count: {}", rs.getInt(1)); + } + + // SELECT * FROM cpu_metric ORDER BY ts DESC LIMIT 5; + rs = statement.executeQuery("SELECT * FROM cpu_metric ORDER BY ts DESC LIMIT 5"); + LOG.info("host | ts | cpu_user | cpu_sys"); + while (rs.next()) { + LOG.info("{} | {} | {} | {}", + rs.getString("host"), + rs.getTimestamp("ts"), + rs.getDouble("cpu_user"), + rs.getDouble("cpu_sys")); + } + } + ``` + + For the complete code of the demo, please refer to [here](https://github.com/GreptimeTeam/greptimedb-ingester-java/blob/main/ingester-example/src/main/java/io/greptime/QueryJDBC.java). + + + The following code declares a GORM object model: + + ```go + type CpuMetric struct { + Host string `gorm:"column:host;primaryKey"` + Ts time.Time `gorm:"column:ts;primaryKey"` + CpuUser float64 `gorm:"column:cpu_user"` + CpuSys float64 `gorm:"column:cpu_sys"` + } + ``` + + If you are using the [High-level API](/user-guide/ingest-data/for-iot/grpc-sdks/go.md#high-level-api) to insert data, you can declare the model with both GORM and GreptimeDB tags. + + ```go + type CpuMetric struct { + Host string `gorm:"column:host;primaryKey" greptime:"tag;column:host;type:string"` + Ts time.Time `gorm:"column:ts;primaryKey" greptime:"timestamp;column:ts;type:timestamp;precision:millisecond"` + CpuUser float64 `gorm:"column:cpu_user" greptime:"field;column:cpu_user;type:float64"` + CpuSys float64 `gorm:"column:cpu_sys" greptime:"field;column:cpu_sys;type:float64"` + } + ``` + + Declare the table name as follows: + + ```go + func (CpuMetric) TableName() string { + return "cpu_metric" + } + ``` + + Use raw SQL to query data: + + ```go + var cpuMetric CpuMetric + db.Raw("SELECT * FROM cpu_metric LIMIT 10").Scan(&result) + ``` + + + +### Query library reference + +For more information about how to use the query library, please see the documentation of the corresponding library: + + + + - [JDBC Online Tutorials](https://docs.oracle.com/javase/tutorial/jdbc/basics/index.html) + + + - [GORM](https://gorm.io/docs/index.html) + + + +## Command line tools + +### MySQL + +You can use the `mysql` command line tool to connect to the GreptimeDB. +Please refer to the [MySQL protocol](/user-guide/protocols/mysql.md) document for connection information. + +After you connect to the server, you can use all [GreptimeDB SQL commands](/reference/sql/overview.md) to interact with the database. + +### PostgreSQL + +You can use the `psql` command line tool to connect to the GreptimeDB. +Please refer to the [PostgreSQL protocol](/user-guide/protocols/postgresql.md) document for connection information. + +After you connect to the server, you can use all [GreptimeDB SQL commands](/reference/sql/overview.md) to interact with the database. + +## GreptimeDB Dashboard + +You can run SQL and visualize data in the [GreptimeDB Dashboard](/getting-started/installation/greptimedb-dashboard.md). + + + +## HTTP API + +You can POST SQL queries to the GreptimeDB HTTP API to query data. +Please refer to the [HTTP API](/user-guide/protocols/http.md) document for more information. diff --git a/docs/user-guide/ingest-data/for-iot/grpc-sdks/go.md b/docs/user-guide/ingest-data/for-iot/grpc-sdks/go.md index 0828fe889..b3b2010ca 100644 --- a/docs/user-guide/ingest-data/for-iot/grpc-sdks/go.md +++ b/docs/user-guide/ingest-data/for-iot/grpc-sdks/go.md @@ -223,117 +223,4 @@ affected, err := cli.CloseStream(ctx) - - - -
- -Use the following command to install the GORM library: - -```shell -go get -u gorm.io/gorm -``` - -and install the MySQL driver as the example: - -```shell -go get -u gorm.io/driver/mysql -``` - -Then import the libraries in your code: - -```go -import ( - "gorm.io/gorm" - "gorm.io/driver/mysql" -) -``` - -
- -
- -```go -type Mysql struct { - Host string - Port string - User string - Password string - Database string - - DB *gorm.DB -} - -m := &Mysql{ - Host: "127.0.0.1", - Port: "4002", // default port for MySQL - User: "username", - Password: "password", - Database: "public", -} - -dsn := fmt.Sprintf("tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local", - m.Host, m.Port, m.Database) -dsn = fmt.Sprintf("%s:%s@%s", m.User, m.Password, dsn) -db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{}) -if err != nil { - //error handling -} -m.DB = db -``` -
- -
- -The following code declares a GORM object model: - -```go -type CpuMetric struct { - Host string `gorm:"column:host;primaryKey"` - Ts time.Time `gorm:"column:ts;primaryKey"` - CpuUser float64 `gorm:"column:cpu_user"` - CpuSys float64 `gorm:"column:cpu_sys"` -} -``` - -If you are using the [ORM API](#orm-api) to insert data, you can declare the model with both GORM and Greptime tags. - -```go -type CpuMetric struct { - Host string `gorm:"column:host;primaryKey" greptime:"tag;column:host;type:string"` - Ts time.Time `gorm:"column:ts;primaryKey" greptime:"timestamp;column:ts;type:timestamp;precision:millisecond"` - CpuUser float64 `gorm:"column:cpu_user" greptime:"field;column:cpu_user;type:float64"` - CpuSys float64 `gorm:"column:cpu_sys" greptime:"field;column:cpu_sys;type:float64"` -} -``` - -Declare the table name as follows: - -```go -func (CpuMetric) TableName() string { - return "cpu_metric" -} -``` - -Use raw SQL to query data: - -```go -var cpuMetric CpuMetric -db.Raw("SELECT * FROM cpu_metric LIMIT 10").Scan(&result) - -``` - -
- - - - - \ No newline at end of file + diff --git a/docs/user-guide/ingest-data/for-iot/grpc-sdks/java.md b/docs/user-guide/ingest-data/for-iot/grpc-sdks/java.md index a479b2c68..c3ba011e4 100644 --- a/docs/user-guide/ingest-data/for-iot/grpc-sdks/java.md +++ b/docs/user-guide/ingest-data/for-iot/grpc-sdks/java.md @@ -319,127 +319,4 @@ Please refer to [Metrics & Display](https://github.com/GreptimeTeam/greptimedb-i - - - - - - - - diff --git a/docs/user-guide/ingest-data/for-iot/grpc-sdks/template.md b/docs/user-guide/ingest-data/for-iot/grpc-sdks/template.md index 01e020ab6..7f53dd4c7 100644 --- a/docs/user-guide/ingest-data/for-iot/grpc-sdks/template.md +++ b/docs/user-guide/ingest-data/for-iot/grpc-sdks/template.md @@ -93,36 +93,3 @@ Streaming insert is useful when you want to insert a large amount of data such a ## Ingester library reference - - - diff --git a/docs/user-guide/query-data/overview.md b/docs/user-guide/query-data/overview.md index f4b105635..122460b84 100644 --- a/docs/user-guide/query-data/overview.md +++ b/docs/user-guide/query-data/overview.md @@ -10,11 +10,12 @@ Since v0.9, GreptimeDB supports view and CTE just like other databases, used to * [View](./view.md) * [Common Table Expression (CTE)](./cte.md) - +Since GreptimeDB uses SQL as its main query language and supports both [MySQL](/user-guide/protocols/mysql.md) and [PostgreSQL](/user-guide/protocols/postgresql.md) protocols, +you can use mature SQL drivers that support MySQL or PostgreSQL to query data. + +For more information, please refer to the [SQL Tools](/reference/sql-tools.md) documentation. ## Query external data diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/reference/sql-tools.md b/i18n/zh/docusaurus-plugin-content-docs/current/reference/sql-tools.md new file mode 100644 index 000000000..5c7440c34 --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/reference/sql-tools.md @@ -0,0 +1,279 @@ +# SQL 工具 + +GreptimeDB 使用 SQL 作为主要查询语言,并支持许多流行的 SQL 工具。 +本文档指导你如何使用 SQL 工具与 GreptimeDB 交互。 + +## 编程语言 Driver + +推荐使用成熟的 SQL driver 来查询数据。 + +### 推荐的查询库 + + + + Java 数据库连接(JDBC)是 JavaSoft 规范的标准应用程序编程接口(API),它允许 Java 程序访问数据库管理系统。 + + 许多数据库协议,如 MySQL 或 PostgreSQL,都已经基于 JDBC API 实现了自己的驱动程序。 + 由于 GreptimeDB [支持多种协议](/user-guide/protocols/overview.md),这里我们使用 MySQL 协议作为示例来演示如何使用 JDBC。 + 如果你希望使用其他协议,只需要将 MySQL driver 换为相应的 driver。 + + + 推荐使用 [GORM](https://gorm.io/) 库来查询数据。 + + + +### 安装 + + + + 如果你使用的是 [Maven](https://maven.apache.org/),请将以下内容添加到 `pom.xml` 的依赖项列表中: + + ```xml + + mysql + mysql-connector-java + 8.0.33 + + ``` + + + + 使用下方的命令安装 GORM: + + ```shell + go get -u gorm.io/gorm + ``` + + 以 MySQL 为例安装 driver: + + ```shell + go get -u gorm.io/driver/mysql + ``` + + 将库引入到代码中: + + ```go + import ( + "gorm.io/gorm" + "gorm.io/driver/mysql" + ) + ``` + + + +### Connect to database + +下面以 MySQL 为例演示如何连接到 GreptimeDB。 + + + + ```java + public static Connection getConnection() throws IOException, ClassNotFoundException, SQLException { + Properties prop = new Properties(); + prop.load(QueryJDBC.class.getResourceAsStream("/db-connection.properties")); + + String dbName = (String) prop.get("db.database-driver"); + String dbConnUrl = (String) prop.get("db.url"); + String dbUserName = (String) prop.get("db.username"); + String dbPassword = (String) prop.get("db.password"); + + Class.forName(dbName); + Connection dbConn = DriverManager.getConnection(dbConnUrl, dbUserName, dbPassword); + + return Objects.requireNonNull(dbConn, "Failed to make connection!"); + } + ``` + + 你需要一个 properties 文件来存储数据库连接信息,将其放在 Resources 目录中并命名为 `db-connection.properties`。文件内容如下: + + ```txt + # DataSource + db.database-driver=com.mysql.cj.jdbc.Driver + db.url=jdbc:mysql://localhost:4002/public + db.username= + db.password= + ``` + + 或者你可以从[这里](https://github.com/GreptimeTeam/greptimedb-ingester-java/blob/main/ingester-example/src/main/resources/db-connection.properties)获取文件。 + + + ```go + type Mysql struct { + Host string + Port string + User string + Password string + Database string + + DB *gorm.DB + } + + m := &Mysql{ + Host: "127.0.0.1", + Port: "4002", // default port for MySQL + User: "username", + Password: "password", + Database: "public", + } + + dsn := fmt.Sprintf("tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local", + m.Host, m.Port, m.Database) + dsn = fmt.Sprintf("%s:%s@%s", m.User, m.Password, dsn) + db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{}) + if err != nil { + // error handling + } + m.DB = db + ``` + + + +#### 时区 + + + + 通过设置 URL 参数来设置 JDBC 时区: + + ```txt + jdbc:mysql://127.0.0.1:4002?connectionTimeZone=Asia/Shanghai&forceConnectionTimeZoneToSession=true + ``` + * `connectionTimeZone={LOCAL|SERVER|user-defined-time-zone}` 配置连接时区。 + * `forceConnectionTimeZoneToSession=true` 使 session `time_zone` 变量被设置为 `connectionTimeZone` 指定的值。 + + + 在 DSN 中设置时区。例如,将时区设置为 `Asia/Shanghai`: + + ```go + dsn := fmt.Sprintf("tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local&time_zone=%27Asia%2FShanghai%27", + m.Host, m.Port, m.Database) + ``` + + 更多信息请参考 [MySQL Driver 文档](https://github.com/go-sql-driver/mysql?tab=readme-ov-file#system-variables)。 + + + +### Raw SQL + +推荐使用 Raw SQL 来体验 GreptimeDB 的全部功能。 +下面的例子展示了如何使用 Raw SQL 查询数据: + + + + ```java + try (Connection conn = getConnection()) { + Statement statement = conn.createStatement(); + + // DESC table; + ResultSet rs = statement.executeQuery("DESC cpu_metric"); + LOG.info("Column | Type | Key | Null | Default | Semantic Type "); + while (rs.next()) { + LOG.info("{} | {} | {} | {} | {} | {}", + rs.getString(1), + rs.getString(2), + rs.getString(3), + rs.getString(4), + rs.getString(5), + rs.getString(6)); + } + + // SELECT COUNT(*) FROM cpu_metric; + rs = statement.executeQuery("SELECT COUNT(*) FROM cpu_metric"); + while (rs.next()) { + LOG.info("Count: {}", rs.getInt(1)); + } + + // SELECT * FROM cpu_metric ORDER BY ts DESC LIMIT 5; + rs = statement.executeQuery("SELECT * FROM cpu_metric ORDER BY ts DESC LIMIT 5"); + LOG.info("host | ts | cpu_user | cpu_sys"); + while (rs.next()) { + LOG.info("{} | {} | {} | {}", + rs.getString("host"), + rs.getTimestamp("ts"), + rs.getDouble("cpu_user"), + rs.getDouble("cpu_sys")); + } + } + ``` + + 请参考[此处](https://github.com/GreptimeTeam/greptimedb-ingester-java/blob/main/ingester-example/src/main/java/io/greptime/QueryJDBC.java)获取直接可执行的代码。 + + + The following code declares a GORM object model: + + ```go + type CpuMetric struct { + Host string `gorm:"column:host;primaryKey"` + Ts time.Time `gorm:"column:ts;primaryKey"` + CpuUser float64 `gorm:"column:cpu_user"` + CpuSys float64 `gorm:"column:cpu_sys"` + } + ``` + + 如果你正在使用[高层级 API](/user-guide/ingest-data/for-iot/grpc-sdks/go.md#高层级-api) 来插入数据,你可以在模型中同时声明 GORM 和 GreptimeDB Tag。 + + ```go + type CpuMetric struct { + Host string `gorm:"column:host;primaryKey" greptime:"tag;column:host;type:string"` + Ts time.Time `gorm:"column:ts;primaryKey" greptime:"timestamp;column:ts;type:timestamp;precision:millisecond"` + CpuUser float64 `gorm:"column:cpu_user" greptime:"field;column:cpu_user;type:float64"` + CpuSys float64 `gorm:"column:cpu_sys" greptime:"field;column:cpu_sys;type:float64"` + } + ``` + + 声明表名: + + ```go + func (CpuMetric) TableName() string { + return "cpu_metric" + } + ``` + + 使用 Raw SQL 查询数据: + + ```go + var cpuMetric CpuMetric + db.Raw("SELECT * FROM cpu_metric LIMIT 10").Scan(&result) + ``` + + + +### 查询库参考 + +有关如何使用查询库的更多信息,请参考相应库的文档: + + + + - [JDBC 在线教程](https://docs.oracle.com/javase/tutorial/jdbc/basics/index.html) + + + - [GORM](https://gorm.io/docs/index.html) + + + +## 命令行工具 + +### MySQL + +你可以使用 `mysql` 命令行工具连接到 GreptimeDB。 +请参考 [MySQL 协议](/user-guide/protocols/mysql.md) 文档获取连接信息。 + +连接到服务器后,你可以使用所有 [GreptimeDB SQL 命令](/reference/sql/overview.md)与数据库交互。 + +### PostgreSQL + +你可以使用 `psql` 命令行工具连接到 GreptimeDB。 +请参考 [PostgreSQL 协议](/user-guide/protocols/postgresql.md) 文档获取连接信息。 + +连接到服务器后,你可以使用所有 [GreptimeDB SQL 命令](/reference/sql/overview.md)与数据库交互。 + +## GreptimeDB 控制台 + +你可以在 [Greptime 控制台](/getting-started/installation/greptimedb-dashboard.md)中运行 SQL 并可视化数据。 + + + +## HTTP API + +你可以将 POST SQL 到 GreptimeDB HTTP API 以查询数据。 +请参考 [HTTP API](/user-guide/protocols/http.md) 文档获取更多信息。 + diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/go.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/go.md index 8023409fb..f95d183b9 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/go.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/go.md @@ -200,118 +200,4 @@ affected, err := cli.CloseStream(ctx) - - - -
- -使用下方的命令安装 GORM: - -```shell -go get -u gorm.io/gorm -``` - -以 MySQL 为例安装 driver: - -```shell -go get -u gorm.io/driver/mysql -``` - -引入到代码中: - -```go -import ( - "gorm.io/gorm" - "gorm.io/driver/mysql" -) -``` - -
- - -
- -```go -type Mysql struct { - Host string - Port string - User string - Password string - Database string - - DB *gorm.DB -} - -m := &Mysql{ - Host: "127.0.0.1", - Port: "4002", // MySQL 协议的默认端口 - User: "username", - Password: "password", - Database: "public", -} - -dsn := fmt.Sprintf("tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local", - m.Host, m.Port, m.Database) -dsn = fmt.Sprintf("%s:%s@%s", m.User, m.Password, dsn) -db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{}) -if err != nil { - // 错误处理 -} -m.DB = db -``` -
- -
- -下方的代码声明了一个 GORM 对象模型: - -```go -type CpuMetric struct { - Host string `gorm:"column:host;primaryKey"` - Ts time.Time `gorm:"column:ts;primaryKey"` - CpuUser float64 `gorm:"column:cpu_user"` - CpuSys float64 `gorm:"column:cpu_sys"` -} -``` - -如果你正在使用 [ORM API](#orm-api) 来插入数据,你可以在模型中同时声明 GORM 和 Greptime 标签。 - -```go -type CpuMetric struct { - Host string `gorm:"column:host;primaryKey" greptime:"tag;column:host;type:string"` - Ts time.Time `gorm:"column:ts;primaryKey" greptime:"timestamp;column:ts;type:timestamp;precision:millisecond"` - CpuUser float64 `gorm:"column:cpu_user" greptime:"field;column:cpu_user;type:float64"` - CpuSys float64 `gorm:"column:cpu_sys" greptime:"field;column:cpu_sys;type:float64"` -} -``` - -声明表名: - -```go -func (CpuMetric) TableName() string { - return "cpu_metric" -} -``` - -使用原始 SQL 查询数据: - -```go -var cpuMetric CpuMetric -db.Raw("SELECT * FROM cpu_metric LIMIT 10").Scan(&result) - -``` - -
- - - - - \ No newline at end of file + diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/java.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/java.md index 4fa4dc4ea..c450e904f 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/java.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/java.md @@ -310,126 +310,5 @@ Java SDK 提供了用于调试的指标和日志。 - [API 文档](https://javadoc.io/doc/io.greptime/ingester-protocol/latest/index.html) - diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/template.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/template.md index dc0d90adf..bd496e520 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/template.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/template.md @@ -92,34 +92,3 @@ SDK 的高层级 API 使用 ORM 风格的对象写入数据, - diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/overview.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/overview.md index e3e188f93..aa8a35581 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/overview.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/overview.md @@ -10,11 +10,12 @@ * [View](./view.md) * [公共表表达式(CTE)](./cte.md) - +由于 GreptimeDB 使用 SQL 作为主要查询语言,并支持 [MySQL](/user-guide/protocols/mysql.md) 和 [PostgreSQL](/user-guide/protocols/postgresql.md) 协议, +你可以使用支持 MySQL 或 PostgreSQL 的成熟 SQL Driver 来查询数据。 + +有关更多信息,请参考[SQL 工具](/reference/sql-tools.md)文档。 ## 查询外部数据 diff --git a/sidebars.ts b/sidebars.ts index 3204b8898..35c1d8050 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -286,6 +286,7 @@ const sidebars: SidebarsConfig = { label: 'Reference', items: [ 'reference/command-lines', + 'reference/sql-tools', { type: 'category', label: 'SQL',