+
    *Qj                         ^ RI Ht ^ RIHtHtHt ^ RIHtHtH	t	 ^ RI
Ht  ^ RIt ^ RIHtHtHtHtHtHtHtHtHt ^ RIHt ^ RIHt  ! R
 R]4      tR#   ] d    ^ RIt L=i ; i  ] d
    ]! R	4      hi ; i)    )absolute_import)BaseJobStoreJobLookupErrorConflictingIdError)	maybe_refdatetime_to_utc_timestamputc_timestamp_to_datetime)JobN)	create_engineTableColumnMetaDataUnicodeFloatLargeBinaryselectand_)IntegrityError)nullz0SQLAlchemyJobStore requires SQLAlchemy installedc                      a a ] tR t^t oRtRRRR]P                  RR3V 3R lltV 3R ltR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tRtVtV ;t# )SQLAlchemyJobStoreat  
Stores jobs in a database table using SQLAlchemy.
The table will be created if it doesn't exist in the database.

Plugin alias: ``sqlalchemy``

:param str url: connection string (see
    :ref:`SQLAlchemy documentation <sqlalchemy:database_urls>` on this)
:param engine: an SQLAlchemy :class:`~sqlalchemy.engine.Engine` to use instead of creating a
    new one based on ``url``
:param str tablename: name of the table to store jobs in
:param metadata: a :class:`~sqlalchemy.schema.MetaData` instance to use instead of creating a
    new one
:param int pickle_protocol: pickle protocol level to use (for serialization), defaults to the
    highest available
:param str tableschema: name of the (existing) schema in the target database where the table
    should be
:param dict engine_options: keyword arguments to :func:`~sqlalchemy.create_engine`
    (ignored if ``engine`` is given)
Napscheduler_jobsc                  < \         \        V `  4        WPn        \	        V4      ;'       g    \        4       pV'       d   \	        V4      V n        M/V'       d   \        V3/ T;'       g    / B V n        M\        R 4      h\        W4\        R\        ^4      RR7      \        R\        ^4      RR7      \        R\        RR7      VR	7      V n        R
# )z%Need either "engine" or "url" definedidT)primary_keynext_run_time)index	job_stateF)nullable)schemaN)superr   __init__pickle_protocolr   r   enginer   
ValueErrorr   r   r   r   r   jobs_t)	selfurlr$   	tablenamemetadatar#   tableschemaengine_options	__class__s	   &&&&&&&&y/Users/ahmed/devFolder/Ultron/claude-voice/gateway/.venv/lib/python3.14/site-packages/apscheduler/jobstores/sqlalchemy.pyr"   SQLAlchemyJobStore.__init__+   s     $02.X&44(*#F+DK'F0D0D"FDKDEE 448?E"IT:;e<
    c                z   < \         \        V `  W4       V P                  P	                  V P
                  R 4       R# )TN)r!   r   startr&   creater$   )r'   	scheduleraliasr-   s   &&&r.   r2   SQLAlchemyJobStore.startB   s+     $-i?4;;-r0   c                   \        V P                  P                  P                  4      P	                  V P                  P                  P
                  V8H  4      pV P                  P                  4       ;_uu_ 4       pVP                  V4      P                  4       pV'       d   V P                  V4      MR uuR R R 4       #   + '       g   i     R # ; iN)r   r&   cr   wherer   r$   beginexecutescalar_reconstitute_job)r'   job_id
