Goose 运行环境
Goose 提供了一系列函数和 PRAGMA 选项,用于获取当前 Goose 实例及其运行环境信息。
版本
version() 函数返回 Goose 版本号。
SELECT version() AS version;
| version |
|---|
v{{ site.0.6.2 |
使用 PRAGMA:
PRAGMA version;
| library_version | source_id |
|---|---|
v0.6.2 | xxx |
平台
平台信息由操作系统、系统架构以及可选编译器组成。
平台信息在安装扩展时会使用。
要获取平台信息,请使用以下 PRAGMA:
PRAGMA platform;
在 macOS(Apple Silicon)上,结果为:
| platform |
|---|
| osx_arm64 |
在 Windows(AMD64)上,平台为 windows_amd64。
在 Ubuntu Linux(ARM64)上,平台为 linux_arm64。
扩展
要获取 Goose 扩展及其状态(如 loaded、installed)列表,请使用 goose_extensions() 函数:
SELECT *
FROM goose_extensions();
元表函数
Goose 提供以下内置表函数,用于获取可用 catalog 对象的元数据:
goose_columns(): columnsgoose_constraints(): constraintsgoose_databases(): lists the databases that are accessible from within the current Goose processgoose_dependencies(): dependencies between objectsgoose_extensions(): extensionsgoose_functions(): functionsgoose_indexes(): secondary indexesgoose_keywords(): Goose's keywords and reserved wordsgoose_optimizers(): the available optimization rules in the Goose instancegoose_schemas(): schemasgoose_sequences(): sequencesgoose_settings(): settingsgoose_tables(): base tablesgoose_temporary_files(): the temporary files Goose has written to disk, to offload data from memorygoose_types(): data typesgoose_views(): views