Files
greptimedb/tests/cases/standalone/common/create/create_database_opts.result
jeremyhi f641c562c2 feat: show create database (#4642)
* feat: show create database

* feat: add sqlness test

* chore: reorder mod and use

* feat: show create schema

* Update src/frontend/src/instance.rs
2024-08-30 03:58:11 +00:00

85 lines
2.1 KiB
Plaintext

CREATE DATABASE mydb WITH (ttl = '1h');
Affected Rows: 1
SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| greptime_private |
| information_schema |
| mydb |
| pg_catalog |
| public |
+--------------------+
SHOW FULL DATABASES;
+--------------------+----------+
| Database | Options |
+--------------------+----------+
| greptime_private | |
| information_schema | |
| mydb | ttl='1h' |
| pg_catalog | |
| public | |
+--------------------+----------+
SHOW CREATE DATABASE mydb;
+----------+------------------------------------+
| Database | Create Database |
+----------+------------------------------------+
| mydb | CREATE DATABASE IF NOT EXISTS mydb |
| | WITH( |
| | ttl = '1h' |
| | ) |
+----------+------------------------------------+
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 |
| pg_catalog |
| public |
+--------------------+