Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using Sqlite with WAL
#1
I've been following Python documentation on the SQLite tutorial and I managed to create an Employee table and write to it.

import sqlite3

conn = sqlite3.connect('employee.db')
c = conn.cursor()

firstname = "Ann Marie"
lastname = "Smith"
email = "[email protected]"

employee = (email, firstname, lastname)

c.execute('INSERT INTO Employee Values (?,?,?)', employee)
conn.commit()

# Print the table contents
for row in c.execute("select * from Employee"):
    print(row)

conn.close()
I've been reading about the Write-Ahead Logging, but I can't find a tutorial that explains how to implement it. Can someone show me?

I notice Firefox, which uses SQLite, locks the file in such a way that if you attempt to delete the sqlite file while using Firefox, it will fail saying "file is open or being used"(or something similar), how do I achieve this? I'm running Python under Windows 10.
Reply
#2
there's some usage instructions here: http://sqlite.1065341.n5.nabble.com/Row-...72058.html
and the docs: https://www.sqlite.org/wal.html
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020