o
    §ºûg   ã                   @   s"   d dl Z defdd„Zdd„ ZdS )é    NÚ
datasourcec              
   C   sl   d }zt  ¡  ¡ }| t| ƒ¡ | ¡ }| ¡  W d|iS  ty5 } zdt|ƒdœW  Y d }~S d }~ww )Né   )ÚerrorÚmessageÚoptions)	ÚdbÚget_dbÚcursorÚexecuteÚget_options_queryÚfetchallÚcloseÚ	ExceptionÚstr)r   r   ÚcurÚe© r   ú&/var/www/html/stock-api/datasources.pyÚget_options   s   
ý€ÿr   c                 C   s
   d  | ¡S )Nzselect id, {0} from {0}s)Úformat)r   r   r   r   r      s   
r   )r   r   r   r   r   r   r   r   Ú<module>   s    