Generates and applies the SQL schema directly to the given client. :param client: The DB client to generate Schema SQL for :param safe: When set to true, creates the table only when it does not already exist.
(client: BaseDBAsyncClient, safe: bool)
| 33 | |
| 34 | |
| 35 | async def generate_schema_for_client(client: BaseDBAsyncClient, safe: bool) -> None: |
| 36 | """ |
| 37 | Generates and applies the SQL schema directly to the given client. |
| 38 | |
| 39 | :param client: The DB client to generate Schema SQL for |
| 40 | :param safe: When set to true, creates the table only when it does not already exist. |
| 41 | """ |
| 42 | generator = client.schema_generator(client) |
| 43 | schema = get_schema_sql(client, safe) |
| 44 | logger.debug("Creating schema: %s", schema) |
| 45 | if schema: # pragma: nobranch |
| 46 | await generator.generate_from_string(schema) |
| 47 | |
| 48 | |
| 49 | def chunk(instances: Iterable[Any], batch_size: int | None = None) -> Iterable[Iterable[Any]]: |
no test coverage detected
searching dependent graphs…