<div>Hello,</div>
<div>I'm trying to deal with sqlite on scheme.</div>
<div>I can create new table and insert new notes, but i can't delete records from table.</div>
<div> </div>
<div>#lang racket<br>(require (prefix-in sqlite: (planet jaymccarthy/sqlite:4)))<br> <br> (define-struct notepad (db)) <br> (define-struct note (notepad id))<br> <br> (define (initialize-notepad! home)<br> (define db (sqlite:open home))<br>
(define the-notepad (make-notepad db))<br> (with-handlers ([exn? void])<br> (sqlite:exec/ignore db<br> (string-append<br> "CREATE TABLE notes "<br> "(id INTEGER PRIMARY KEY,"<br>
"description TEXT)")))<br> (sqlite:insert db (format "INSERT INTO notes (description) VALUES ('~a')" "Some text"))<br> the-notepad)</div>
<div> </div>
<div>this works fine.</div>
<div> </div>
<div> (define (delete-entry! a-notepad id)<br> (sqlite:exec/ignore (notepad-db a-notepad)<br> (format "DELETE FROM notes WHERE id = '~a'" id)))</div>
<div> </div>
<div>but this doesn't remove anythng.</div>
<div>Where i'm wrong?</div>
<div> </div>
<div>Thanks.</div>
<div> </div>
<div> </div>
<div> </div>