Discover OneLake schemas and individual tables
Source:R/fabric_onelake_catalog.R
fabric_onelake_catalog.RdThese helpers expose the read-only OneLake Delta table metadata API for Lakehouses and Warehouses. The schema helpers follow every metadata page. The singular table helpers retrieve one table's full column metadata without listing every table in every schema.
Usage
fabric_lakehouse_schemas(
lakehouse,
workspace = NULL,
page_size = NULL,
tenant_id = Sys.getenv("FABRICQUERYR_TENANT_ID"),
client_id = Sys.getenv("FABRICQUERYR_CLIENT_ID", unset =
"04b07795-8ddb-461a-bbee-02f9e1bf7b46"),
token = NULL,
auth_args = list(),
api_base = .fabric_api_base,
table_api_base = .fabric_onelake_table_base,
storage_token = NULL
)
fabric_warehouse_schemas(
warehouse,
workspace = NULL,
page_size = NULL,
tenant_id = Sys.getenv("FABRICQUERYR_TENANT_ID"),
client_id = Sys.getenv("FABRICQUERYR_CLIENT_ID", unset =
"04b07795-8ddb-461a-bbee-02f9e1bf7b46"),
token = NULL,
auth_args = list(),
api_base = .fabric_api_base,
table_api_base = .fabric_onelake_table_base,
storage_token = NULL
)
fabric_lakehouse_table(
lakehouse,
table,
workspace = NULL,
schema = NULL,
tenant_id = Sys.getenv("FABRICQUERYR_TENANT_ID"),
client_id = Sys.getenv("FABRICQUERYR_CLIENT_ID", unset =
"04b07795-8ddb-461a-bbee-02f9e1bf7b46"),
token = NULL,
auth_args = list(),
api_base = .fabric_api_base,
table_api_base = .fabric_onelake_table_base,
storage_token = NULL,
enrich_fabric = FALSE
)
fabric_warehouse_table(
warehouse,
table,
workspace = NULL,
schema = NULL,
tenant_id = Sys.getenv("FABRICQUERYR_TENANT_ID"),
client_id = Sys.getenv("FABRICQUERYR_CLIENT_ID", unset =
"04b07795-8ddb-461a-bbee-02f9e1bf7b46"),
token = NULL,
auth_args = list(),
api_base = .fabric_api_base,
table_api_base = .fabric_onelake_table_base,
storage_token = NULL
)Arguments
- lakehouse
Lakehouse GUID, exact display name, or one Lakehouse object returned by
fabric_lakehouses().- workspace
Workspace GUID, exact display name, or discovered workspace. Omit it when the item object contains
workspaceId.- page_size
Optional maximum schemas requested per metadata page, from 1 to 100. All continuation tokens are followed.
- tenant_id
Entra tenant ID. Defaults to
FABRICQUERYR_TENANT_ID.- client_id
Entra application ID. Defaults to
FABRICQUERYR_CLIENT_ID, then the Azure CLI application ID.- token
Optional access token or audience-aware token-provider function.
- auth_args
Additional sign-in options passed to
fabric_credential().- api_base
Fabric REST API base used when an item name or GUID must be resolved. Most users should keep the default.
- table_api_base
OneLake Delta table API base URL. Most users should keep the default.
- storage_token
Optional separate Azure Storage token or token-provider function. Supply it when
tokenis fixed and Fabric item lookup is needed.- warehouse
Warehouse GUID, exact display name, or one Warehouse object returned by
fabric_warehouses().- table
Table name, or a record containing a
name,table, ordisplayNamefield. A record can also supplyschema.- schema
Schema containing
table. Defaults to the Lakehouse default schema when available, otherwise"dbo".- enrich_fabric
For
fabric_lakehouse_table(), also list the Fabric table inventory to enrich the result. Defaults toFALSE, so a complete discovered item needs only a Storage token. SettingTRUErequires both Fabric and Storage audiences; use an audience-aware provider or supplytokenandstorage_tokenseparately.
Value
The schema functions return a tibble with name, catalog,
full_name, comment, owner, schema_id, timestamps, and the unmodified
metadata record in raw. The table functions return one row with the same
columns as fabric_lakehouse_tables() or fabric_warehouse_tables().
Permissions
The OneLake table API uses the Azure Storage token audience and requires permission to read the item's tables through OneLake.
Examples
if (FALSE) { # \dontrun{
workspace <- fabric_workspaces()[[1L]]
lakehouse <- fabric_lakehouses(workspace)[[1L]]
schemas <- fabric_lakehouse_schemas(lakehouse)
orders <- fabric_lakehouse_table(lakehouse, "orders", schema = "dbo")
} # }