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
| Argument | Type | Required | Mutability | Description |
|---|---|---|---|---|
name | string | ✅ | Immutable | Database name. Unique within the parent lake. → details |
lake | string | ✅ | Immutable | Name of the parent lake. |
force_destroy | boolean | Immutable | When 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
| Attribute | Type | Description |
|---|---|---|
id | string | Composite identifier <lake>/<name>. Matches the import ID format. |
created_at | string | Creation time in RFC3339. |
last_updated_at | string | Last-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.