Creates a SQL view stored in the DuckLake catalog. Views support time travel - attaching at a previous snapshot will reflect the view definition that existed at that point in time.
Examples
if (FALSE) { # \dontrun{
db_connect(...)
# Create a simple view
db_create_view(view = "active_users",
query = "SELECT * FROM users WHERE active = true")
# Replace existing view
db_create_view(view = "active_users",
query = "SELECT * FROM users WHERE active = true AND verified = true",
replace = TRUE)
# View with aggregation
db_create_view(schema = "reports", view = "monthly_totals",
query = "SELECT year, month, SUM(value) as total FROM sales GROUP BY year, month")
} # }