MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / create_id_map

Method create_id_map

src/ifcpatch/ifcpatch/recipes/Ifc2Sql.py:367–382  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

365 )
366
367 def create_id_map(self) -> None:
368 if self.sql_type == "sqlite":
369 statement = (
370 "CREATE TABLE IF NOT EXISTS id_map (ifc_id integer PRIMARY KEY NOT NULL UNIQUE, ifc_class text);"
371 )
372 elif self.sql_type == "mysql":
373 statement = """
374 CREATE TABLE `id_map` (
375 `ifc_id` int(10) unsigned NOT NULL,
376 `ifc_class` varchar(255) NOT NULL,
377 PRIMARY KEY (`ifc_id`)
378 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
379 """
380 else:
381 assert False
382 self.c.execute(statement)
383
384 def create_metadata(self) -> None:
385 # There is no "standard" SQL serialisation, so we propose a convention

Callers 1

patchMethod · 0.95

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected