peter-wangxu / persist-queue

A thread-safe disk based persistent queue in Python
BSD 3-Clause "New" or "Revised" License
335 stars 50 forks source link

Error while get queue element by id #209

Open L0stCluster opened 9 months ago

L0stCluster commented 9 months ago

I turn off auto_commit and trying get element by id. I getting this traceback: sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 0, and there are 1 supplied.

Minimally reproducible example:

from persistqueue import SQLiteQueue

q = SQLiteQueue(path="queue", auto_commit=False)
queue_id = q.put("elemenent")
q.task_done()

print (queue_id)

queue_data = q.get(id=queue_id, raw=True)
q.task_done()

print(queue_data)