databricks / terraform-provider-databricks

Databricks Terraform Provider
https://registry.terraform.io/providers/databricks/databricks/latest
Other
456 stars 393 forks source link

execute SQL statement using terraform #4263

Open rajammavenkatesh opened 10 hours ago

rajammavenkatesh commented 10 hours ago

execute SQL statements using Terraform I can see it can be possible using API as bellow, https://docs.databricks.com/api/workspace/statementexecution/executestatement

but I want to know is a strength way to run like bellow code

provider "databricks" { host = var.databricks_host token = var.databricks_token }

resource "databricks_sql_query" "example" { name = "example-query" data_source_id = var.data_source_id query = "SELECT * FROM your_table" }

resource "local_file" "query_result" { content = jsonencode(databricks_sql_query.example.output) filename = "${path.module}/query_result.json" }