Is there a similar SQL-expression to sleep like MS SQL WAITFOR
for sqlite?
Alternatively, is there a way to make a sqlite SQL-query run for a long time without adding a lot of rows to the database?
It's for a test so it needs to be done running a query using the db driver.
SQLite has no built-in function for this, but in most languages, it is possible to create a user-defined function:
import sqlite3
import time
con = sqlite3.connect(":memory:")
con.create_function("sleep", 1, time.sleep)
c = con.cursor()
c.execute("SELECT sleep(1.23)")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With