cmdext

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package cmdext provides extensions to the Atlas CLI that may be moved to a separate repository in the future.

Index

Constants

This section is empty.

Variables

DataSources exposes the data sources provided by this package.

Functions

func QuerySrc

func QuerySrc(ctx *hcl.EvalContext, block *hclsyntax.Block) (cty.Value, error)

QuerySrc exposes the database/sql.Query as a schemahcl datasource.

data "sql" "tenants" {
  url = var.url
  query = <query>
  args = [<arg1>, <arg2>, ...]
}

env "prod" {
  for_each = toset(data.sql.tenants.values)
  url      = urlsetpath(var.url, each.value)
}

func RuntimeVarSrc

func RuntimeVarSrc(c *hcl.EvalContext, block *hclsyntax.Block) (cty.Value, error)

RuntimeVarSrc exposes the gocloud.dev/runtimevar as a schemahcl datasource.

data "runtimevar" "pass" {
  url = "driver://path?query=param"
}

locals {
  url = "mysql://root:${data.runtimevar.pass}@:3306/"
}

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL