{
  "name": "sql",
  "version": "0.5.0",
  "description": "A Pulumi provider dynamically bridged from sql.",
  "attribution": "This Pulumi package is based on the [`sql` Terraform Provider](https://github.com/paultyng/terraform-provider-sql).",
  "repository": "https://github.com/paultyng/terraform-provider-sql",
  "publisher": "paultyng",
  "meta": {
    "moduleFormat": "(.*)(?:/[^/]*)"
  },
  "language": {
    "csharp": {
      "compatibility": "tfbridge20",
      "liftSingleValueMethodReturns": true,
      "respectSchemaVersion": true
    },
    "go": {
      "importBasePath": "github.com/pulumi/pulumi-terraform-provider/sdks/go/sql/sql",
      "rootPackageName": "sql",
      "liftSingleValueMethodReturns": true,
      "generateExtraInputTypes": true,
      "respectSchemaVersion": true
    },
    "java": {
      "basePackage": "",
      "buildFiles": "",
      "gradleNexusPublishPluginVersion": "",
      "gradleTest": ""
    },
    "nodejs": {
      "packageDescription": "A Pulumi provider dynamically bridged from sql.",
      "readme": "> This provider is a derived work of the [Terraform Provider](https://github.com/paultyng/terraform-provider-sql)\n> distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n> please consult the source [`terraform-provider-sql` repo](https://github.com/paultyng/terraform-provider-sql/issues).",
      "compatibility": "tfbridge20",
      "disableUnionOutputTypes": true,
      "liftSingleValueMethodReturns": true,
      "respectSchemaVersion": true
    },
    "python": {
      "readme": "> This provider is a derived work of the [Terraform Provider](https://github.com/paultyng/terraform-provider-sql)\n> distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n> please consult the source [`terraform-provider-sql` repo](https://github.com/paultyng/terraform-provider-sql/issues).",
      "compatibility": "tfbridge20",
      "respectSchemaVersion": true,
      "pyproject": {
        "enabled": true
      }
    }
  },
  "config": {
    "variables": {
      "maxIdleConns": {
        "type": "number",
        "description": "Sets the maximum number of connections in the idle connection pool. Default is `2`. See Go's documentation on\n[DB.SetMaxIdleConns](https://golang.org/pkg/database/sql/#DB.SetMaxIdleConns).\n"
      },
      "maxOpenConns": {
        "type": "number",
        "description": "Sets the maximum number of open connections to the database. Default is `0` (unlimited). See Go's documentation on\n[DB.SetMaxOpenConns](https://golang.org/pkg/database/sql/#DB.SetMaxOpenConns).\n"
      },
      "url": {
        "type": "string",
        "description": "Database connection strings are specified via URLs. The URL format is driver dependent but generally has the form:\n`dbdriver://username:password@host:port/dbname?param1=true&param2=false`. You can optionally set the `SQL_URL`\nenvironment variable instead.\n"
      }
    },
    "defaults": [
      "url"
    ]
  },
  "types": {
    "sql:index/MigrateCompleteMigration:MigrateCompleteMigration": {
      "properties": {
        "down": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "up": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "down",
        "id",
        "up"
      ]
    },
    "sql:index/MigrateDirectoryCompleteMigration:MigrateDirectoryCompleteMigration": {
      "properties": {
        "down": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "up": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "down",
        "id",
        "up"
      ]
    },
    "sql:index/MigrateMigration:MigrateMigration": {
      "properties": {
        "down": {
          "type": "string",
          "description": "The query to run when undoing this migration.\n"
        },
        "id": {
          "type": "string",
          "description": "Identifier can be any string to help identifying the migration in the source.\n"
        },
        "up": {
          "type": "string",
          "description": "The query to run when applying this migration.\n"
        }
      },
      "type": "object",
      "required": [
        "down",
        "id",
        "up"
      ]
    }
  },
  "provider": {
    "description": "The provider type for the sql package. By default, resources use package-wide configuration\nsettings, however an explicit `Provider` instance may be created and passed during resource\nconstruction to achieve fine-grained programmatic control over provider settings. See the\n[documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.\n",
    "properties": {
      "url": {
        "type": "string",
        "description": "Database connection strings are specified via URLs. The URL format is driver dependent but generally has the form:\n`dbdriver://username:password@host:port/dbname?param1=true&param2=false`. You can optionally set the `SQL_URL`\nenvironment variable instead.\n"
      }
    },
    "type": "object",
    "inputProperties": {
      "maxIdleConns": {
        "type": "number",
        "description": "Sets the maximum number of connections in the idle connection pool. Default is `2`. See Go's documentation on\n[DB.SetMaxIdleConns](https://golang.org/pkg/database/sql/#DB.SetMaxIdleConns).\n"
      },
      "maxOpenConns": {
        "type": "number",
        "description": "Sets the maximum number of open connections to the database. Default is `0` (unlimited). See Go's documentation on\n[DB.SetMaxOpenConns](https://golang.org/pkg/database/sql/#DB.SetMaxOpenConns).\n"
      },
      "url": {
        "type": "string",
        "description": "Database connection strings are specified via URLs. The URL format is driver dependent but generally has the form:\n`dbdriver://username:password@host:port/dbname?param1=true&param2=false`. You can optionally set the `SQL_URL`\nenvironment variable instead.\n"
      }
    }
  },
  "resources": {
    "sql:index/migrate:Migrate": {
      "description": "## Example Usage\n\n",
      "properties": {
        "completeMigrations": {
          "type": "array",
          "items": {
            "$ref": "#/types/sql:index%2FMigrateCompleteMigration:MigrateCompleteMigration"
          },
          "description": "The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.\n"
        },
        "migrations": {
          "type": "array",
          "items": {
            "$ref": "#/types/sql:index%2FMigrateMigration:MigrateMigration"
          }
        }
      },
      "type": "object",
      "required": [
        "completeMigrations"
      ],
      "inputProperties": {
        "migrations": {
          "type": "array",
          "items": {
            "$ref": "#/types/sql:index%2FMigrateMigration:MigrateMigration"
          }
        }
      },
      "stateInputs": {
        "description": "Input properties used for looking up and filtering Migrate resources.\n",
        "properties": {
          "completeMigrations": {
            "type": "array",
            "items": {
              "$ref": "#/types/sql:index%2FMigrateCompleteMigration:MigrateCompleteMigration"
            },
            "description": "The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.\n"
          },
          "migrations": {
            "type": "array",
            "items": {
              "$ref": "#/types/sql:index%2FMigrateMigration:MigrateMigration"
            }
          }
        },
        "type": "object"
      }
    },
    "sql:index/migrateDirectory:MigrateDirectory": {
      "description": "## Example Usage\n\n<!--Start PulumiCodeChooser -->\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as sql from \"@pulumi/sql\";\n\nconst db = new sql.MigrateDirectory(\"db\", {path: `${path.module}/migrations`});\nconst users = sql.getQuery({\n    query: \"select * from users\",\n});\nexport const rowcount = users.then(users => users.results).length;\n```\n```python\nimport pulumi\nimport pulumi_sql as sql\n\ndb = sql.MigrateDirectory(\"db\", path=f\"{path['module']}/migrations\")\nusers = sql.get_query(query=\"select * from users\")\npulumi.export(\"rowcount\", len(users.results))\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Sql = Pulumi.Sql;\n\nreturn await Deployment.RunAsync(() => \n{\n    var db = new Sql.MigrateDirectory(\"db\", new()\n    {\n        Path = $\"{path.Module}/migrations\",\n    });\n\n    var users = Sql.GetQuery.Invoke(new()\n    {\n        Query = \"select * from users\",\n    });\n\n    return new Dictionary<string, object?>\n    {\n        [\"rowcount\"] = users.Apply(getQueryResult => getQueryResult.Results).Length,\n    };\n});\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/pulumi/pulumi-terraform-provider/sdks/go/sql/sql\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := sql.NewMigrateDirectory(ctx, \"db\", &sql.MigrateDirectoryArgs{\n\t\t\tPath: pulumi.Sprintf(\"%v/migrations\", path.Module),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tusers, err := sql.GetQuery(ctx, &sql.GetQueryArgs{\n\t\t\tQuery: \"select * from users\",\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tctx.Export(\"rowcount\", pulumi.Int(len(users.Results)))\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.sql.MigrateDirectory;\nimport com.pulumi.sql.MigrateDirectoryArgs;\nimport com.pulumi.sql.SqlFunctions;\nimport com.pulumi.sql.inputs.GetQueryArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n    public static void main(String[] args) {\n        Pulumi.run(App::stack);\n    }\n\n    public static void stack(Context ctx) {\n        var db = new MigrateDirectory(\"db\", MigrateDirectoryArgs.builder()\n            .path(String.format(\"%s/migrations\", path.module()))\n            .build());\n\n        final var users = SqlFunctions.getQuery(GetQueryArgs.builder()\n            .query(\"select * from users\")\n            .build());\n\n        ctx.export(\"rowcount\", users.applyValue(getQueryResult -> getQueryResult.results()).length());\n    }\n}\n```\n<!--End PulumiCodeChooser -->\n",
      "properties": {
        "completeMigrations": {
          "type": "array",
          "items": {
            "$ref": "#/types/sql:index%2FMigrateDirectoryCompleteMigration:MigrateDirectoryCompleteMigration"
          },
          "description": "The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.\n"
        },
        "path": {
          "type": "string",
          "description": "The path of the SQL migration files. For a path relative to the current module, use `path.module`.\n"
        },
        "singleFileSplit": {
          "type": "string",
          "description": "Set this to a value if your migration up and down are in a single file, split on some constant string (ie. in the case of [shmig](https://github.com/mbucc/shmig) you would use `-- ==== DOWN ====`).\n"
        }
      },
      "type": "object",
      "required": [
        "completeMigrations",
        "path"
      ],
      "inputProperties": {
        "path": {
          "type": "string",
          "description": "The path of the SQL migration files. For a path relative to the current module, use `path.module`.\n"
        },
        "singleFileSplit": {
          "type": "string",
          "description": "Set this to a value if your migration up and down are in a single file, split on some constant string (ie. in the case of [shmig](https://github.com/mbucc/shmig) you would use `-- ==== DOWN ====`).\n"
        }
      },
      "requiredInputs": [
        "path"
      ],
      "stateInputs": {
        "description": "Input properties used for looking up and filtering MigrateDirectory resources.\n",
        "properties": {
          "completeMigrations": {
            "type": "array",
            "items": {
              "$ref": "#/types/sql:index%2FMigrateDirectoryCompleteMigration:MigrateDirectoryCompleteMigration"
            },
            "description": "The completed migrations that have been run against your database. This list is used as storage to migrate down or as a trigger for downstream dependencies.\n"
          },
          "path": {
            "type": "string",
            "description": "The path of the SQL migration files. For a path relative to the current module, use `path.module`.\n"
          },
          "singleFileSplit": {
            "type": "string",
            "description": "Set this to a value if your migration up and down are in a single file, split on some constant string (ie. in the case of [shmig](https://github.com/mbucc/shmig) you would use `-- ==== DOWN ====`).\n"
          }
        },
        "type": "object"
      }
    }
  },
  "functions": {
    "sql:index/getDriver:getDriver": {
      "description": "The `sql.getDriver` datasource allows you to determine which driver is in use by the provider. This is mostly useful for module development when you may communicate with multiple types of databases.\n",
      "outputs": {
        "description": "A collection of values returned by getDriver.\n",
        "properties": {
          "id": {
            "deprecationMessage": "Deprecated",
            "description": "This attribute is only present for some compatibility issues and should not be used. It will be removed in a future version.\n",
            "type": "string"
          },
          "name": {
            "description": "The name of the driver, currently this will be one of `pgx`, `mysql`, or `sqlserver`.\n",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      }
    },
    "sql:index/getQuery:getQuery": {
      "description": "The `sql.getQuery` datasource allows you to execute a SQL query against the database of your choice.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as sql from \"@pulumi/sql\";\n\nconst test = sql.getQuery({\n    query: \"select 1 as number, 'foo' as string\",\n});\n// The number column in this case is a Terraform \"Number\" type\n// so you can use it as such:\nconst myMath = test.then(test =\u003e 1 + test.results?.[0]?.number);\nexport const math = myMath;\n```\n```python\nimport pulumi\nimport pulumi_sql as sql\n\ntest = sql.get_query(query=\"select 1 as number, 'foo' as string\")\n# The number column in this case is a Terraform \"Number\" type\n# so you can use it as such:\nmy_math = 1 + test.results[0][\"number\"]\npulumi.export(\"math\", my_math)\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Sql = Pulumi.Sql;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n    var test = Sql.GetQuery.Invoke(new()\n    {\n        Query = \"select 1 as number, 'foo' as string\",\n    });\n\n    // The number column in this case is a Terraform \"Number\" type\n    // so you can use it as such:\n    var myMath = 1 + test.Apply(getQueryResult =\u003e getQueryResult.Results[0]?.Number);\n\n    return new Dictionary\u003cstring, object?\u003e\n    {\n        [\"math\"] = myMath,\n    };\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-terraform-provider/sdks/go/sql/sql\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\ttest, err := sql.GetQuery(ctx, \u0026sql.GetQueryArgs{\n\t\t\tQuery: \"select 1 as number, 'foo' as string\",\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// The number column in this case is a Terraform \"Number\" type\n\t\t// so you can use it as such:\n\t\tmyMath := 1 + test.Results[0].Number\n\t\tctx.Export(\"math\", myMath)\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.sql.SqlFunctions;\nimport com.pulumi.sql.inputs.GetQueryArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n    public static void main(String[] args) {\n        Pulumi.run(App::stack);\n    }\n\n    public static void stack(Context ctx) {\n        final var test = SqlFunctions.getQuery(GetQueryArgs.builder()\n            .query(\"select 1 as number, 'foo' as string\")\n            .build());\n\n        // The number column in this case is a Terraform \"Number\" type\n        // so you can use it as such:\n        final var myMath = 1 + test.applyValue(getQueryResult -\u003e getQueryResult.results()[0].number());\n\n        ctx.export(\"math\", myMath);\n    }\n}\n```\n\u003c!--End PulumiCodeChooser --\u003e\n",
      "inputs": {
        "description": "A collection of arguments for invoking getQuery.\n",
        "properties": {
          "query": {
            "type": "string",
            "description": "The query to execute. The types in this query will be reflected in the typing of the `result` attribute.\n"
          }
        },
        "type": "object",
        "required": [
          "query"
        ]
      },
      "outputs": {
        "description": "A collection of values returned by getQuery.\n",
        "properties": {
          "id": {
            "deprecationMessage": "Deprecated",
            "description": "This attribute is only present for some compatibility issues and should not be used. It will be removed in a future version.\n",
            "type": "string"
          },
          "query": {
            "description": "The query to execute. The types in this query will be reflected in the typing of the `result` attribute.\n",
            "type": "string"
          },
          "results": {
            "description": "The result of the query. This will be a list of objects. Each object will have attributes with names that match column names and types that match column types. The exact translation of types is dependent upon the database driver.\n",
            "items": {
              "$ref": "pulumi.json#/Any"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "query",
          "results"
        ],
        "type": "object"
      }
    }
  },
  "parameterization": {
    "baseProvider": {
      "name": "terraform-provider",
      "version": "0.10.0"
    },
    "parameter": "eyJyZW1vdGUiOnsidXJsIjoicmVnaXN0cnkub3BlbnRvZnUub3JnL3BhdWx0eW5nL3NxbCIsInZlcnNpb24iOiIwLjUuMCJ9fQ=="
  }
}