selectable
connectionr   s   &&   r.   
lookup_jobSQLAlchemyJobStore.lookup_jobF   s    DKKMM334::4;;==;K;Kv;UV
[[  J"**:6==?I8A4)))4t !   s   <:CC	c                |    \        V4      pV P                  V P                  P                  P                  V8*  4      # r8   )r   	_get_jobsr&   r9   r   )r'   now	timestamps   && r.   get_due_jobsSQLAlchemyJobStore.get_due_jobsL   s.    -c2	~~dkkmm99YFGGr0   c                   \        V P                  P                  P                  4      P	                  V P                  P                  P                  \        4       8g  4      P                  V P                  P                  P                  4      P                  ^4      pV P                  P                  4       ;_uu_ 4       pVP                  V4      P                  4       p\        V4      uuRRR4       #   + '       g   i     R# ; i)   N)r   r&   r9   r   r:   r   order_bylimitr$   r;   r<   r=   r	   )r'   r@   rA   r   s   &   r.   get_next_run_time$SQLAlchemyJobStore.get_next_run_timeP   s    DKKMM778E$++----78HT[[]]001%%( 	 [[  J&..z:AACM,]; !   s    *C55D	c                H    V P                  4       pV P                  V4       V# r8   )rE   _fix_paused_jobs_sorting)r'   jobss   & r.   get_all_jobsSQLAlchemyJobStore.get_all_jobsX   s!    ~~%%d+r0   c                   V P                   P                  4       P                  ! R/ R VP                  R\	        VP
                  4      R\        P                  ! VP                  4       V P                  4      /B pV P                  P                  4       ;_uu_ 4       p VP                  V4        RRR4       R#   \         d    \        TP                  4      hi ; i  + '       g   i     R# ; i)r   r   r   N )r&   insertvaluesr   r   r   pickledumps__getstate__r#   r$   r;   r<   r   r   )r'   jobrW   rA   s   &&  r.   add_jobSQLAlchemyJobStore.add_job]   s    ##%,, #&&6s7H7HIc&6&6&8$:N:NO0
 
 [[  J1""6* !  " 1(001 !  s   CB;;!CCC0	c                D   V P                   P                  4       P                  ! R/ R \        VP                  4      R\
        P                  ! VP                  4       V P                  4      /B P                  V P                   P                  P                  VP                  8H  4      pV P                  P                  4       ;_uu_ 4       pVP                  V4      pVP                  ^ 8X  d   \!        VP                  4      h RRR4       R#   + '       g   i     R# ; i)r   r   NrV   )r&   updaterX   r   r   rY   rZ   r[   r#   r:   r9   r   r$   r;   r<   rowcountr   )r'   r\   r`   rA   results   &&   r.   
update_jobSQLAlchemyJobStore.update_jobi   s    ##%,, 6s7H7HIc&6&6&8$:N:NO0
  5!!SVV+, 	 [[  J''/F!#$SVV,, $ !   s   8DD	c                t   V P                   P                  4       P                  V P                   P                  P                  V8H  4      pV P
                  P                  4       ;_uu_ 4       pVP                  V4      pVP                  ^ 8X  d   \        V4      h RRR4       R#   + '       g   i     R# ; i)r   N)
r&   deleter:   r9   r   r$   r;   r<   ra   r   )r'   r?   rf   rA   rb   s   &&   r.   
remove_jobSQLAlchemyJobStore.remove_jobs   s    ##%++DKKMM,<,<,FG[[  J''/F!#$V,, $ !   s   -.B&&B7	c                    V P                   P                  4       pV P                  P                  4       ;_uu_ 4       pVP	                  V4       R R R 4       R #   + '       g   i     R # ; ir8   )r&   rf   r$   r;   r<   )r'   rf   rA   s   &  r.   remove_all_jobs"SQLAlchemyJobStore.remove_all_jobsz   sF    ##%[[  Jv& !   s   AA*	c                :    V P                   P                  4        R # r8   )r$   disposer'   s   &r.   shutdownSQLAlchemyJobStore.shutdown   s    r0   c                    \         P                  ! V4      pWR &   \        P                  ! \        4      pVP	                  V4       V P
                  Vn        V P                  Vn        V# )jobstore)rY   loadsr
   __new____setstate__
_scheduler_alias_jobstore_alias)r'   r   r\   s   && r.   r>   $SQLAlchemyJobStore._reconstitute_job   sP    LL+	 $*kk##"kk
r0   c                   . p\        V P                  P                  P                  V P                  P                  P                  4      P                  V P                  P                  P                  4      pV'       d   VP                  \        V!  4      MTp\        4       pV P                  P                  4       ;_uu_ 4       pVP                  V4       F.  p VP                  V P                  VP                  4      4       K0  	  V'       dh   V P                  P'                  4       P                  V P                  P                  P                  P)                  V4      4      pVP                  V4       RRR4       V#   \         dF    T P                   P#                  R TP                  4       TP%                  TP                  4        K  i ; i  + '       g   i     T# ; i)z)Unable to restore job "%s" -- removing itN)r   r&   r9   r   r   rL   r   r:   r   setr$   r;   r<   appendr>   BaseException_logger	exceptionaddrf   in_)r'   
conditionsrR   r@   failed_job_idsrA   rowrf   s   &*      r.   rE   SQLAlchemyJobStore._get_jobs   sX   DKKMM,,dkkmm.E.EFHT[[]]001 	<FZ%%dJ&78J
[[  J!))*5/KK 6 6s}} EF 6 ++-33DKKMM4D4D4H4H4XY""6* !  % /LL**+VX[X^X^_"&&svv./	 !  s8   G*FGA'GAG	GG	GG'	c                h    R V P                   P                  : RV P                  P                  : R2# )<z (url=z)>)r-   __name__r$   r(   rn   s   &r.   __repr__SQLAlchemyJobStore.__repr__   s    "&.."9"94;;??KKr0   )r$   r&   r#   )r   
__module____qualname____firstlineno____doc__rY   HIGHEST_PROTOCOLr"   r2   rB   rH   rN   rS   r]   rc   rg   rj   ro   r>   rE   r   __static_attributes____classdictcell____classcell__)r-   __classdict__s   @@r.   r   r      st     *  8JUY!'!8!8d[_
..LH<

1--'
*L Lr0   r   )
__future__r   apscheduler.jobstores.baser   r   r   apscheduler.utilr   r   r	   apscheduler.jobr
   cPicklerY   ImportError
sqlalchemyr   r   r   r   r   r   r   r   r   sqlalchemy.excr   sqlalchemy.sql.expressionr   r   rV   r0   r.   <module>r      s    & W W \ \ J[ [ [-.
LL LL    J
H
IIJs   A "A' A$#A$'A7