should be it
This commit is contained in:
49
external/duckdb/test/sql/table_function/duckdb_tables.test
vendored
Normal file
49
external/duckdb/test/sql/table_function/duckdb_tables.test
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
# name: test/sql/table_function/duckdb_tables.test
|
||||
# description: Test duckdb_tables function
|
||||
# group: [table_function]
|
||||
|
||||
query I
|
||||
SELECT COUNT(*) FROM duckdb_tables();
|
||||
----
|
||||
0
|
||||
|
||||
statement ok
|
||||
CREATE TABLE integers(i INTEGER)
|
||||
|
||||
statement ok
|
||||
CREATE TABLE pk(i INTEGER PRIMARY KEY, j VARCHAR, CHECK(i<100))
|
||||
|
||||
statement ok
|
||||
CREATE SCHEMA myschema;
|
||||
|
||||
statement ok
|
||||
CREATE TABLE myschema.mytable(k DOUBLE)
|
||||
|
||||
statement ok
|
||||
CREATE TEMPORARY TABLE mytemp(i INTEGER)
|
||||
|
||||
statement ok
|
||||
CREATE VIEW v1 AS SELECT 42
|
||||
|
||||
query IIIIIIII
|
||||
SELECT schema_name, table_name, temporary, has_primary_key, estimated_size, column_count, index_count, check_constraint_count
|
||||
FROM duckdb_tables() ORDER BY table_name;
|
||||
----
|
||||
main integers False False 0 1 0 0
|
||||
myschema mytable False False 0 1 0 0
|
||||
main mytemp True False 0 1 0 0
|
||||
main pk False True 0 2 1 1
|
||||
|
||||
query I
|
||||
SELECT database_name = current_database() OR database_name = 'temp'
|
||||
FROM duckdb_tables();
|
||||
----
|
||||
True
|
||||
True
|
||||
True
|
||||
True
|
||||
|
||||
statement error
|
||||
SELECT * FROM temp.duckdb_tables
|
||||
----
|
||||
main.duckdb_tables
|
||||
Reference in New Issue
Block a user