fix: create database with wal_retention_period in docs/examples/csharp

This commit is contained in:
Benguang Zhao 2023-03-25 13:59:17 +08:00
parent bac441b317
commit 6e1eed8843
4 changed files with 4 additions and 4 deletions

View File

@ -48,7 +48,7 @@ namespace TDengineExample
static void PrepareDatabase(IntPtr conn) static void PrepareDatabase(IntPtr conn)
{ {
IntPtr res = TDengine.Query(conn, "CREATE DATABASE test"); IntPtr res = TDengine.Query(conn, "CREATE DATABASE test WAL_RETENTION_PERIOD 3600");
if (TDengine.ErrorNo(res) != 0) if (TDengine.ErrorNo(res) != 0)
{ {
throw new Exception("failed to create database, reason: " + TDengine.Error(res)); throw new Exception("failed to create database, reason: " + TDengine.Error(res));

View File

@ -58,7 +58,7 @@ namespace TDengineExample
static void PrepareDatabase(IntPtr conn) static void PrepareDatabase(IntPtr conn)
{ {
IntPtr res = TDengine.Query(conn, "CREATE DATABASE test"); IntPtr res = TDengine.Query(conn, "CREATE DATABASE test WAL_RETENTION_PERIOD 3600");
if (TDengine.ErrorNo(res) != 0) if (TDengine.ErrorNo(res) != 0)
{ {
throw new Exception("failed to create database, reason: " + TDengine.Error(res)); throw new Exception("failed to create database, reason: " + TDengine.Error(res));

View File

@ -11,7 +11,7 @@ namespace TDengineExample
IntPtr conn = GetConnection(); IntPtr conn = GetConnection();
try try
{ {
IntPtr res = TDengine.Query(conn, "CREATE DATABASE power"); IntPtr res = TDengine.Query(conn, "CREATE DATABASE power WAL_RETENTION_PERIOD 3600");
CheckRes(conn, res, "failed to create database"); CheckRes(conn, res, "failed to create database");
res = TDengine.Query(conn, "USE power"); res = TDengine.Query(conn, "USE power");
CheckRes(conn, res, "failed to change database"); CheckRes(conn, res, "failed to change database");

View File

@ -76,7 +76,7 @@ namespace TDengineExample
static void PrepareSTable() static void PrepareSTable()
{ {
IntPtr res = TDengine.Query(conn, "CREATE DATABASE power"); IntPtr res = TDengine.Query(conn, "CREATE DATABASE power WAL_RETENTION_PERIOD 3600");
CheckResPtr(res, "failed to create database"); CheckResPtr(res, "failed to create database");
res = TDengine.Query(conn, "USE power"); res = TDengine.Query(conn, "USE power");
CheckResPtr(res, "failed to change database"); CheckResPtr(res, "failed to change database");