Files
greptimedb/tests/cases/standalone/common/create/create_database_opts.result
dennis zhuang 4306cba866 feat: show database options (#4174)
* test: test create table with database ttl

* feat: show database options

* fix: comment

* chore: apply suggestion

Co-authored-by: Jeremyhi <jiachun_feng@proton.me>

* chore: fix CR comments and refactor

* chore: style

Co-authored-by: Weny Xu <wenymedia@gmail.com>

---------

Co-authored-by: Jeremyhi <jiachun_feng@proton.me>
Co-authored-by: Weny Xu <wenymedia@gmail.com>
2024-06-20 04:21:58 +00:00

71 lines
1.6 KiB
Plaintext

CREATE DATABASE mydb WITH (ttl = '1h');
Affected Rows: 1
SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| greptime_private |
| information_schema |
| mydb |
| public |
+--------------------+
SHOW FULL DATABASES;
+--------------------+----------+
| Database | Options |
+--------------------+----------+
| greptime_private | |
| information_schema | |
| mydb | ttl='1h' |
| public | |
+--------------------+----------+
USE mydb;
Affected Rows: 0
CREATE TABLE test(host STRING, cpu DOUBLE, ts TIMESTAMP TIME INDEX);
Affected Rows: 0
SHOW CREATE TABLE test;
+-------+-------------------------------------+
| Table | Create Table |
+-------+-------------------------------------+
| test | CREATE TABLE IF NOT EXISTS "test" ( |
| | "host" STRING NULL, |
| | "cpu" DOUBLE NULL, |
| | "ts" TIMESTAMP(3) NOT NULL, |
| | TIME INDEX ("ts") |
| | ) |
| | |
| | ENGINE=mito |
| | WITH( |
| | ttl = '1h' |
| | ) |
+-------+-------------------------------------+
USE public;
Affected Rows: 0
DROP DATABASE mydb;
Affected Rows: 0
SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| greptime_private |
| information_schema |
| public |
+--------------------+