ecodev-core 0.0.29__py3-none-any.whl → 0.0.30__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ecodev-core might be problematic. Click here for more details.

@@ -2,6 +2,8 @@
2
2
  Module implementing postgresql connection
3
3
  """
4
4
  from typing import Callable
5
+ from typing import List
6
+ from typing import Optional
5
7
  from urllib.parse import quote
6
8
 
7
9
  from pydantic_settings import BaseSettings
@@ -34,11 +36,17 @@ DB_URL = f'postgresql://{DB.db_username}:{_PASSWORD}@{DB.db_host}:{DB.db_port}/{
34
36
  engine = create_engine(DB_URL)
35
37
 
36
38
 
37
- def create_db_and_tables(model: Callable) -> None:
39
+ def create_db_and_tables(model: Callable, excluded_tables: Optional[List[str]] = None) -> None:
38
40
  """
39
41
  Create all tables based on the declared schemas in core/models thanks to sqlmodel
42
+ Does not create the tables which are passed in the optional list of excluded tables,
43
+ must be the table names
40
44
  """
41
45
  log.info(f'Inserting on the fly {model} and all other domain tables')
46
+ SQLModel.metadata.tables = {table: meta_data for table, meta_data in
47
+ SQLModel.metadata.__dict__.get('tables').items()
48
+ if not excluded_tables or table
49
+ not in excluded_tables}
42
50
  SQLModel.metadata.create_all(engine)
43
51
 
44
52
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ecodev-core
3
- Version: 0.0.29
3
+ Version: 0.0.30
4
4
  Summary: Low level sqlmodel/fastapi/pydantic building blocks
5
5
  License: MIT
6
6
  Author: Thomas Epelbaum
@@ -7,7 +7,7 @@ ecodev_core/authentication.py,sha256=aLMk2_fn1Fodrby2ywZraB3JTSsSrPsBiQq0ag0ySiY
7
7
  ecodev_core/backup.py,sha256=8fwBHic6hE8swNESIayZqqWZFHFz5f-puBWSt5f_ZLw,3119
8
8
  ecodev_core/check_dependencies.py,sha256=aFn8GI4eBbuJT8RxsfhSSnlpNYYj_LPOH-tZF0EqfKQ,6917
9
9
  ecodev_core/custom_equal.py,sha256=2gRn0qpyJ8-Kw9GQSueu0nLngLrRrwyMPlP6zqPac0U,899
10
- ecodev_core/db_connection.py,sha256=qRcs0MjLFfhO7pnSof1l1m1BbPqYfEsUlMQkKT9fn_4,1798
10
+ ecodev_core/db_connection.py,sha256=bc5MujZ57f204wTsuNVdn1JdP-zBzkDJxHmdxBDTiNs,2286
11
11
  ecodev_core/db_filters.py,sha256=T_5JVF27UEu7sC6NOm7-W3_Y0GLfbWQO_EeTXcD2cv8,5041
12
12
  ecodev_core/db_insertion.py,sha256=RSCyAlUObbBlWJuMRX-YFY4VgtWqYLdwRqMWw--x95Y,3646
13
13
  ecodev_core/db_retrieval.py,sha256=IxyF3ZtKgACLiNFggK7boKggvMRKYDRD2IimxU4dap4,7345
@@ -20,7 +20,7 @@ ecodev_core/permissions.py,sha256=WAx-ilMu8LlQp2sjJVdkhNQieytEaEm8577ZF1HWeTY,50
20
20
  ecodev_core/pydantic_utils.py,sha256=e3GH50JmcpTmd2UgrB94QSwWOlOCW3WIlVdyX9C4T-U,741
21
21
  ecodev_core/read_write.py,sha256=auJ5bBJTVGkLRkiP_vZxVCX64B0Y-9qpsaDhovHmbas,996
22
22
  ecodev_core/safe_utils.py,sha256=JCfxo6fcznjsL-XHNJ1TKo1UvfJB83WT5jpTFmtJwsE,6160
23
- ecodev_core-0.0.29.dist-info/LICENSE.md,sha256=jebQDe1ib9LAODuNvcSoo2CoqS6P0_q8--mMTICh_kI,1074
24
- ecodev_core-0.0.29.dist-info/METADATA,sha256=ixhS45ZEBips9qHEXN-RRRzCzJvAkiHigPV79-NotUo,3311
25
- ecodev_core-0.0.29.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
26
- ecodev_core-0.0.29.dist-info/RECORD,,
23
+ ecodev_core-0.0.30.dist-info/LICENSE.md,sha256=jebQDe1ib9LAODuNvcSoo2CoqS6P0_q8--mMTICh_kI,1074
24
+ ecodev_core-0.0.30.dist-info/METADATA,sha256=TpcaN_1OgOD_ept1IJigXnqG-AkqrSy3OskEG3s3824,3311
25
+ ecodev_core-0.0.30.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
26
+ ecodev_core-0.0.30.dist-info/RECORD,,