dmart 1.4.6__py3-none-any.whl → 1.4.7__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.
Files changed (29) hide show
  1. alembic/README +1 -0
  2. alembic/__pycache__/__init__.cpython-314.pyc +0 -0
  3. alembic/__pycache__/env.cpython-314.pyc +0 -0
  4. alembic/env.py +6 -3
  5. alembic/notes.txt +11 -0
  6. alembic/script.py.mako +28 -0
  7. alembic/versions/__pycache__/0f3d2b1a7c21_add_authz_materialized_views.cpython-314.pyc +0 -0
  8. alembic/versions/__pycache__/10d2041b94d4_last_checksum_history.cpython-314.pyc +0 -0
  9. alembic/versions/__pycache__/1cf4e1ee3cb8_ext_permission_with_filter_fields_values.cpython-314.pyc +0 -0
  10. alembic/versions/__pycache__/26bfe19b49d4_rm_failedloginattempts.cpython-314.pyc +0 -0
  11. alembic/versions/__pycache__/3c8bca2219cc_add_otp_table.cpython-314.pyc +0 -0
  12. alembic/versions/__pycache__/6675fd9dfe42_remove_unique_from_sessions_table.cpython-314.pyc +0 -0
  13. alembic/versions/__pycache__/71bc1df82e6a_adding_user_last_login_at.cpython-314.pyc +0 -0
  14. alembic/versions/__pycache__/74288ccbd3b5_initial.cpython-314.pyc +0 -0
  15. alembic/versions/__pycache__/7520a89a8467_rm_activesession_table.cpython-314.pyc +0 -0
  16. alembic/versions/__pycache__/848b623755a4_make_created_nd_updated_at_required.cpython-314.pyc +0 -0
  17. alembic/versions/__pycache__/8640dcbebf85_add_notes_to_users.cpython-314.pyc +0 -0
  18. alembic/versions/__pycache__/91c94250232a_adding_fk_on_owner_shortname.cpython-314.pyc +0 -0
  19. alembic/versions/__pycache__/98ecd6f56f9a_ext_meta_with_owner_group_shortname.cpython-314.pyc +0 -0
  20. alembic/versions/__pycache__/9aae9138c4ef_indexing_created_at_updated_at.cpython-314.pyc +0 -0
  21. alembic/versions/__pycache__/b53f916b3f6d_json_to_jsonb.cpython-314.pyc +0 -0
  22. alembic/versions/__pycache__/eb5f1ec65156_adding_user_locked_to_device.cpython-314.pyc +0 -0
  23. alembic/versions/__pycache__/f7a4949eed19_adding_query_policies_to_meta.cpython-314.pyc +0 -0
  24. {dmart-1.4.6.dist-info → dmart-1.4.7.dist-info}/METADATA +1 -1
  25. {dmart-1.4.6.dist-info → dmart-1.4.7.dist-info}/RECORD +29 -7
  26. dmart.py +16 -0
  27. {dmart-1.4.6.dist-info → dmart-1.4.7.dist-info}/WHEEL +0 -0
  28. {dmart-1.4.6.dist-info → dmart-1.4.7.dist-info}/entry_points.txt +0 -0
  29. {dmart-1.4.6.dist-info → dmart-1.4.7.dist-info}/top_level.txt +0 -0
alembic/README ADDED
@@ -0,0 +1 @@
1
+ Generic single-database configuration.
Binary file
alembic/env.py CHANGED
@@ -19,9 +19,12 @@ config = context.config
19
19
  if config.config_file_name is not None:
20
20
  fileConfig(config.config_file_name)
21
21
 
22
- driver = settings.database_driver.replace('+asyncpg', '+psycopg')
23
- database_connection_string = f"{driver}://{settings.database_username}:{settings.database_password}@{settings.database_host}:{settings.database_port}"
24
- connection_string = f"{database_connection_string}/{settings.database_name}"
22
+ if "sqlite" in settings.database_driver:
23
+ connection_string = f"sqlite:///{settings.database_name}"
24
+ else:
25
+ driver = settings.database_driver.replace('+asyncpg', '+psycopg')
26
+ database_connection_string = f"{driver}://{settings.database_username}:{settings.database_password}@{settings.database_host}:{settings.database_port}"
27
+ connection_string = f"{database_connection_string}/{settings.database_name}"
25
28
  config.set_main_option('sqlalchemy.url', connection_string)
26
29
 
27
30
  # add your model's MetaData object here
