blob: 4c09ae367cd9cbdb5407a5776279790813b0974c [file] [log] [blame]
<!doctype html><html itemscope itemtype=http://schema.org/WebPage lang=cn class=no-js><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=robots content="index, follow"><link rel="shortcut icon" href=/favicons/favicon.ico><link rel=apple-touch-icon href=/favicons/apple-touch-icon-180x180.png sizes=180x180><link rel=icon type=image/png href=/favicons/favicon-16x16.png sizes=16x16><link rel=icon type=image/png href=/favicons/favicon-32x32.png sizes=32x32><link rel=icon type=image/png href=/favicons/android-36x36.png sizes=36x36><link rel=icon type=image/png href=/favicons/android-48x48.png sizes=48x48><link rel=icon type=image/png href=/favicons/android-72x72.png sizes=72x72><link rel=icon type=image/png href=/favicons/android-96x96.png sizes=96x96><link rel=icon type=image/png href=/favicons/android-144x144.png sizes=144x144><link rel=icon type=image/png href=/favicons/android-192x192.png sizes=192x192><title>快速开始 | Apache HoraeDB</title>
<meta name=description content="本章介绍如何快速启动 HoraeDB。在这里你将会学到启动一个单机模式的 HoraeDB,然后使用 SQL 写入一些数据并查询结果。
启动 使用 HoraeDB docker 镜像 是一种最简单的启动方式;如果你还没有安装 Docker,请首先参考 这里 安装 Docker。
注意:请选择一个大于等于 v1.0.0 的 tag 镜像。
使用如下命令安装并启动一个单机版 HoraeDB。
1 2 3 4 5 docker run -d --name horaedb-server \ -p 8831:8831 \ -p 3307:3307 \ -p 5440:5440 \ apache/horaedb-server 启动后 HoraeDB 会监听如下端口:
8831, gRPC port 3307, MySQL port 5440, HTTP port HTTP 协议是最简单的交互方式,接下来的演示会使用 HTTP 协议进行介绍。不过在生产环境,我们推荐使用 gRPC/MySQL。"><meta property="og:url" content="https://horaedb.apache.org/cn/docs/getting-started/"><meta property="og:site_name" content="Apache HoraeDB"><meta property="og:title" content="快速开始"><meta property="og:description" content="本章介绍如何快速启动 HoraeDB。在这里你将会学到启动一个单机模式的 HoraeDB,然后使用 SQL 写入一些数据并查询结果。
启动 使用 HoraeDB docker 镜像 是一种最简单的启动方式;如果你还没有安装 Docker,请首先参考 这里 安装 Docker。
注意:请选择一个大于等于 v1.0.0 的 tag 镜像。
使用如下命令安装并启动一个单机版 HoraeDB。
1 2 3 4 5 docker run -d --name horaedb-server \ -p 8831:8831 \ -p 3307:3307 \ -p 5440:5440 \ apache/horaedb-server 启动后 HoraeDB 会监听如下端口:
8831, gRPC port 3307, MySQL port 5440, HTTP port HTTP 协议是最简单的交互方式,接下来的演示会使用 HTTP 协议进行介绍。不过在生产环境,我们推荐使用 gRPC/MySQL。"><meta property="og:locale" content="cn"><meta property="og:type" content="article"><meta property="article:section" content="docs"><meta property="article:modified_time" content="2024-11-26T16:02:31+08:00"><meta itemprop=name content="快速开始"><meta itemprop=description content="本章介绍如何快速启动 HoraeDB。在这里你将会学到启动一个单机模式的 HoraeDB,然后使用 SQL 写入一些数据并查询结果。
启动 使用 HoraeDB docker 镜像 是一种最简单的启动方式;如果你还没有安装 Docker,请首先参考 这里 安装 Docker。
注意:请选择一个大于等于 v1.0.0 的 tag 镜像。
使用如下命令安装并启动一个单机版 HoraeDB。
1 2 3 4 5 docker run -d --name horaedb-server \ -p 8831:8831 \ -p 3307:3307 \ -p 5440:5440 \ apache/horaedb-server 启动后 HoraeDB 会监听如下端口:
8831, gRPC port 3307, MySQL port 5440, HTTP port HTTP 协议是最简单的交互方式,接下来的演示会使用 HTTP 协议进行介绍。不过在生产环境,我们推荐使用 gRPC/MySQL。"><meta itemprop=dateModified content="2024-11-26T16:02:31+08:00"><meta itemprop=wordCount content="246"><meta name=twitter:card content="summary"><meta name=twitter:title content="快速开始"><meta name=twitter:description content="本章介绍如何快速启动 HoraeDB。在这里你将会学到启动一个单机模式的 HoraeDB,然后使用 SQL 写入一些数据并查询结果。
启动 使用 HoraeDB docker 镜像 是一种最简单的启动方式;如果你还没有安装 Docker,请首先参考 这里 安装 Docker。
注意:请选择一个大于等于 v1.0.0 的 tag 镜像。
使用如下命令安装并启动一个单机版 HoraeDB。
1 2 3 4 5 docker run -d --name horaedb-server \ -p 8831:8831 \ -p 3307:3307 \ -p 5440:5440 \ apache/horaedb-server 启动后 HoraeDB 会监听如下端口:
8831, gRPC port 3307, MySQL port 5440, HTTP port HTTP 协议是最简单的交互方式,接下来的演示会使用 HTTP 协议进行介绍。不过在生产环境,我们推荐使用 gRPC/MySQL。"><link rel=preload href=/scss/main.min.5e43f8574351718e9b44966c9f3a571202ed048c082f457fb574c10b1a1bc56c.css as=style integrity="sha256-XkP4V0NRcY6bRJZsnzpXEgLtBIwIL0V/tXTBCxobxWw=" crossorigin=anonymous><link href=/scss/main.min.5e43f8574351718e9b44966c9f3a571202ed048c082f457fb574c10b1a1bc56c.css rel=stylesheet integrity="sha256-XkP4V0NRcY6bRJZsnzpXEgLtBIwIL0V/tXTBCxobxWw=" crossorigin=anonymous><script src=https://code.jquery.com/jquery-3.7.1.min.js integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin=anonymous></script><script defer src=https://unpkg.com/lunr@2.3.9/lunr.min.js integrity=sha384-203J0SNzyqHby3iU6hzvzltrWi/M41wOP5Gu+BiJMz5nwKykbkUx8Kp7iti0Lpli crossorigin=anonymous></script></head><body class=td-page><header><nav class="td-navbar js-navbar-scroll" data-bs-theme=dark><div class="container-fluid flex-column flex-md-row"><a class=navbar-brand href=/cn/><span class="navbar-brand__logo navbar-logo"></span><span class=navbar-brand__name>Apache HoraeDB</span></a><div class="td-navbar-nav-scroll ms-md-auto" id=main_navbar><ul class=navbar-nav><li class=nav-item><a class="nav-link active" href=/cn/docs/><i class='fa-solid fa-book'></i><span>文档</span></a></li><li class=nav-item><a class=nav-link href=/cn/downloads/><i class='fa-solid fa-download'></i><span>下载</span></a></li><li class=nav-item><a class=nav-link href=/cn/blog/><i class='fa-brands fa-blogger'></i><span>博客</span></a></li><li class="nav-item dropdown d-none d-lg-block"><div class=dropdown><a class="nav-link dropdown-toggle" href=# role=button data-bs-toggle=dropdown aria-haspopup=true aria-expanded=false>中文</a><ul class=dropdown-menu><li><a class=dropdown-item href=/docs/getting-started/>English</a></li></ul></div></li><li class="td-light-dark-menu nav-item dropdown"><svg class="d-none"><symbol id="check2" viewBox="0 0 16 16"><path d="M13.854 3.646a.5.5.0 010 .708l-7 7a.5.5.0 01-.708.0l-3.5-3.5a.5.5.0 11.708-.708L6.5 10.293l6.646-6.647a.5.5.0 01.708.0z"/></symbol><symbol id="circle-half" viewBox="0 0 16 16"><path d="M8 15A7 7 0 108 1v14zm0 1A8 8 0 118 0a8 8 0 010 16z"/></symbol><symbol id="moon-stars-fill" viewBox="0 0 16 16"><path d="M6 .278a.768.768.0 01.08.858 7.208 7.208.0 00-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527.0 1.04-.055 1.533-.16a.787.787.0 01.81.316.733.733.0 01-.031.893A8.349 8.349.0 018.344 16C3.734 16 0 12.286.0 7.71.0 4.266 2.114 1.312 5.124.06A.752.752.0 016 .278z"/><path d="M10.794 3.148a.217.217.0 01.412.0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217.0 010 .412l-1.162.387A1.734 1.734.0 0011.593 7.69l-.387 1.162a.217.217.0 01-.412.0l-.387-1.162A1.734 1.734.0 009.31 6.593l-1.162-.387a.217.217.0 010-.412l1.162-.387a1.734 1.734.0 001.097-1.097l.387-1.162zM13.863.099a.145.145.0 01.274.0l.258.774c.115.346.386.617.732.732l.774.258a.145.145.0 010 .274l-.774.258a1.156 1.156.0 00-.732.732l-.258.774a.145.145.0 01-.274.0l-.258-.774a1.156 1.156.0 00-.732-.732l-.774-.258a.145.145.0 010-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z"/></symbol><symbol id="sun-fill" viewBox="0 0 16 16"><path d="M8 12a4 4 0 100-8 4 4 0 000 8zM8 0a.5.5.0 01.5.5v2a.5.5.0 01-1 0v-2A.5.5.0 018 0zm0 13a.5.5.0 01.5.5v2a.5.5.0 01-1 0v-2A.5.5.0 018 13zm8-5a.5.5.0 01-.5.5h-2a.5.5.0 010-1h2a.5.5.0 01.5.5zM3 8a.5.5.0 01-.5.5h-2a.5.5.0 010-1h2A.5.5.0 013 8zm10.657-5.657a.5.5.0 010 .707l-1.414 1.415a.5.5.0 11-.707-.708l1.414-1.414a.5.5.0 01.707.0zm-9.193 9.193a.5.5.0 010 .707L3.05 13.657a.5.5.0 01-.707-.707l1.414-1.414a.5.5.0 01.707.0zm9.193 2.121a.5.5.0 01-.707.0l-1.414-1.414a.5.5.0 01.707-.707l1.414 1.414a.5.5.0 010 .707zM4.464 4.465a.5.5.0 01-.707.0L2.343 3.05a.5.5.0 11.707-.707l1.414 1.414a.5.5.0 010 .708z"/></symbol></svg>
<button class="btn btn-link nav-link dropdown-toggle d-flex align-items-center" id=bd-theme type=button aria-expanded=false data-bs-toggle=dropdown data-bs-display=static aria-label="Toggle theme (auto)"><svg class="bi my-1 theme-icon-active"><use href="#circle-half"/></svg></button><ul class="dropdown-menu dropdown-menu-end" aria-labelledby=bd-theme-text><li><button type=button class="dropdown-item d-flex align-items-center" data-bs-theme-value=light aria-pressed=false>
<svg class="bi me-2 opacity-50"><use href="#sun-fill"/></svg>
Light<svg class="bi ms-auto d-none"><use href="#check2"/></svg></button></li><li><button type=button class="dropdown-item d-flex align-items-center" data-bs-theme-value=dark aria-pressed=false>
<svg class="bi me-2 opacity-50"><use href="#moon-stars-fill"/></svg>
Dark<svg class="bi ms-auto d-none"><use href="#check2"/></svg></button></li><li><button type=button class="dropdown-item d-flex align-items-center active" data-bs-theme-value=auto aria-pressed=true>
<svg class="bi me-2 opacity-50"><use href="#circle-half"/></svg>
Auto<svg class="bi ms-auto d-none"><use href="#check2"/></svg></button></li></ul></li></ul></div><div class="d-none d-lg-block"><div class="td-search td-search--offline"><div class=td-search__icon></div><input type=search class="td-search__input form-control" placeholder="Search this site…" aria-label="Search this site…" autocomplete=off data-offline-search-index-json-src=/offline-search-index.50067a676aae922ae836785e3626a1aa.json data-offline-search-base-href=/ data-offline-search-max-results=10></div></div></div></nav></header><div class="container-fluid td-outer"><div class=td-main><div class="row flex-xl-nowrap"><aside class="col-12 col-md-3 col-xl-2 td-sidebar d-print-none"><div id=td-sidebar-menu class=td-sidebar__inner><form class="td-sidebar__search d-flex align-items-center"><div class="td-search td-search--offline"><div class=td-search__icon></div><input type=search class="td-search__input form-control" placeholder="Search this site…" aria-label="Search this site…" autocomplete=off data-offline-search-index-json-src=/offline-search-index.50067a676aae922ae836785e3626a1aa.json data-offline-search-base-href=/ data-offline-search-max-results=10></div><button class="btn btn-link td-sidebar__toggle d-md-none p-0 ms-3 fas fa-bars" type=button data-bs-toggle=collapse data-bs-target=#td-section-nav aria-controls=td-section-nav aria-expanded=false aria-label="Toggle section navigation"></button></form><nav class="td-sidebar-nav collapse foldable-nav" id=td-section-nav><div class="td-sidebar-nav__section nav-item dropdown d-block d-lg-none"><div class=dropdown><a class="nav-link dropdown-toggle" href=# role=button data-bs-toggle=dropdown aria-haspopup=true aria-expanded=false>中文</a><ul class=dropdown-menu><li><a class=dropdown-item href=/docs/getting-started/>English</a></li></ul></div></div><ul class="td-sidebar-nav__section pe-md-3 ul-0"><li class="td-sidebar-nav__section-title td-sidebar-nav__section with-child active-path" id=m-cndocs-li><a href=/cn/docs/ class="align-left ps-0 td-sidebar-link td-sidebar-link__section tree-root" id=m-cndocs><span>文档</span></a><ul class=ul-1><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child active-path" id=m-cndocsgetting-started-li><input type=checkbox id=m-cndocsgetting-started-check checked>
<label for=m-cndocsgetting-started-check><a href=/cn/docs/getting-started/ class="align-left ps-0 active td-sidebar-link td-sidebar-link__page" id=m-cndocsgetting-started><span class=td-sidebar-nav-active-item>快速开始</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section with-child" id=m-cndocsuser-guide-li><input type=checkbox id=m-cndocsuser-guide-check>
<label for=m-cndocsuser-guide-check><a href=/cn/docs/user-guide/ class="align-left ps-0 td-sidebar-link td-sidebar-link__section" id=m-cndocsuser-guide><span>用户指南</span></a></label><ul class="ul-2 foldable"><li class="td-sidebar-nav__section-title td-sidebar-nav__section with-child" id=m-cndocsuser-guidesql-li><input type=checkbox id=m-cndocsuser-guidesql-check>
<label for=m-cndocsuser-guidesql-check><a href=/cn/docs/user-guide/sql/ class="align-left ps-0 td-sidebar-link td-sidebar-link__section" id=m-cndocsuser-guidesql><span>SQL 语法</span></a></label><ul class="ul-3 foldable"><li class="td-sidebar-nav__section-title td-sidebar-nav__section with-child" id=m-cndocsuser-guidesqlmodel-li><input type=checkbox id=m-cndocsuser-guidesqlmodel-check>
<label for=m-cndocsuser-guidesqlmodel-check><a href=/cn/docs/user-guide/sql/model/ class="align-left ps-0 td-sidebar-link td-sidebar-link__section" id=m-cndocsuser-guidesqlmodel><span>数据模型</span></a></label><ul class="ul-4 foldable"><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guidesqlmodeldata_types-li><input type=checkbox id=m-cndocsuser-guidesqlmodeldata_types-check>
<label for=m-cndocsuser-guidesqlmodeldata_types-check><a href=/cn/docs/user-guide/sql/model/data_types/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guidesqlmodeldata_types><span>数据类型</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guidesqlmodelspecial_columns-li><input type=checkbox id=m-cndocsuser-guidesqlmodelspecial_columns-check>
<label for=m-cndocsuser-guidesqlmodelspecial_columns-check><a href=/cn/docs/user-guide/sql/model/special_columns/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guidesqlmodelspecial_columns><span>特殊字段</span></a></label></li></ul></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guidesqlidentifier-li><input type=checkbox id=m-cndocsuser-guidesqlidentifier-check>
<label for=m-cndocsuser-guidesqlidentifier-check><a href=/cn/docs/user-guide/sql/identifier/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guidesqlidentifier><span>标识符</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section with-child" id=m-cndocsuser-guidesqlddl-li><input type=checkbox id=m-cndocsuser-guidesqlddl-check>
<label for=m-cndocsuser-guidesqlddl-check><a href=/cn/docs/user-guide/sql/ddl/ class="align-left ps-0 td-sidebar-link td-sidebar-link__section" id=m-cndocsuser-guidesqlddl><span>表结构操作</span></a></label><ul class="ul-4 foldable"><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guidesqlddlalter_table-li><input type=checkbox id=m-cndocsuser-guidesqlddlalter_table-check>
<label for=m-cndocsuser-guidesqlddlalter_table-check><a href=/cn/docs/user-guide/sql/ddl/alter_table/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guidesqlddlalter_table><span>ALTER TABLE</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guidesqlddldrop_table-li><input type=checkbox id=m-cndocsuser-guidesqlddldrop_table-check>
<label for=m-cndocsuser-guidesqlddldrop_table-check><a href=/cn/docs/user-guide/sql/ddl/drop_table/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guidesqlddldrop_table><span>DROP TABLE</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guidesqlddlcreate_table-li><input type=checkbox id=m-cndocsuser-guidesqlddlcreate_table-check>
<label for=m-cndocsuser-guidesqlddlcreate_table-check><a href=/cn/docs/user-guide/sql/ddl/create_table/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guidesqlddlcreate_table><span>创建表</span></a></label></li></ul></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section with-child" id=m-cndocsuser-guidesqldml-li><input type=checkbox id=m-cndocsuser-guidesqldml-check>
<label for=m-cndocsuser-guidesqldml-check><a href=/cn/docs/user-guide/sql/dml/ class="align-left ps-0 td-sidebar-link td-sidebar-link__section" id=m-cndocsuser-guidesqldml><span>数据操作</span></a></label><ul class="ul-4 foldable"><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guidesqldmlinsert-li><input type=checkbox id=m-cndocsuser-guidesqldmlinsert-check>
<label for=m-cndocsuser-guidesqldmlinsert-check><a href=/cn/docs/user-guide/sql/dml/insert/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guidesqldmlinsert><span>INSERT</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guidesqldmlselect-li><input type=checkbox id=m-cndocsuser-guidesqldmlselect-check>
<label for=m-cndocsuser-guidesqldmlselect-check><a href=/cn/docs/user-guide/sql/dml/select/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guidesqldmlselect><span>SELECT</span></a></label></li></ul></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guidesqlutility-li><input type=checkbox id=m-cndocsuser-guidesqlutility-check>
<label for=m-cndocsuser-guidesqlutility-check><a href=/cn/docs/user-guide/sql/utility/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guidesqlutility><span>常用 SQL</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guidesqlengine_options-li><input type=checkbox id=m-cndocsuser-guidesqlengine_options-check>
<label for=m-cndocsuser-guidesqlengine_options-check><a href=/cn/docs/user-guide/sql/engine_options/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guidesqlengine_options><span>配置项</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guidesqlscalar_functions-li><input type=checkbox id=m-cndocsuser-guidesqlscalar_functions-check>
<label for=m-cndocsuser-guidesqlscalar_functions-check><a href=/cn/docs/user-guide/sql/scalar_functions/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guidesqlscalar_functions><span>标量函数</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guidesqlaggregate_functions-li><input type=checkbox id=m-cndocsuser-guidesqlaggregate_functions-check>
<label for=m-cndocsuser-guidesqlaggregate_functions-check><a href=/cn/docs/user-guide/sql/aggregate_functions/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guidesqlaggregate_functions><span>聚合函数</span></a></label></li></ul></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section with-child" id=m-cndocsuser-guidecluster_deployment-li><input type=checkbox id=m-cndocsuser-guidecluster_deployment-check>
<label for=m-cndocsuser-guidecluster_deployment-check><a href=/cn/docs/user-guide/cluster_deployment/ class="align-left ps-0 td-sidebar-link td-sidebar-link__section" id=m-cndocsuser-guidecluster_deployment><span>集群部署</span></a></label><ul class="ul-3 foldable"><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guidecluster_deploymentno_meta-li><input type=checkbox id=m-cndocsuser-guidecluster_deploymentno_meta-check>
<label for=m-cndocsuser-guidecluster_deploymentno_meta-check><a href=/cn/docs/user-guide/cluster_deployment/no_meta/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guidecluster_deploymentno_meta><span>NoMeta 模式</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guidecluster_deploymentwith_meta-li><input type=checkbox id=m-cndocsuser-guidecluster_deploymentwith_meta-check>
<label for=m-cndocsuser-guidecluster_deploymentwith_meta-check><a href=/cn/docs/user-guide/cluster_deployment/with_meta/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guidecluster_deploymentwith_meta><span>WithMeta 模式</span></a></label></li></ul></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section with-child" id=m-cndocsuser-guidesdk-li><input type=checkbox id=m-cndocsuser-guidesdk-check>
<label for=m-cndocsuser-guidesdk-check><a href=/cn/docs/user-guide/sdk/ class="align-left ps-0 td-sidebar-link td-sidebar-link__section" id=m-cndocsuser-guidesdk><span>SDK 文档</span></a></label><ul class="ul-3 foldable"><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guidesdkgo-li><input type=checkbox id=m-cndocsuser-guidesdkgo-check>
<label for=m-cndocsuser-guidesdkgo-check><a href=/cn/docs/user-guide/sdk/go/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guidesdkgo><span>Go</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guidesdkjava-li><input type=checkbox id=m-cndocsuser-guidesdkjava-check>
<label for=m-cndocsuser-guidesdkjava-check><a href=/cn/docs/user-guide/sdk/java/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guidesdkjava><span>Java</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guidesdkpython-li><input type=checkbox id=m-cndocsuser-guidesdkpython-check>
<label for=m-cndocsuser-guidesdkpython-check><a href=/cn/docs/user-guide/sdk/python/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guidesdkpython><span>Python</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guidesdkrust-li><input type=checkbox id=m-cndocsuser-guidesdkrust-check>
<label for=m-cndocsuser-guidesdkrust-check><a href=/cn/docs/user-guide/sdk/rust/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guidesdkrust><span>Rust</span></a></label></li></ul></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section with-child" id=m-cndocsuser-guideoperation-li><input type=checkbox id=m-cndocsuser-guideoperation-check>
<label for=m-cndocsuser-guideoperation-check><a href=/cn/docs/user-guide/operation/ class="align-left ps-0 td-sidebar-link td-sidebar-link__section" id=m-cndocsuser-guideoperation><span>运维文档</span></a></label><ul class="ul-3 foldable"><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guideoperationobservability-li><input type=checkbox id=m-cndocsuser-guideoperationobservability-check>
<label for=m-cndocsuser-guideoperationobservability-check><a href=/cn/docs/user-guide/operation/observability/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guideoperationobservability><span>监控</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guideoperationsystem_table-li><input type=checkbox id=m-cndocsuser-guideoperationsystem_table-check>
<label for=m-cndocsuser-guideoperationsystem_table-check><a href=/cn/docs/user-guide/operation/system_table/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guideoperationsystem_table><span>系统表</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guideoperationtable-li><input type=checkbox id=m-cndocsuser-guideoperationtable-check>
<label for=m-cndocsuser-guideoperationtable-check><a href=/cn/docs/user-guide/operation/table/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guideoperationtable><span>表操作</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guideoperationhoraemeta-li><input type=checkbox id=m-cndocsuser-guideoperationhoraemeta-check>
<label for=m-cndocsuser-guideoperationhoraemeta-check><a href=/cn/docs/user-guide/operation/horaemeta/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guideoperationhoraemeta><span>集群运维</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guideoperationblock_list-li><input type=checkbox id=m-cndocsuser-guideoperationblock_list-check>
<label for=m-cndocsuser-guideoperationblock_list-check><a href=/cn/docs/user-guide/operation/block_list/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guideoperationblock_list><span>黑名单</span></a></label></li></ul></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section with-child" id=m-cndocsuser-guideecosystem-li><input type=checkbox id=m-cndocsuser-guideecosystem-check>
<label for=m-cndocsuser-guideecosystem-check><a href=/cn/docs/user-guide/ecosystem/ class="align-left ps-0 td-sidebar-link td-sidebar-link__section" id=m-cndocsuser-guideecosystem><span>周边生态</span></a></label><ul class="ul-3 foldable"><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guideecosysteminfluxdb-li><input type=checkbox id=m-cndocsuser-guideecosysteminfluxdb-check>
<label for=m-cndocsuser-guideecosysteminfluxdb-check><a href=/cn/docs/user-guide/ecosystem/influxdb/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guideecosysteminfluxdb><span>InfluxDB</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guideecosystemopentsdb-li><input type=checkbox id=m-cndocsuser-guideecosystemopentsdb-check>
<label for=m-cndocsuser-guideecosystemopentsdb-check><a href=/cn/docs/user-guide/ecosystem/opentsdb/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guideecosystemopentsdb><span>OpenTSDB</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsuser-guideecosystemprometheus-li><input type=checkbox id=m-cndocsuser-guideecosystemprometheus-check>
<label for=m-cndocsuser-guideecosystemprometheus-check><a href=/cn/docs/user-guide/ecosystem/prometheus/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsuser-guideecosystemprometheus><span>Prometheus</span></a></label></li></ul></li></ul></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section with-child" id=m-cndocsdev-li><input type=checkbox id=m-cndocsdev-check>
<label for=m-cndocsdev-check><a href=/cn/docs/dev/ class="align-left ps-0 td-sidebar-link td-sidebar-link__section" id=m-cndocsdev><span>开发手册</span></a></label><ul class="ul-2 foldable"><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsdevplatform-li><input type=checkbox id=m-cndocsdevplatform-check>
<label for=m-cndocsdevplatform-check><a href=/cn/docs/dev/platform/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsdevplatform><span>支持平台</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsdevcompile_run-li><input type=checkbox id=m-cndocsdevcompile_run-check>
<label for=m-cndocsdevcompile_run-check><a href=/cn/docs/dev/compile_run/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsdevcompile_run><span>编译</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsdevprofiling-li><input type=checkbox id=m-cndocsdevprofiling-check>
<label for=m-cndocsdevprofiling-check><a href=/cn/docs/dev/profiling/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsdevprofiling><span>性能诊断</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsdevroadmap-li><input type=checkbox id=m-cndocsdevroadmap-check>
<label for=m-cndocsdevroadmap-check><a href=/cn/docs/dev/roadmap/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsdevroadmap><span>RoadMap</span></a></label></li></ul></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section with-child" id=m-cndocsdesign-li><input type=checkbox id=m-cndocsdesign-check>
<label for=m-cndocsdesign-check><a href=/cn/docs/design/ class="align-left ps-0 td-sidebar-link td-sidebar-link__section" id=m-cndocsdesign><span>设计文档</span></a></label><ul class="ul-2 foldable"><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsdesignarchitecture-li><input type=checkbox id=m-cndocsdesignarchitecture-check>
<label for=m-cndocsdesignarchitecture-check><a href=/cn/docs/design/architecture/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsdesignarchitecture><span>HoraeDB 架构介绍</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsdesignclustering-li><input type=checkbox id=m-cndocsdesignclustering-check>
<label for=m-cndocsdesignclustering-check><a href=/cn/docs/design/clustering/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsdesignclustering><span>集群模式</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsdesignstorage-li><input type=checkbox id=m-cndocsdesignstorage-check>
<label for=m-cndocsdesignstorage-check><a href=/cn/docs/design/storage/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsdesignstorage><span>存储引擎</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsdesignshared_nothing-li><input type=checkbox id=m-cndocsdesignshared_nothing-check>
<label for=m-cndocsdesignshared_nothing-check><a href=/cn/docs/design/shared_nothing/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsdesignshared_nothing><span>Shared Nothing 架构</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsdesigntable_partitioning-li><input type=checkbox id=m-cndocsdesigntable_partitioning-check>
<label for=m-cndocsdesigntable_partitioning-check><a href=/cn/docs/design/table_partitioning/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsdesigntable_partitioning><span>分区表</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsdesignwal_on_kafka-li><input type=checkbox id=m-cndocsdesignwal_on_kafka-check>
<label for=m-cndocsdesignwal_on_kafka-check><a href=/cn/docs/design/wal_on_kafka/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsdesignwal_on_kafka><span>基于 Kafka 的 WAL</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsdesignwal_on_rocksdb-li><input type=checkbox id=m-cndocsdesignwal_on_rocksdb-check>
<label for=m-cndocsdesignwal_on_rocksdb-check><a href=/cn/docs/design/wal_on_rocksdb/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsdesignwal_on_rocksdb><span>基于 RocksDB 的 WAL</span></a></label></li><li class="td-sidebar-nav__section-title td-sidebar-nav__section without-child" id=m-cndocsdesignwal_on_disk-li><input type=checkbox id=m-cndocsdesignwal_on_disk-check>
<label for=m-cndocsdesignwal_on_disk-check><a href=/cn/docs/design/wal_on_disk/ class="align-left ps-0 td-sidebar-link td-sidebar-link__page" id=m-cndocsdesignwal_on_disk><span>基于本地磁盘的 WAL</span></a></label></li></ul></li></ul></li></ul></nav></div></aside><aside class="d-none d-xl-block col-xl-2 td-sidebar-toc d-print-none"><div class="td-page-meta ms-2 pb-1 pt-2 mb-0"><a href=https://github.com/apache/horaedb-docs/tree/main/content/cn/docs/getting-started.md class="td-page-meta--view td-page-meta__view" target=_blank rel=noopener><i class="fa-solid fa-file-lines fa-fw"></i> View page source</a>
<a href=https://github.com/apache/horaedb-docs/edit/main/content/cn/docs/getting-started.md class="td-page-meta--edit td-page-meta__edit" target=_blank rel=noopener><i class="fa-solid fa-pen-to-square fa-fw"></i> Edit this page</a>
<a href="https://github.com/apache/horaedb-docs/new/main/content/cn/docs?filename=change-me.md&amp;value=---%0Atitle%3A+%22Long+Page+Title%22%0AlinkTitle%3A+%22Short+Nav+Title%22%0Aweight%3A+100%0Adescription%3A+%3E-%0A+++++Page+description+for+heading+and+indexes.%0A---%0A%0A%23%23+Heading%0A%0AEdit+this+template+to+create+your+new+page.%0A%0A%2A+Give+it+a+good+name%2C+ending+in+%60.md%60+-+e.g.+%60getting-started.md%60%0A%2A+Edit+the+%22front+matter%22+section+at+the+top+of+the+page+%28weight+controls+how+its+ordered+amongst+other+pages+in+the+same+directory%3B+lowest+number+first%29.%0A%2A+Add+a+good+commit+message+at+the+bottom+of+the+page+%28%3C80+characters%3B+use+the+extended+description+field+for+more+detail%29.%0A%2A+Create+a+new+branch+so+you+can+preview+your+new+file+and+request+a+review+via+Pull+Request.%0A" class="td-page-meta--child td-page-meta__child" target=_blank rel=noopener><i class="fa-solid fa-pen-to-square fa-fw"></i> Create child page</a>
<a href="https://github.com/apache/horaedb-docs/issues/new?title=%e5%bf%ab%e9%80%9f%e5%bc%80%e5%a7%8b" class="td-page-meta--issue td-page-meta__issue" target=_blank rel=noopener><i class="fa-solid fa-list-check fa-fw"></i> Create documentation issue</a>
<a href=https://github.com/apache/horaedb/issues/new class="td-page-meta--project td-page-meta__project-issue" target=_blank rel=noopener><i class="fa-solid fa-list-check fa-fw"></i> Create project issue</a>
<a id=print href=/cn/docs/_print/><i class="fa-solid fa-print fa-fw"></i> Print entire section</a></div><div class=td-toc><nav id=TableOfContents><ul><li><a href=#启动>启动</a><ul><li><a href=#自定义-docker-的配置>自定义 docker 的配置</a></li></ul></li><li><a href=#写入和查询数据>写入和查询数据</a><ul><li><a href=#建表>建表</a></li><li><a href=#写数据>写数据</a></li><li><a href=#查询>查询</a></li><li><a href=#展示建表语句>展示建表语句</a></li><li><a href=#删除表>删除表</a></li></ul></li><li><a href=#使用-sdk>使用 SDK</a></li><li><a href=#下一步>下一步</a></li></ul></nav></div><div class="taxonomy taxonomy-terms-cloud taxo-tags"><h5 class=taxonomy-title>Tags</h5><ul class=taxonomy-terms><li><a class=taxonomy-term href=https://horaedb.apache.org/cn/tags/community/ data-taxonomy-term=community><span class=taxonomy-label>Community</span><span class=taxonomy-count>7</span></a></li><li><a class=taxonomy-term href=https://horaedb.apache.org/cn/tags/release/ data-taxonomy-term=release><span class=taxonomy-label>Release</span><span class=taxonomy-count>2</span></a></li></ul></div></aside><main class="col-12 col-md-9 col-xl-8 ps-md-5" role=main><nav aria-label=breadcrumb class=td-breadcrumbs><ol class=breadcrumb><li class=breadcrumb-item><a href=/cn/docs/>文档</a></li><li class="breadcrumb-item active" aria-current=page>快速开始</li></ol></nav><div class=td-content><h1>快速开始</h1><header class=article-meta></header><p>本章介绍如何快速启动 HoraeDB。在这里你将会学到启动一个单机模式的 HoraeDB,然后使用 SQL 写入一些数据并查询结果。</p><h2 id=启动>启动</h2><p>使用 <a href=https://github.com/apache/incubator-horaedb/pkgs/container/horaedb-server>HoraeDB docker 镜像</a> 是一种最简单的启动方式;如果你还没有安装 Docker,请首先参考 <a href=https://www.docker.com/products/docker-desktop/>这里</a> 安装 Docker。</p><blockquote><p>注意:请选择一个大于等于 v1.0.0 的 tag 镜像。</p></blockquote><p>使用如下命令安装并启动一个单机版 HoraeDB。</p><div class=highlight><div style=-moz-tab-size:4;-o-tab-size:4;tab-size:4><table style=border-spacing:0;padding:0;margin:0;border:0><tr><td style=vertical-align:top;padding:0;margin:0;border:0><pre tabindex=0 style=-moz-tab-size:4;-o-tab-size:4;tab-size:4><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">1
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">2
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">3
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">4
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">5
</span></code></pre></td><td style=vertical-align:top;padding:0;margin:0;border:0;width:100%><pre tabindex=0 style=-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span>docker run -d --name horaedb-server <span style=color:#b62;font-weight:700>\
</span></span></span><span style=display:flex><span><span style=color:#b62;font-weight:700></span> -p 8831:8831 <span style=color:#b62;font-weight:700>\
</span></span></span><span style=display:flex><span><span style=color:#b62;font-weight:700></span> -p 3307:3307 <span style=color:#b62;font-weight:700>\
</span></span></span><span style=display:flex><span><span style=color:#b62;font-weight:700></span> -p 5440:5440 <span style=color:#b62;font-weight:700>\
</span></span></span><span style=display:flex><span><span style=color:#b62;font-weight:700></span> apache/horaedb-server
</span></span></code></pre></td></tr></table></div></div><p>启动后 HoraeDB 会监听如下端口:</p><ul><li>8831, gRPC port</li><li>3307, MySQL port</li><li>5440, HTTP port</li></ul><p><code>HTTP</code> 协议是最简单的交互方式,接下来的演示会使用 <code>HTTP</code> 协议进行介绍。不过在生产环境,我们推荐使用 <code>gRPC/MySQL</code></p><h3 id=自定义-docker-的配置>自定义 docker 的配置</h3><p>参考如下命令,可以自定义 docker 中 horaedb-server 的配置,并把数据目录 <code>/data</code> 挂载到 docker 母机的硬盘上。</p><pre tabindex=0><code>wget -c https://raw.githubusercontent.com/apache/incubator-horaedb/main/docs/minimal.toml -O horaedb.toml
sed -i &#39;s/\/tmp\/horaedb/\/data/g&#39; horaedb.toml
docker run -d --name horaedb-server \
-p 8831:8831 \
-p 3307:3307 \
-p 5440:5440 \
-v ./horaedb.toml:/etc/horaedb/horaedb.toml \
-v ./data:/data \
apache/horaedb-server
</code></pre><h2 id=写入和查询数据>写入和查询数据</h2><h3 id=建表>建表</h3><div class=highlight><div style=-moz-tab-size:4;-o-tab-size:4;tab-size:4><table style=border-spacing:0;padding:0;margin:0;border:0><tr><td style=vertical-align:top;padding:0;margin:0;border:0><pre tabindex=0 style=-moz-tab-size:4;-o-tab-size:4;tab-size:4><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">10
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">11
</span></code></pre></td><td style=vertical-align:top;padding:0;margin:0;border:0;width:100%><pre tabindex=0 style=-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span>curl --location --request POST <span style=color:#ba2121>&#39;http://127.0.0.1:5440/sql&#39;</span> <span style=color:#b62;font-weight:700>\
</span></span></span><span style=display:flex><span><span style=color:#b62;font-weight:700></span>-d <span style=color:#ba2121>&#39;
</span></span></span><span style=display:flex><span><span style=color:#ba2121>CREATE TABLE `demo` (
</span></span></span><span style=display:flex><span><span style=color:#ba2121> `name` string TAG,
</span></span></span><span style=display:flex><span><span style=color:#ba2121> `value` double NOT NULL,
</span></span></span><span style=display:flex><span><span style=color:#ba2121> `t` timestamp NOT NULL,
</span></span></span><span style=display:flex><span><span style=color:#ba2121> timestamp KEY (t))
</span></span></span><span style=display:flex><span><span style=color:#ba2121>ENGINE=Analytic
</span></span></span><span style=display:flex><span><span style=color:#ba2121> with
</span></span></span><span style=display:flex><span><span style=color:#ba2121>(enable_ttl=&#34;false&#34;)
</span></span></span><span style=display:flex><span><span style=color:#ba2121>&#39;</span>
</span></span></code></pre></td></tr></table></div></div><h3 id=写数据>写数据</h3><div class=highlight><div style=-moz-tab-size:4;-o-tab-size:4;tab-size:4><table style=border-spacing:0;padding:0;margin:0;border:0><tr><td style=vertical-align:top;padding:0;margin:0;border:0><pre tabindex=0 style=-moz-tab-size:4;-o-tab-size:4;tab-size:4><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">1
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">2
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">3
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">4
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">5
</span></code></pre></td><td style=vertical-align:top;padding:0;margin:0;border:0;width:100%><pre tabindex=0 style=-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span>curl --location --request POST <span style=color:#ba2121>&#39;http://127.0.0.1:5440/sql&#39;</span> <span style=color:#b62;font-weight:700>\
</span></span></span><span style=display:flex><span><span style=color:#b62;font-weight:700></span>-d <span style=color:#ba2121>&#39;
</span></span></span><span style=display:flex><span><span style=color:#ba2121>INSERT INTO demo (t, name, value)
</span></span></span><span style=display:flex><span><span style=color:#ba2121> VALUES (1651737067000, &#34;horaedb&#34;, 100)
</span></span></span><span style=display:flex><span><span style=color:#ba2121>&#39;</span>
</span></span></code></pre></td></tr></table></div></div><h3 id=查询>查询</h3><div class=highlight><div style=-moz-tab-size:4;-o-tab-size:4;tab-size:4><table style=border-spacing:0;padding:0;margin:0;border:0><tr><td style=vertical-align:top;padding:0;margin:0;border:0><pre tabindex=0 style=-moz-tab-size:4;-o-tab-size:4;tab-size:4><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">1
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">2
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">3
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">4
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">5
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">6
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">7
</span></code></pre></td><td style=vertical-align:top;padding:0;margin:0;border:0;width:100%><pre tabindex=0 style=-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span>curl --location --request POST <span style=color:#ba2121>&#39;http://127.0.0.1:5440/sql&#39;</span> <span style=color:#b62;font-weight:700>\
</span></span></span><span style=display:flex><span><span style=color:#b62;font-weight:700></span>-d <span style=color:#ba2121>&#39;
</span></span></span><span style=display:flex><span><span style=color:#ba2121>SELECT
</span></span></span><span style=display:flex><span><span style=color:#ba2121> *
</span></span></span><span style=display:flex><span><span style=color:#ba2121>FROM
</span></span></span><span style=display:flex><span><span style=color:#ba2121> `demo`
</span></span></span><span style=display:flex><span><span style=color:#ba2121>&#39;</span>
</span></span></code></pre></td></tr></table></div></div><h3 id=展示建表语句>展示建表语句</h3><div class=highlight><div style=-moz-tab-size:4;-o-tab-size:4;tab-size:4><table style=border-spacing:0;padding:0;margin:0;border:0><tr><td style=vertical-align:top;padding:0;margin:0;border:0><pre tabindex=0 style=-moz-tab-size:4;-o-tab-size:4;tab-size:4><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">1
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">2
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">3
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">4
</span></code></pre></td><td style=vertical-align:top;padding:0;margin:0;border:0;width:100%><pre tabindex=0 style=-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span>curl --location --request POST <span style=color:#ba2121>&#39;http://127.0.0.1:5440/sql&#39;</span> <span style=color:#b62;font-weight:700>\
</span></span></span><span style=display:flex><span><span style=color:#b62;font-weight:700></span>-d <span style=color:#ba2121>&#39;
</span></span></span><span style=display:flex><span><span style=color:#ba2121>SHOW CREATE TABLE `demo`
</span></span></span><span style=display:flex><span><span style=color:#ba2121>&#39;</span>
</span></span></code></pre></td></tr></table></div></div><h3 id=删除表>删除表</h3><div class=highlight><div style=-moz-tab-size:4;-o-tab-size:4;tab-size:4><table style=border-spacing:0;padding:0;margin:0;border:0><tr><td style=vertical-align:top;padding:0;margin:0;border:0><pre tabindex=0 style=-moz-tab-size:4;-o-tab-size:4;tab-size:4><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">1
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">2
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">3
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:.4em;padding:0 .4em;color:#7f7f7f">4
</span></code></pre></td><td style=vertical-align:top;padding:0;margin:0;border:0;width:100%><pre tabindex=0 style=-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span>curl --location --request POST <span style=color:#ba2121>&#39;http://127.0.0.1:5440/sql&#39;</span> <span style=color:#b62;font-weight:700>\
</span></span></span><span style=display:flex><span><span style=color:#b62;font-weight:700></span>-d <span style=color:#ba2121>&#39;
</span></span></span><span style=display:flex><span><span style=color:#ba2121>DROP TABLE `demo`
</span></span></span><span style=display:flex><span><span style=color:#ba2121>&#39;</span>
</span></span></code></pre></td></tr></table></div></div><h2 id=使用-sdk>使用 SDK</h2><p>当前我们支持多种开发语言 SDK,例如 Java,Rust,Python, Go 等, 具体使用方式请参考 <a href=https://horaedb.apache.org/cn/docs/user-guide/sdk/>sdk</a></p><h2 id=下一步>下一步</h2><p>恭喜你,你已经学习了 HoraeDB 的简单使用。关于 HoraeDB 的更多信息,请参见以下内容。</p><ul><li><a href=https://horaedb.apache.org/cn/docs/user-guide/sql/>SQL 语法</a></li><li><a href=https://horaedb.apache.org/cn/docs/user-guide/cluster_deployment/>部署文档</a></li><li><a href=https://horaedb.apache.org/cn/docs/user-guide/operation/>运维文档</a></li></ul><div class=td-page-meta__lastmod>Last modified November 26, 2024: <a href=https://github.com/apache/horaedb-docs/commit/09c72af31ce274fae4090127f306c5e8a90f8639>chore: polish sdk dev (#160) (09c72af)</a></div></div></main></div></div><footer class="td-footer row d-print-none"><div class=container-fluid><div class="row mx-md-2"><div class=td-footer__center>Apache HoraeDB is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.<hr><span class=td-footer__copyright>&copy;
2023&ndash;2024
<span class=td-footer__authors><p>The Apache Software Foundation, Licensed under the Apache License, Version 2.0.</p><p>Apache, the names of Apache projects, and the feather logo are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries.</p></span></span><span class=td-footer__all_rights_reserved>All Rights Reserved</span></div></div><hr><div class="row mx-md-2"><div class=td-footer__center><span class=td-footer__copyright>Found a bug in website? <a href=https://github.com/apache/horaedb-docs/issues/new>Open an issue</a> or <a href=https://github.com/apache/horaedb-docs/pulls>submit a pull request</a> on GitHub.</span></div></div><hr></div></footer></div><script src=/js/main.min.f72d00502781aaf278a14088eb2356b1ba2a05ad698a0c43fe86314d74ceab56.js integrity="sha256-9y0AUCeBqvJ4oUCI6yNWsboqBa1pigxD/oYxTXTOq1Y=" crossorigin=anonymous></script><script defer src=/js/click-to-copy.min.73478a7d4807698aed7e355eb23f9890ca18fea3158604c8471746d046702bad.js integrity="sha256-c0eKfUgHaYrtfjVesj+YkMoY/qMVhgTIRxdG0EZwK60=" crossorigin=anonymous></script><script src=/js/tabpane-persist.js></script></body></html>