Skip to main content

onehouse_database

Creates a database — a lake-scoped namespace for tables.

Canonical reference

This page documents Terraform-specific behavior (HCL syntax, types, mutability, drift, import). For full parameter semantics, valid values, and defaults, see CREATE DATABASE and DELETE DATABASE. No ALTER DATABASE exists — all fields are immutable.

caution

Deleting a database is irreversible. By default, terraform destroy fails if the database contains tables or streams. Set force_destroy = true to cascade-delete all dependents.

Example Usage

resource "onehouse_database" "events" {
name = "events"
lake = onehouse_lake.warehouse.name
}

Argument Reference

ArgumentTypeRequiredMutabilityDescription
namestringImmutableDatabase name. Unique within the parent lake. → details
lakestringImmutableName of the parent lake.
force_destroybooleanImmutableWhen true, terraform destroy cascade-deletes all tables and streams in the database. Default false.

lake — immutability rationale

A database is permanently scoped to its parent lake. To move a database to a different lake, you must delete and recreate it. Set force_destroy = true if the database contains dependents.

Attribute Reference

AttributeTypeDescription
idstringComposite identifier <lake>/<name>. Matches the import ID format.
created_atstringCreation time in RFC3339.
last_updated_atstringLast-updated time in RFC3339. Currently equal to created_at (no ALTER DATABASE operation in the API yet); exposed for forward compatibility.

Import

Import IDs are composite: <lake>/<database>.

terraform import onehouse_database.events warehouse/events

Data Source

data "onehouse_database" "lookup" {
name = "events"
lake = "warehouse"
}

output "created_at" {
value = data.onehouse_database.lookup.created_at
}

Limitations

  • No Update. The API does not support ALTER DATABASE; all fields are immutable.