duckdb 0.7.1-dev103.0 → 0.7.1-dev107.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
#include "duckdb/
|
|
2
|
-
#include "duckdb/common/string_util.hpp"
|
|
1
|
+
#include "duckdb/common/constants.hpp"
|
|
3
2
|
#include "duckdb/common/file_system.hpp"
|
|
4
|
-
#include "duckdb/
|
|
5
|
-
#include "duckdb/
|
|
6
|
-
#include "duckdb/parser/parser.hpp"
|
|
3
|
+
#include "duckdb/common/string_util.hpp"
|
|
4
|
+
#include "duckdb/function/pragma/pragma_functions.hpp"
|
|
7
5
|
#include "duckdb/main/config.hpp"
|
|
6
|
+
#include "duckdb/parser/parser.hpp"
|
|
7
|
+
#include "duckdb/parser/qualified_name.hpp"
|
|
8
|
+
#include "duckdb/parser/statement/copy_statement.hpp"
|
|
9
|
+
#include "duckdb/parser/statement/export_statement.hpp"
|
|
8
10
|
|
|
9
11
|
namespace duckdb {
|
|
10
12
|
|
|
@@ -58,10 +60,35 @@ string PragmaFunctionsQuery(ClientContext &context, const FunctionParameters &pa
|
|
|
58
60
|
|
|
59
61
|
string PragmaShow(ClientContext &context, const FunctionParameters ¶meters) {
|
|
60
62
|
// PRAGMA table_info but with some aliases
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
auto table = QualifiedName::Parse(parameters.values[0].ToString());
|
|
64
|
+
|
|
65
|
+
// clang-format off
|
|
66
|
+
string sql = R"(
|
|
67
|
+
SELECT
|
|
68
|
+
name AS "column_name",
|
|
69
|
+
type as "column_type",
|
|
70
|
+
CASE WHEN "notnull" THEN 'NO' ELSE 'YES' END AS "null",
|
|
71
|
+
(SELECT
|
|
72
|
+
MIN(CASE
|
|
73
|
+
WHEN constraint_type='PRIMARY KEY' THEN 'PRI'
|
|
74
|
+
WHEN constraint_type='UNIQUE' THEN 'UNI'
|
|
75
|
+
ELSE NULL END)
|
|
76
|
+
FROM duckdb_constraints() c
|
|
77
|
+
WHERE c.table_oid=cols.table_oid
|
|
78
|
+
AND list_contains(constraint_column_names, cols.column_name)) AS "key",
|
|
79
|
+
dflt_value AS "default",
|
|
80
|
+
NULL AS "extra"
|
|
81
|
+
FROM pragma_table_info('%func_param_table%')
|
|
82
|
+
LEFT JOIN duckdb_columns cols
|
|
83
|
+
ON cols.column_name = pragma_table_info.name
|
|
84
|
+
AND cols.table_name='%table_name%'
|
|
85
|
+
AND cols.schema_name='%table_schema%';)";
|
|
86
|
+
// clang-format on
|
|
87
|
+
|
|
88
|
+
sql = StringUtil::Replace(sql, "%func_param_table%", parameters.values[0].ToString());
|
|
89
|
+
sql = StringUtil::Replace(sql, "%table_name%", table.name);
|
|
90
|
+
sql = StringUtil::Replace(sql, "%table_schema%", table.schema.empty() ? DEFAULT_SCHEMA : table.schema);
|
|
91
|
+
return sql;
|
|
65
92
|
}
|
|
66
93
|
|
|
67
94
|
string PragmaVersion(ClientContext &context, const FunctionParameters ¶meters) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#ifndef DUCKDB_VERSION
|
|
2
|
-
#define DUCKDB_VERSION "0.7.1-
|
|
2
|
+
#define DUCKDB_VERSION "0.7.1-dev107"
|
|
3
3
|
#endif
|
|
4
4
|
#ifndef DUCKDB_SOURCE_ID
|
|
5
|
-
#define DUCKDB_SOURCE_ID "
|
|
5
|
+
#define DUCKDB_SOURCE_ID "8a8581e2e3"
|
|
6
6
|
#endif
|
|
7
7
|
#include "duckdb/function/table/system_functions.hpp"
|
|
8
8
|
#include "duckdb/main/database.hpp"
|