app.db ====== .. py:module:: app.db .. autoapi-nested-parse:: Database file for the user-login-manager service, user authentication check and other general purpose tasks. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/app/db/mongodb/index /autoapi/app/db/postgres/index Attributes ---------- .. autoapisummary:: app.db.postgres_user_filepath app.db.postgres_password_filepath app.db.postgres_db_name_filepath app.db.postgres_user Classes ------- .. autoapisummary:: app.db.Base app.db.UserSQL Functions --------- .. autoapisummary:: app.db.init_db Module Contents --------------- .. py:class:: Base Bases: :py:obj:`sqlalchemy.orm.DeclarativeBase` Define base class. DeclarativeBase cannot be used directly. .. py:data:: postgres_user_filepath :value: '/run/secrets/scanhub_database_postgres_user' .. py:data:: postgres_password_filepath :value: '/run/secrets/scanhub_database_postgres_password' .. py:data:: postgres_db_name_filepath :value: '/run/secrets/scanhub_database_postgres_db_name' .. py:data:: postgres_user .. py:function:: init_db() -> None Initialize the database. .. py:class:: UserSQL Bases: :py:obj:`Base` User ORM model. .. py:attribute:: __tablename__ :value: 'user' .. py:attribute:: __table_args__ .. py:attribute:: username :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: first_name :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: last_name :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: email :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: role :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: password_hash :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: salt :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: access_token :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: last_activity_unixtime :type: sqlalchemy.orm.Mapped[int] .. py:attribute:: last_login_unixtime :type: sqlalchemy.orm.Mapped[int]