def create_bq_table()

in generate/resources/_bigquery.py [0:0]


def create_bq_table(self, bqt):
    "create bqt"
    bqt_name = bqt["table_id"]
    bqt["dataset_id"] = self.tf_ref("dataset_id", bqt["dataset_id"])
    bqt["project"] = self.tf_ref("project", bqt["project"])

    if bqt.get("table_constraints", {}):
        self.tf_param_list(
            bqt["table_constraints"],
            "foreign_keys",
            BigqueryTableTableConstraintsForeignKeys,
        )
    bigtable_option = bqt.get("external_data_configuration", {}).get(
        "bigtable_options", {}
    )
    for btcf in bigtable_option.get("column_family", []):
        self.tf_param_list(
            btcf,
            "column",
            BigqueryTableExternalDataConfigurationBigtableOptionsColumnFamilyColumn,
        )
    self.tf_param_list(
        bigtable_option,
        "column_family",
        BigqueryTableExternalDataConfigurationBigtableOptionsColumnFamily,
    )

    self.created["bq_table"][bqt_name] = BigqueryTable(self, f"bqt_{bqt_name}", **bqt)