alembic/notes.txt ADDED
@@ -0,0 +1,11 @@
1
+ # 1st : Make sure in alembic.ini to have proper db config for sqlalchemy.url
2
+
3
+
4
+ # To establish the base for a previously created database run the following
5
+
6
+ CREATE TABLE alembic_version (
7
+ version_num VARCHAR(32) NOT NULL,
8
+ CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num)
9
+ );
10
+
11
+ INSERT INTO alembic_version (version_num) VALUES ('74288ccbd3b5') RETURNING alembic_version.version_num;
alembic/script.py.mako ADDED
@@ -0,0 +1,28 @@
1
+ """${message}
2
+
3
+ Revision ID: ${up_revision}
4
+ Revises: ${down_revision | comma,n}
5
+ Create Date: ${create_date}
6
+
7
+ """
8
+ from typing import Sequence, Union
9
+
10
+ from alembic import op
11
+ import sqlalchemy as sa
12
+ import sqlmodel
13
+ import sqlmodel.sql.sqltypes
14
+ ${imports if imports else ""}
15
+
16
+ # revision identifiers, used by Alembic.
17
+ revision: str = ${repr(up_revision)}
18
+ down_revision: Union[str, None] = ${repr(down_revision)}
19
+ branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)}
20
+ depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)}
21
+
22
+
23
+ def upgrade() -> None:
24
+ ${upgrades if upgrades else "pass"}
25
+
26
+
27
+ def downgrade() -> None:
28
+ ${downgrades if downgrades else "pass"}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dmart
3
- Version: 1.4.6
3
+ Version: 1.4.7
4
4
  Requires-Python: >=3.11
5
5
  Requires-Dist: fastapi
6
6
  Requires-Dist: pydantic
@@ -1,6 +1,6 @@
1
1
  bundler.py,sha256=so8ZJResb1PcOH5vboa_mpFAdYr_T8u8DbbFXd570Lg,1704
2
2
  data_generator.py,sha256=CnE-VHEeX7-lAXtqCgbRqR9WHjTuOgeiZcviYrHAmho,2287
3
- dmart.py,sha256=1oQXSPgHiVpSPKhKy2EhP2Mmu1ZKPEdKqbXehXUj7MA,21760
3
+ dmart.py,sha256=c3pjCY8HrTv6nN6HngyrwTQ_F2Ll6ejZRclQi2b2rhI,22564
4
4
  get_settings.py,sha256=Sbe2WCoiK398E7HY4SNLfDN_GmE8knR4M-YJWF31jcg,153
5
5
  main.py,sha256=KZGhIL6AnEm5ZAPy4IvhBDpzSTjuodilV7NafNOyhzM,19676
6
6
  migrate.py,sha256=hn1MZoVby_Jjqhc7y3CrLcGD619QmVZv3PONNvO7VKQ,665
@@ -12,8 +12,13 @@ schema_modulate.py,sha256=vB7NxvqghqNpFe__p0ll03WsvNftzxBbQ6UXB2UfxNU,6454
12
12
  set_admin_passwd.py,sha256=Ei8wnoJ_UDHIXmMb-E_dd_NqyM6Gt5AgJPJ4fAxARXI,1950
13
13
  sync.py,sha256=FlmubtlnFaxtZkbRV1-eyS_Sx5KBRvWyIZjvd0Tiar4,7339
14
14
  websocket.py,sha256=Q8WUTvOTBHKP5xy5wim8yn0t-BfjrPwx7J_6vbzAm1A,7576
15
+ alembic/README,sha256=MVlc9TYmr57RbhXET6QxgyCcwWP7w-vLkEsirENqiIQ,38
15
16
  alembic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- alembic/env.py,sha256=z12UKhorKSOKEovOCQOwRjfR_tup4VeRlhcB1UPk3Xw,2700
17
+ alembic/env.py,sha256=ahYndeefOvhqeZ7EQMkI1NdqJVQCUqLxYNP_MtJeDfY,2821
18
+ alembic/notes.txt,sha256=X7LYSNmulLRiAUXvw07Z85bSGRTnx4NUpoNC9D2DfO8,395
19
+ alembic/script.py.mako,sha256=u-ABdYW1tcIILgJFJdQZYLxoAI8Awd6wZbx30rY6fxU,680
20
+ alembic/__pycache__/__init__.cpython-314.pyc,sha256=CcFVDJxqk1nR7sZH9dbbffqoMo0jRHW-MiSSGFX--qA,174
21
+ alembic/__pycache__/env.cpython-314.pyc,sha256=9L-2pPlUSIrHh1JLQilY0TDxqo7_ikqfKhFwImuCuwk,3935
17
22
  alembic/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
