fix: create database with wal_retention_period in docs/examples/csharp
This commit is contained in:
parent
bac441b317
commit
6e1eed8843
|
@ -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));
|
||||||
|
|
|
@ -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));
|
||||||
|
|
|
@ -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");
|
||||||
|
|
|
@ -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");
|
||||||
|
|
Loading…
Reference in New Issue