File: //opt/alt/python38/lib64/python3.8/site-packages/playhouse/__pycache__/berkeleydb.cpython-38.pyc
U
S��W* � @ s� d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlT ejZ zd dl
mZ W n e
k
rr d dlZY nX e�eje� e�eje� e�eje� G dd� de�Ze dk r�d Zd Zne�� Ze�� ZdS )
� N)�ImproperlyConfigured)�sqlite3)�*��dbapi2c sF e Zd Zd� fdd� Zdd� Zdd� Zedd � �Zed
d� �Z� Z S )
�BerkeleyDatabaseNc s\ t t| �j|f|�d|i|�� |r0| j�d� |rD| j�d|f� |rX| j�d|f� d S )N�pragmas)�multiversion�on� page_size�
cache_size)�superr �__init__�_pragmas�append)�self�databaser r r r �args�kwargs�� __class__� �G/opt/alt/python38/lib64/python3.8/site-packages/playhouse/berkeleydb.pyr s
����zBerkeleyDatabase.__init__c K sL t s*dt }tr|d7 }n|d7 }t|��tj|f|�}d |_| �|� |S )NzkYour Python SQLite driver (%s) does not appear to have been compiled against the BerkeleyDB SQLite library.zb However, the libsqlite on your system is the BerkeleyDB implementation. Try recompiling pysqlite.z` Additionally, the libsqlite on your system does not appear to be the BerkeleyDB implementation.)�PYSQLITE_BERKELEYDB�
berkeleydb�LIBSQLITE_BERKELEYDBr �connect�isolation_level�_add_conn_hooks)r r r �message�connr r r �_connect$ s �
zBerkeleyDatabase._connectc C st | j rp|�� }| j D ]R\}}|dkrTz|�d||f � W qf tjk
rP Y qfX q|�d||f � q|�� d S )Nr zPRAGMA %s = %s;)r �cursor�executer �OperationalError�close)r r r"