Skip to content
Prev Previous commit
Next Next commit
Use selectone in read_msg
  • Loading branch information
Duane Milne committed Jun 19, 2025
commit 8dcd31c66ac43099d3d066a82a85dfcc4ff98b51
2 changes: 1 addition & 1 deletion dialoghelper/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def read_msg(n:int=-1, # Message index (if relative, +ve is downwards)
if not 0<=idx<len(ids): return None
else: idx = n
db = get_db()
return db.t.message.fetchone('sid=?', [ids[idx]])
return db.t.message.selectone('sid=?', [ids[idx]])

# %% ../nbs/00_core.ipynb
def _msg(
Expand Down
16 changes: 14 additions & 2 deletions nbs/00_core.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
" if not 0<=idx<len(ids): return None\n",
" else: idx = n\n",
" db = get_db()\n",
" return db.t.message.fetchone('sid=?', [ids[idx]])"
" return db.t.message.selectone('sid=?', [ids[idx]])"
]
},
{
Expand Down Expand Up @@ -732,9 +732,21 @@
],
"metadata": {
"kernelspec": {
"display_name": "python3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
}
},
"nbformat": 4,
Expand Down