Skip to content

Instantly share code, notes, and snippets.

@rogerbinns
Created September 13, 2021 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rogerbinns/b9dcc4d5d5d66f97c21a990e2567b494 to your computer and use it in GitHub Desktop.
Save rogerbinns/b9dcc4d5d5d66f97c21a990e2567b494 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import apsw
class Example:
def connect(self):
while True:
dbname = "example.db"
connection = apsw.Connection(str(dbname))
connection.cursor().execute("PRAGMA journal_mode = WAL")
connection.setbusyhandler(self.busyHandler)
print(".", end="", flush=True)
def busyHandler(self, n):
print("callled")
return True
ex = Example()
ex.connect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment