Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

execute SQL statement using terraform #4263

Open
rajammavenkatesh opened this issue Nov 21, 2024 · 0 comments
Open

execute SQL statement using terraform #4263

rajammavenkatesh opened this issue Nov 21, 2024 · 0 comments
Labels
feature New feature or request

Comments

@rajammavenkatesh
Copy link

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"
}

@rajammavenkatesh rajammavenkatesh added the feature New feature or request label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant