If you use the Visual Studio 2013, please open a command window by executing "cmd.exe".
If you use the Visual Studio 2013, please open a command window by executing "cmd.exe".
Please specify "x86_amd64" for 64 bits Windows or specify "x86" is for 32 bits Windows when you execute vcvarsall.bat.
Please specify "x86_amd64" for 64 bits Windows or specify "x86" is for 32 bits Windows when you execute vcvarsall.bat.
```
```cmd
mkdir debug && cd debug
mkdir debug && cd debug
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" < x86_amd64 | x86 >
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" < x86_amd64 | x86 >
cmake .. -G "NMake Makefiles"
cmake .. -G "NMake Makefiles"
...
@@ -137,7 +137,8 @@ If you use the Visual Studio 2019 or 2017:
...
@@ -137,7 +137,8 @@ If you use the Visual Studio 2019 or 2017:
please open a command window by executing "cmd.exe".
please open a command window by executing "cmd.exe".
Please specify "x64" for 64 bits Windows or specify "x86" is for 32 bits Windows when you execute vcvarsall.bat.
Please specify "x64" for 64 bits Windows or specify "x86" is for 32 bits Windows when you execute vcvarsall.bat.
```
```cmd
mkdir debug && cd debug
mkdir debug && cd debug
"c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" < x64 | x86 >
"c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" < x64 | x86 >
cmake .. -G "NMake Makefiles"
cmake .. -G "NMake Makefiles"
...
@@ -145,27 +146,37 @@ nmake
...
@@ -145,27 +146,37 @@ nmake
```
```
Or, you can simply open a command window by clicking Windows Start -> "Visual Studio <2019|2017>" folder -> "x64 Native Tools Command Prompt for VS <2019|2017>" or "x86 Native Tools Command Prompt for VS <2019|2017>" depends what architecture your Windows is, then execute commands as follows:
Or, you can simply open a command window by clicking Windows Start -> "Visual Studio <2019|2017>" folder -> "x64 Native Tools Command Prompt for VS <2019|2017>" or "x86 Native Tools Command Prompt for VS <2019|2017>" depends what architecture your Windows is, then execute commands as follows:
```
```cmd
mkdir debug && cd debug
mkdir debug && cd debug
cmake .. -G "NMake Makefiles"
cmake .. -G "NMake Makefiles"
nmake
nmake
```
```
### On Mac OS X platform
Please install XCode command line tools and cmake. Verified with XCode 11.4+ on Catalina and Big Sur.
```shell
mkdir debug &&cd debug
cmake .. && cmake --build .
```
# Quick Run
# Quick Run
# Quick Run
# Quick Run
To quickly start a TDengine server after building, run the command below in terminal:
To quickly start a TDengine server after building, run the command below in terminal:
```cmd
```bash
./build/bin/taosd -ctest/cfg
./build/bin/taosd -ctest/cfg
```
```
In another terminal, use the TDengine shell to connect the server:
In another terminal, use the TDengine shell to connect the server:
```
```bash
./build/bin/taos -ctest/cfg
./build/bin/taos -ctest/cfg
```
```
option "-c test/cfg" specifies the system configuration file directory.
option "-c test/cfg" specifies the system configuration file directory.
# Installing
# Installing
After building successfully, TDengine can be installed by:
After building successfully, TDengine can be installed by:
```cmd
```bash
make install
make install
```
```
Users can find more information about directories installed on the system in the [directory and files](https://www.taosdata.com/en/documentation/administrator/#Directory-and-Files) section. It should be noted that installing from source code does not configure service management for TDengine.
Users can find more information about directories installed on the system in the [directory and files](https://www.taosdata.com/en/documentation/administrator/#Directory-and-Files) section. It should be noted that installing from source code does not configure service management for TDengine.
Stringsql="Insert into t3 using weather tags('广东') values('2020-01-01 01:0:00.000', 22.22),('2020-01-01 02:00:00.000', 22.22) t4 using weather tags('天津') values('2020-01-01 01:0:00.000', 33.33),('2020-01-01 02:00:00.000', 33.33)";
Stringsql="Insert into t3 using weather tags('广东') values('2020-01-01 01:0:00.000', 22.22),('2020-01-01 02:00:00.000', 22.22) t4 using weather tags('天津') values('2020-01-01 01:0:00.000', 33.33),('2020-01-01 02:00:00.000', 33.33)";
executeUpdate(sql);
SQLExecutor.executeUpdate(connection,sql);
}
}
@Test
@Test
publicvoidtestCase018(){
publicvoidtestCase018(){
Stringsql="select * from restful_test.t1";
Stringsql="select * from restful_test.t1";
executeQuery(sql);
SQLExecutor.executeQuery(connection,sql);
}
}
@Test
@Test
publicvoidtestCase019(){
publicvoidtestCase019(){
Stringsql="select * from restful_test.weather";
Stringsql="select * from restful_test.weather";
executeQuery(sql);
SQLExecutor.executeQuery(connection,sql);
}
}
@Test
@Test
publicvoidtestCase020(){
publicvoidtestCase020(){
Stringsql="select ts, temperature from restful_test.t1";
Stringsql="select ts, temperature from restful_test.t1";
executeQuery(sql);
SQLExecutor.executeQuery(connection,sql);
}
}
@Test
@Test
publicvoidtestCase021(){
publicvoidtestCase021(){
Stringsql="select ts, temperature from restful_test.weather";
Stringsql="select ts, temperature from restful_test.weather";
executeQuery(sql);
SQLExecutor.executeQuery(connection,sql);
}
}
@Test
@Test
publicvoidtestCase022(){
publicvoidtestCase022(){
Stringsql="select temperature, ts from restful_test.t1";
Stringsql="select temperature, ts from restful_test.t1";
executeQuery(sql);
SQLExecutor.executeQuery(connection,sql);
}
}
@Test
@Test
publicvoidtestCase023(){
publicvoidtestCase023(){
Stringsql="select temperature, ts from restful_test.weather";
Stringsql="select temperature, ts from restful_test.weather";
executeQuery(sql);
SQLExecutor.executeQuery(connection,sql);
}
}
@Test
@Test
publicvoidtestCase024(){
publicvoidtestCase024(){
Stringsql="import into restful_test.t5 using weather tags('石家庄') values('2020-01-01 00:01:00.000', 22.22)";
Stringsql="import into restful_test.t5 using weather tags('石家庄') values('2020-01-01 00:01:00.000', 22.22)";
executeUpdate(sql);
SQLExecutor.executeUpdate(connection,sql);
}
}
@Test
@Test
publicvoidtestCase025(){
publicvoidtestCase025(){
Stringsql="import into restful_test.t6 using weather tags('沈阳') values('2020-01-01 00:01:00.000', 22.22),('2020-01-01 00:02:00.000', 22.22)";
Stringsql="import into restful_test.t6 using weather tags('沈阳') values('2020-01-01 00:01:00.000', 22.22),('2020-01-01 00:02:00.000', 22.22)";
executeUpdate(sql);
SQLExecutor.executeUpdate(connection,sql);
}
}
@Test
@Test
publicvoidtestCase026(){
publicvoidtestCase026(){
Stringsql="import into restful_test.t7 using weather tags('长沙') values('2020-01-01 00:01:00.000', 22.22) restful_test.t8 using weather tags('吉林') values('2020-01-01 00:01:00.000', 22.22)";
Stringsql="import into restful_test.t7 using weather tags('长沙') values('2020-01-01 00:01:00.000', 22.22) restful_test.t8 using weather tags('吉林') values('2020-01-01 00:01:00.000', 22.22)";
executeUpdate(sql);
SQLExecutor.executeUpdate(connection,sql);
}
}
@Test
@Test
publicvoidtestCase027(){
publicvoidtestCase027(){
Stringsql="import into restful_test.t9 using weather tags('武汉') values('2020-01-01 00:01:00.000', 22.22) ,('2020-01-02 00:01:00.000', 22.22) restful_test.t10 using weather tags('哈尔滨') values('2020-01-01 00:01:00.000', 22.22),('2020-01-02 00:01:00.000', 22.22)";
Stringsql="import into restful_test.t9 using weather tags('武汉') values('2020-01-01 00:01:00.000', 22.22) ,('2020-01-02 00:01:00.000', 22.22) restful_test.t10 using weather tags('哈尔滨') values('2020-01-01 00:01:00.000', 22.22),('2020-01-02 00:01:00.000', 22.22)";
executeUpdate(sql);
SQLExecutor.executeUpdate(connection,sql);
}
}
@Test
@Test
publicvoidtestCase028(){
publicvoidtestCase028(){
Stringsql="select location, temperature, ts from restful_test.weather where temperature > 1";
Stringsql="select location, temperature, ts from restful_test.weather where temperature > 1";
executeQuery(sql);
SQLExecutor.executeQuery(connection,sql);
}
}
@Test
@Test
publicvoidtestCase029(){
publicvoidtestCase029(){
Stringsql="select location, temperature, ts from restful_test.weather where temperature < 1";
Stringsql="select location, temperature, ts from restful_test.weather where temperature < 1";
executeQuery(sql);
SQLExecutor.executeQuery(connection,sql);
}
}
@Test
@Test
publicvoidtestCase030(){
publicvoidtestCase030(){
Stringsql="select location, temperature, ts from restful_test.weather where ts > now";
Stringsql="select location, temperature, ts from restful_test.weather where ts > now";
executeQuery(sql);
SQLExecutor.executeQuery(connection,sql);
}
}
@Test
@Test
publicvoidtestCase031(){
publicvoidtestCase031(){
Stringsql="select location, temperature, ts from restful_test.weather where ts < now";
Stringsql="select location, temperature, ts from restful_test.weather where ts < now";
executeQuery(sql);
SQLExecutor.executeQuery(connection,sql);
}
}
@Test
@Test
publicvoidtestCase032(){
publicvoidtestCase032(){
Stringsql="select count(*) from restful_test.weather";
Stringsql="select count(*) from restful_test.weather";
executeQuery(sql);
SQLExecutor.executeQuery(connection,sql);
}
}
@Test
@Test
publicvoidtestCase033(){
publicvoidtestCase033(){
Stringsql="select first(*) from restful_test.weather";
Stringsql="select first(*) from restful_test.weather";
executeQuery(sql);
SQLExecutor.executeQuery(connection,sql);
}
}
@Test
@Test
publicvoidtestCase034(){
publicvoidtestCase034(){
Stringsql="select last(*) from restful_test.weather";
Stringsql="select last(*) from restful_test.weather";
executeQuery(sql);
SQLExecutor.executeQuery(connection,sql);
}
}
@Test
@Test
publicvoidtestCase035(){
publicvoidtestCase035(){
Stringsql="select last_row(*) from restful_test.weather";
Stringsql="select last_row(*) from restful_test.weather";
executeQuery(sql);
SQLExecutor.executeQuery(connection,sql);
}
}
@Test
@Test
publicvoidtestCase036(){
publicvoidtestCase036(){
Stringsql="select ts, ts as primary_key from restful_test.weather";
Stringsql="select ts, ts as primary_key from restful_test.weather";