23
  alembic/scripts/calculate_checksums.py,sha256=v2NLEvReA9V3noJE-BWANgKDdhc8Mqg1ZmJJ8nc8sGI,3443
19
24
  alembic/scripts/migration_f7a4949eed19.py,sha256=oUXuxjU4MbVafm4S-xu5J_4apHqW6hQZ8ftpJtCtM28,1462
@@ -35,6 +40,23 @@ alembic/versions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
35
40
  alembic/versions/b53f916b3f6d_json_to_jsonb.py,sha256=LPnevQjbjs0KrwqxYHtGUC6mSBBsUpiCBnwD-FN2x50,24840
36
41
  alembic/versions/eb5f1ec65156_adding_user_locked_to_device.py,sha256=Z9skCus52jg_xV5a7JVYK3IenNlvsdMKIFf1H5POst0,1030
37
42
  alembic/versions/f7a4949eed19_adding_query_policies_to_meta.py,sha256=LA4rx3u0Ei5m4OcSsVYHBsGMeKOJdx8G88yK1kBLFys,2307
43
+ alembic/versions/__pycache__/0f3d2b1a7c21_add_authz_materialized_views.cpython-314.pyc,sha256=mevU12_Y6RzGxc8Xg1bkFIVaNu7uvx7zCQ2j6bn_Pqo,3955
44
+ alembic/versions/__pycache__/10d2041b94d4_last_checksum_history.cpython-314.pyc,sha256=n3eMeDeLN8WXXzoKA-8b4t9k-WQF4FPVYIRReNm-uN4,6199
45
+ alembic/versions/__pycache__/1cf4e1ee3cb8_ext_permission_with_filter_fields_values.cpython-314.pyc,sha256=_8yowo72FtcMsYQOp2vpy_hWJ5QlDOPsDsEt6NOr9cY,2649
46
+ alembic/versions/__pycache__/26bfe19b49d4_rm_failedloginattempts.cpython-314.pyc,sha256=1PYF87QiiSXEmHUM6wnq9Ck_ktq981W3TgS-_7QqG4M,3309
47
+ alembic/versions/__pycache__/3c8bca2219cc_add_otp_table.cpython-314.pyc,sha256=HD6h3iYtGyhDcOjRK4xWa9Hl6YzdIszmyO95wPZvFOM,2710
48
+ alembic/versions/__pycache__/6675fd9dfe42_remove_unique_from_sessions_table.cpython-314.pyc,sha256=k71q5tLr6x2cDoHw4pDNeBem136qz2XFjUg11a6DDpM,2422
49
+ alembic/versions/__pycache__/71bc1df82e6a_adding_user_last_login_at.cpython-314.pyc,sha256=35cwhVRGhtvREO4j3pBDtGoSD8sZd0MdZ0SRZKLsK5s,3399
50
+ alembic/versions/__pycache__/74288ccbd3b5_initial.cpython-314.pyc,sha256=BDS6zx-enw-oWeAIju5plp4lB10q8BeFwBnaUDEgtKY,28589
51
+ alembic/versions/__pycache__/7520a89a8467_rm_activesession_table.cpython-314.pyc,sha256=x5m_sxYMDP6myKKlVTivP-VM-2EH6d0D21pv9URFyXU,2791
52
+ alembic/versions/__pycache__/848b623755a4_make_created_nd_updated_at_required.cpython-314.pyc,sha256=A4E0A4eJliMs-uNeVZfGo2j8UrXhdRrtBB1Ky-OA_O0,7917
53
+ alembic/versions/__pycache__/8640dcbebf85_add_notes_to_users.cpython-314.pyc,sha256=94zNRuU2L3ra43Z3eDa4duVMXMsKTLiNUUj7lUxeZzY,2526
54
+ alembic/versions/__pycache__/91c94250232a_adding_fk_on_owner_shortname.cpython-314.pyc,sha256=IIEupLleN5nEUUpTCXWGV-LXsdzGJrcnrolJmpi8WMo,6383
55
+ alembic/versions/__pycache__/98ecd6f56f9a_ext_meta_with_owner_group_shortname.cpython-314.pyc,sha256=tPXDQ_TCEK9sv3ZinAk9vUJcwuqE75ymoT_0O_0qLss,5657
56
+ alembic/versions/__pycache__/9aae9138c4ef_indexing_created_at_updated_at.cpython-314.pyc,sha256=D3m2fuhNbUUNZi21p45UDy8uUmAOio1RZzqoPnKD6G4,6990
57
+ alembic/versions/__pycache__/b53f916b3f6d_json_to_jsonb.cpython-314.pyc,sha256=tsx4FNUeGpuqnMm_ewhDnjXGdBOzypSVqo_AQtzoOVk,34026
58
+ alembic/versions/__pycache__/eb5f1ec65156_adding_user_locked_to_device.cpython-314.pyc,sha256=v47hBAxgbjkSAsEn8O2EUTUOPR0D9bVD8fJl9erlpzM,2514
59
+ alembic/versions/__pycache__/f7a4949eed19_adding_query_policies_to_meta.cpython-314.pyc,sha256=jCW56_bq_qQM6H9CjPu2qOm8gywSO7TEHHywlyv1qcI,5099
38
60
  api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
