HoraeDB 支持标准的 SQL,用户可以使用 Http 协议创建表和读写表。更多内容可以参考 SQL 语法
示例如下
curl --location --request POST 'http://127.0.0.1:5000/sql' \ --header 'Content-Type: application/json' \ -d '{ "query": "CREATE TABLE `demo` (`name` string TAG, `value` double NOT NULL, `t` timestamp NOT NULL, TIMESTAMP KEY(t)) ENGINE=Analytic with (enable_ttl='\''false'\'')" }'
示例如下
curl --location --request POST 'http://127.0.0.1:5000/sql' \ --header 'Content-Type: application/json' \ -d '{ "query": "INSERT INTO demo(t, name, value) VALUES(1651737067000, '\''horaedb'\'', 100)" }'
示例如下
curl --location --request POST 'http://127.0.0.1:5000/sql' \ --header 'Content-Type: application/json' \ -d '{ "query": "select * from demo" }'
示例如下
curl --location --request POST 'http://127.0.0.1:5000/sql' \ --header 'Content-Type: application/json' \ -d '{ "query": "show create table demo" }'
示例如下
curl --location --request POST 'http://127.0.0.1:5000/sql' \ --header 'Content-Type: application/json' \ -d '{ "query": "DROP TABLE demo" }'
示例如下
curl --location --request GET 'http://127.0.0.1:5000/route/{table_name}'