maleo-foundation 0.0.55__tar.gz → 0.0.57__tar.gz
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.
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/PKG-INFO +1 -1
- maleo_foundation-0.0.57/maleo_foundation/db/database.py +40 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation.egg-info/PKG-INFO +1 -1
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/pyproject.toml +1 -1
- maleo_foundation-0.0.55/maleo_foundation/db/database.py +0 -41
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/README.md +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/clients/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/clients/general/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/clients/general/http.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/clients/google/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/clients/google/cloud/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/clients/google/cloud/logging.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/clients/google/cloud/secret.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/clients/google/cloud/storage.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/clients/utils/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/clients/utils/logger.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/constants.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/db/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/db/engine.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/db/session.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/enums.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/expanded_types/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/expanded_types/client.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/expanded_types/query.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/expanded_types/service.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/extended_types.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/middlewares/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/middlewares/base.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/middlewares/cors.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/responses.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/schemas/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/schemas/general.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/schemas/parameter.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/schemas/result.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/transfers/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/transfers/parameters/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/transfers/parameters/client.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/transfers/parameters/general.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/transfers/parameters/service.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/transfers/results/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/transfers/results/client/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/transfers/results/client/controllers/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/transfers/results/client/controllers/http.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/transfers/results/client/service.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/transfers/results/service/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/transfers/results/service/controllers/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/transfers/results/service/controllers/rest.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/transfers/results/service/general.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/transfers/results/service/query.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/types.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/utils/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/utils/controller.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/utils/exceptions.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/utils/formatter/__init__.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/utils/formatter/case.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/utils/logger.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/utils/query.py +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation.egg-info/SOURCES.txt +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation.egg-info/dependency_links.txt +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation.egg-info/requires.txt +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation.egg-info/top_level.txt +0 -0
- {maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/setup.cfg +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from sqlalchemy import Engine, MetaData, Column, Integer, UUID, TIMESTAMP, Enum, func
|
|
2
|
+
from sqlalchemy.orm import declarative_base, declared_attr
|
|
3
|
+
from uuid import uuid4
|
|
4
|
+
from maleo_foundation.enums import BaseEnums
|
|
5
|
+
from maleo_foundation.utils.formatter.case import CaseFormatter
|
|
6
|
+
|
|
7
|
+
class DatabaseManager:
|
|
8
|
+
class BaseMixin:
|
|
9
|
+
__abstract__ = True
|
|
10
|
+
|
|
11
|
+
@declared_attr
|
|
12
|
+
def __tablename__(cls) -> str:
|
|
13
|
+
return CaseFormatter.to_snake_case(cls.__name__)
|
|
14
|
+
|
|
15
|
+
#* ----- ----- Common columns definition ----- ----- *#
|
|
16
|
+
|
|
17
|
+
#* Identifiers
|
|
18
|
+
id = Column(Integer, primary_key=True)
|
|
19
|
+
uuid = Column(UUID, default=uuid4, unique=True, nullable=False)
|
|
20
|
+
|
|
21
|
+
#* Timestamps
|
|
22
|
+
created_at = Column(TIMESTAMP(timezone=True), server_default=func.now(), nullable=False)
|
|
23
|
+
updated_at = Column(TIMESTAMP(timezone=True), server_default=func.now(), onupdate=func.now(), nullable=False)
|
|
24
|
+
deleted_at = Column(TIMESTAMP(timezone=True))
|
|
25
|
+
restored_at = Column(TIMESTAMP(timezone=True))
|
|
26
|
+
deactivated_at = Column(TIMESTAMP(timezone=True))
|
|
27
|
+
activated_at = Column(TIMESTAMP(timezone=True), server_default=func.now(), nullable=False)
|
|
28
|
+
|
|
29
|
+
#* Statuses
|
|
30
|
+
status = Column(Enum(BaseEnums.StatusType, name="statustype"), default=BaseEnums.StatusType.ACTIVE, nullable=False)
|
|
31
|
+
|
|
32
|
+
Base = declarative_base() #* Correct way to define a declarative base
|
|
33
|
+
|
|
34
|
+
#* Explicitly define the type of metadata
|
|
35
|
+
metadata:MetaData = Base.metadata
|
|
36
|
+
|
|
37
|
+
@classmethod
|
|
38
|
+
def initialize(cls, engine:Engine):
|
|
39
|
+
"""Creates the database tables if they do not exist."""
|
|
40
|
+
cls.metadata.create_all(engine)
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
from sqlalchemy import Engine, MetaData, Column, Integer, UUID, TIMESTAMP, Enum, func
|
|
2
|
-
from sqlalchemy.orm import declarative_base, declared_attr
|
|
3
|
-
from uuid import uuid4
|
|
4
|
-
from maleo_foundation.enums import BaseEnums
|
|
5
|
-
from maleo_foundation.utils.formatter.case import CaseFormatter
|
|
6
|
-
|
|
7
|
-
Base = declarative_base() #* Correct way to define a declarative base
|
|
8
|
-
|
|
9
|
-
class DatabaseManager:
|
|
10
|
-
class Base(Base): #* Inheriting from declarative_base
|
|
11
|
-
__abstract__ = True #* Ensures this class is not treated as a table itself
|
|
12
|
-
|
|
13
|
-
@declared_attr
|
|
14
|
-
def __tablename__(cls) -> str:
|
|
15
|
-
"""Automatically generates table name (in snake_case) based on class name."""
|
|
16
|
-
return CaseFormatter.to_snake_case(cls.__name__)
|
|
17
|
-
|
|
18
|
-
#* ----- ----- Common columns definition ----- ----- *#
|
|
19
|
-
|
|
20
|
-
#* Identifiers
|
|
21
|
-
id = Column(name="id", type_=Integer, primary_key=True)
|
|
22
|
-
uuid = Column(name="uuid", type_=UUID, default=uuid4, unique=True, nullable=False)
|
|
23
|
-
|
|
24
|
-
#* Timestamps
|
|
25
|
-
created_at = Column(name="created_at", type_=TIMESTAMP(timezone=True), server_default=func.now(), nullable=False)
|
|
26
|
-
updated_at = Column(name="updated_at", type_=TIMESTAMP(timezone=True), server_default=func.now(), onupdate=func.now(), nullable=False)
|
|
27
|
-
deleted_at = Column(name="deleted_at", type_=TIMESTAMP(timezone=True))
|
|
28
|
-
restored_at = Column(name="restored_at", type_=TIMESTAMP(timezone=True))
|
|
29
|
-
deactivated_at = Column(name="deactivated_at", type_=TIMESTAMP(timezone=True))
|
|
30
|
-
activated_at = Column(name="activated_at", type_=TIMESTAMP(timezone=True), server_default=func.now(), nullable=False)
|
|
31
|
-
|
|
32
|
-
#* Statuses
|
|
33
|
-
status = Column(name="status", type_=Enum(BaseEnums.StatusType, name="statustype"), default=BaseEnums.StatusType.ACTIVE, nullable=False)
|
|
34
|
-
|
|
35
|
-
#* Explicitly define the type of metadata
|
|
36
|
-
metadata:MetaData = Base.metadata
|
|
37
|
-
|
|
38
|
-
@staticmethod
|
|
39
|
-
def initialize(engine: Engine):
|
|
40
|
-
"""Creates the database tables if they do not exist."""
|
|
41
|
-
DatabaseManager.metadata.create_all(engine)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/clients/general/__init__.py
RENAMED
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/clients/general/http.py
RENAMED
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/clients/google/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/clients/google/cloud/logging.py
RENAMED
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/clients/google/cloud/secret.py
RENAMED
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/clients/google/cloud/storage.py
RENAMED
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/clients/utils/__init__.py
RENAMED
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/clients/utils/logger.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/expanded_types/__init__.py
RENAMED
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/expanded_types/client.py
RENAMED
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/expanded_types/query.py
RENAMED
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/expanded_types/service.py
RENAMED
|
File without changes
|
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/middlewares/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/schemas/__init__.py
RENAMED
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/schemas/general.py
RENAMED
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/schemas/parameter.py
RENAMED
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/schemas/result.py
RENAMED
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/models/transfers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/utils/formatter/__init__.py
RENAMED
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation/utils/formatter/case.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maleo_foundation-0.0.55 → maleo_foundation-0.0.57}/maleo_foundation.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|