{% set config = merged_configs.get('google_spanner_database', {}) %}
# Compliance: {{ compliance_comments.get('google_spanner_database', []) | join(', ') }}
resource "google_spanner_database" "main" {
  name                 = "{{ config.get('name', 'main-db') }}"
  project              = var.project_id
  instance             = google_spanner_instance.main.name
  database_dialect     = "{{ config.get('database_dialect', 'GOOGLE_STANDARD_SQL') }}"
  deletion_protection  = {{ config.get('deletion_protection', true) | lower }}
  version_retention_period = "{{ config.get('version_retention_period', '1h') }}"
{% if config.get('enable_drop_protection') %}
  enable_drop_protection = {{ config.get('enable_drop_protection') | lower }}
{% endif %}
}
