apply 1.hcl

# test url flag
atlas schema inspect -u URL > inspected.hcl
cmp inspected.hcl script_cli_inspect.hcl

# test exclude flag on table.
atlas schema inspect -u URL --exclude "users" > inspected.hcl
cmp inspected.hcl notable.hcl

# test exclude flag on column.
atlas schema inspect -u URL --exclude "*.[ab]*" > inspected.hcl
cmp inspected.hcl id.hcl

# test exclude flag on column.
atlas schema inspect -u URL --exclude "*.*" > inspected.hcl
cmp inspected.hcl nocolumn.hcl


-- 1.hcl --
table "users" {
  schema = schema.$db
  column "id" {
    null = false
    type = int
  }
  column "a" {
    null = false
    type = int
  }
  column "b" {
    null = false
    type = int
  }
  column "ab" {
    null = false
    type = int
  }
  column "ac" {
    null = false
    type = int4
  }
}
schema "$db" {
}

-- script_cli_inspect.hcl --
table "users" {
  schema = schema.script_cli_inspect
  column "id" {
    null = false
    type = integer
  }
  column "a" {
    null = false
    type = integer
  }
  column "b" {
    null = false
    type = integer
  }
  column "ab" {
    null = false
    type = integer
  }
  column "ac" {
    null = false
    type = integer
  }
}
schema "script_cli_inspect" {
}
-- empty.hcl --
-- notable.hcl --
schema "script_cli_inspect" {
}
-- id.hcl --
table "users" {
  schema = schema.script_cli_inspect
  column "id" {
    null = false
    type = integer
  }
}
schema "script_cli_inspect" {
}
-- nocolumn.hcl --
table "users" {
  schema = schema.script_cli_inspect
}
schema "script_cli_inspect" {
}