Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,22 @@ description: |-
```terraform
# connect to Microsoft SQL Server
provider "sql" {
alias = "mssql"
url = "sqlserver://sa:password@localhost:1433"
}

# connect to PostgreSQL
provider "sql" {
alias = "postgres"
url = "postgres://postgres:password@localhost:5432/mydatabase?sslmode=disable"
}

# connect to CockroachDB
provider "sql" {
alias = "cockroach"
# use the postgres driver for CockroachDB
url = "postgres://root@localhost:26257/events?sslmode=disable"
}

# connect to a MySQL server
provider "sql" {
alias = "mysql"
url = "mysql://root:password@tcp(localhost:3306)/mysql"
}
```
Expand Down
2 changes: 2 additions & 0 deletions docs/resources/migrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ description: |-
```terraform
resource "sql_migrate" "db" {
migration {
id = "db_init_schema"
up = <<SQL
CREATE TABLE users (
user_id integer unique,
Expand All @@ -27,6 +28,7 @@ SQL
}

migration {
id = "db_seed_data"
up = "INSERT INTO users VALUES (1, 'Paul Tyng', '[email protected]');"
down = "DELETE FROM users WHERE user_id = 1;"
}
Expand Down
4 changes: 0 additions & 4 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
# connect to Microsoft SQL Server
provider "sql" {
alias = "mssql"
url = "sqlserver://sa:password@localhost:1433"
}

# connect to PostgreSQL
provider "sql" {
alias = "postgres"
url = "postgres://postgres:password@localhost:5432/mydatabase?sslmode=disable"
}

# connect to CockroachDB
provider "sql" {
alias = "cockroach"
# use the postgres driver for CockroachDB
url = "postgres://root@localhost:26257/events?sslmode=disable"
}

# connect to a MySQL server
provider "sql" {
alias = "mysql"
url = "mysql://root:password@tcp(localhost:3306)/mysql"
}
2 changes: 2 additions & 0 deletions examples/resources/sql_migrate/resource.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
resource "sql_migrate" "db" {
migration {
id = "db_init_schema"
up = <<SQL
CREATE TABLE users (
user_id integer unique,
Expand All @@ -12,6 +13,7 @@ SQL
}

migration {
id = "db_seed_data"
up = "INSERT INTO users VALUES (1, 'Paul Tyng', '[email protected]');"
down = "DELETE FROM users WHERE user_id = 1;"
}
Expand Down