https://github.com/odedniv/terraform-provider-sql
Terraform provider for managing SQL schemas using migrations.
https://github.com/odedniv/terraform-provider-sql
infrastructure-as-code terraform-provider
Last synced: 5 months ago
JSON representation
Terraform provider for managing SQL schemas using migrations.
- Host: GitHub
- URL: https://github.com/odedniv/terraform-provider-sql
- Owner: odedniv
- License: mit
- Created: 2019-02-20T13:52:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-01T19:15:30.000Z (about 6 years ago)
- Last Synced: 2025-08-14T01:26:50.084Z (10 months ago)
- Topics: infrastructure-as-code, terraform-provider
- Language: Go
- Size: 76.2 KB
- Stars: 14
- Watchers: 1
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# terraform-provider-sql
Terraform provider for managing SQL schemas using migrations.
This plugin uses [rubenv/sql-migrate](https://github.com/rubenv/sql-migrate),
it is recommended to go read how it works before using this provider.
## Usage
### Installation
Build the provider and put it in Terraform's third-party providers directory in `~/.terraform.d/plugins`:
```bash
go get github.com/odedniv/terraform-provider-sql
mkdir -p ~/.terraform.d/plugins
go build -o ~/.terraform.d/plugins/terraform-provider-sql github.com/odedniv/terraform-provider-sql
```
I recommend using [Go modules](https://github.com/golang/go/wiki/Modules) to ensure
using the same version in development and production.
### Configuration
In your Terraform configuration:
```terraform
resource "sql_schema" "this" {
driver = "" # mysql/postgres/cloudsql/cloudsqlpostgres
datasource = ""
directory = "migrations" # optional
table = "schema_migrations" # optional
}
```