H
H
hey_umbrella2021-09-05 18:15:24
Python
hey_umbrella, 2021-09-05 18:15:24

How to fetch data from db in sqlite queue?

How on pressing of the button next to me to take record from a DB? Before that, a person puts filters. I tried, when requested, to put all the id of the pets in the list and take them in turn, but I didn’t succeed, in general, what are your ideas?
6134df6268b94389791233.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2021-09-05
@Vindicar

Store the state for each user - which filters are set, which position in the list was viewed last.
To select data from the database starting from this position, sort the data and use OFFSET and LIMIT. This will not guarantee that any new elements will not be skipped, but it is a very simple implementation. You store OFFSET for the user, and about clicking "next" you increase it by LIMIT.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question