Skip to content

Commit

Permalink
Allow Databases to be read in multiple threads
Browse files Browse the repository at this point in the history
  • Loading branch information
klarh committed Feb 15, 2020
1 parent 0873b84 commit 26c7b30
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyriodic/Database.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class Database:
information. Structures can be added to and read from the
database.
Databases should only be written to by a single thread at once.
Currently the only table populated in the database is
`unit_cells`, with the fields:
Expand All @@ -22,7 +24,8 @@ class Database:
"""
def __init__(self):
self._connection = sqlite3.connect(
':memory:', detect_types=sqlite3.PARSE_DECLTYPES)
':memory:', detect_types=sqlite3.PARSE_DECLTYPES,
check_same_thread=False)

self._initialize_db()

Expand Down

0 comments on commit 26c7b30

Please sign in to comment.