61
  api/info/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
62
  api/info/router.py,sha256=sQZZor7A-uDzsJX39aqEA7bMZOJ-WTitYeFvVNWfaHw,3938
@@ -258,8 +280,8 @@ utils/ticket_sys_utils.py,sha256=9QAlW2iiy8KyxQRBDj_WmzS5kKb0aYJmGwd4qzmGVqo,700
258
280
  utils/web_notifier.py,sha256=QM87VVid2grC5lK3NdS1yzz0z1wXljr4GChJOeK86W4,843
259
281
  utils/templates/activation.html.j2,sha256=XAMKCdoqONoc4ZQucD0yV-Pg5DlHHASZrTVItNS-iBE,640
260
282
  utils/templates/reminder.html.j2,sha256=aoS8bTs56q4hjAZKsb0jV9c-PIURBELuBOpT_qPZNVU,639
261
- dmart-1.4.6.dist-info/METADATA,sha256=0jB-34rhbCWG-Ox3mtL0GkRMt4DZ8fYarnibCLJZ4TA,2068
262
- dmart-1.4.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
263
- dmart-1.4.6.dist-info/entry_points.txt,sha256=GjfoGh1bpxuU9HHGJzbtCFPNptHv9TryxHMN3uBSKpg,37
264
- dmart-1.4.6.dist-info/top_level.txt,sha256=iPbBisVNr4KDWyZhxMl2x3oJSgf71knWXMh21_xutrE,266
265
- dmart-1.4.6.dist-info/RECORD,,
283
+ dmart-1.4.7.dist-info/METADATA,sha256=2f5KC6N4KB_roEtTPf8Jru7f7cKl2X78slMZimPfkgE,2068
284
+ dmart-1.4.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
285
+ dmart-1.4.7.dist-info/entry_points.txt,sha256=GjfoGh1bpxuU9HHGJzbtCFPNptHv9TryxHMN3uBSKpg,37
286
+ dmart-1.4.7.dist-info/top_level.txt,sha256=iPbBisVNr4KDWyZhxMl2x3oJSgf71knWXMh21_xutrE,266
287
+ dmart-1.4.7.dist-info/RECORD,,
dmart.py CHANGED
@@ -40,6 +40,7 @@ commands = """ server
40
40
  archive
41
41
  json_to_db
42
42
  db_to_json
43
+ migrate
43
44
  help
44
45
  version
45
46
  info
@@ -532,6 +533,21 @@ def main():
532
533
  asyncio.run(json_to_db_migration())
533
534
  case "db_to_json":
534
535
  db_to_json_migration()
536
+ case "migrate":
537
+ original_path = sys.path[:]
538
+ # Remove current directory from path to allow importing the 'alembic' library
539
+ # instead of the 'alembic' migrations folder.
540
+ sys.path = [p for p in sys.path if p not in ('', os.getcwd(), str(Path(__file__).resolve().parent))]
541
+ try:
542
+ from alembic.config import Config
543
+ from alembic import command
544
+ finally:
545
+ sys.path = original_path
546
+
547
+ alembic_ini_path = Path(__file__).resolve().parent / "alembic.ini"
548
+ alembic_cfg = Config(str(alembic_ini_path))
549
+ alembic_cfg.set_main_option("script_location", str(Path(__file__).resolve().parent / "alembic"))
550
+ command.upgrade(alembic_cfg, "head")
535
551
  case "help":
536
552
  print("Available commands:")
537
553
  print(commands)
File without changes