Skip to content

Commit

Permalink
fix provider host environment variable + database selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Nicole committed Oct 12, 2021
1 parent 0dcc9b6 commit 269c8c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion neo4j/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func Provider() *schema.Provider {
"host": &schema.Schema{
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("NEO4J_USERNAME", nil),
DefaultFunc: schema.EnvDefaultFunc("NEO4J_HOST", nil),
},
"username": &schema.Schema{
Type: schema.TypeString,
Expand Down
2 changes: 1 addition & 1 deletion neo4j/resource_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func resourceDatabaseRead(ctx context.Context, d *schema.ResourceData, m interfa
defer c.Close()
session := c.NewSession(neo4j.SessionConfig{AccessMode: neo4j.AccessModeWrite})
defer session.Close()
result, err := neo4j.Single(session.Run("SHOW DATABASE $database", map[string]interface{}{"database": d.Id()}))
result, err := neo4j.Single(session.Run("SHOW DATABASE $database YIELD name LIMIT 1", map[string]interface{}{"database": d.Id()}))
if err != nil {
return diag.FromErr(err)
}
Expand Down

0 comments on commit 269c8c2

Please sign in to comment.