Answer the question
In order to leave comments, you need to log in
How to pass limit and offset values to select sqlite function?
async def select_all (one, two):
async with aiosqlite.connect('db') as conn:
cursor = await conn.execute("SELECT * FROM table WHERE a=b LIMIT one OFFSET two"
row = await cursor.fetchall()
return row
Answer the question
In order to leave comments, you need to log in
Apparently, something was not written correctly the first time with %s
Here is the solution:
async def select_all (par, part):
async with aiosqlite.connect('db') as conn:
cursor = await conn.execute("SELECT * FROM table WHERE a=b LIMIT %s OFFSET %s" % (par, part)
row = await cursor.fetchall()
return row
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question