summaryrefslogtreecommitdiff
path: root/src/deck_io.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/deck_io.adb')
-rw-r--r--src/deck_io.adb12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/deck_io.adb b/src/deck_io.adb
index 20eb6c1..8830df0 100644
--- a/src/deck_io.adb
+++ b/src/deck_io.adb
@@ -40,7 +40,6 @@ package body Deck_IO is
(This : in out Deck_Handle) is
begin
if This.Opened then
- SQLite3.Close (This.SQL_Handle);
FD.Delete_File (-This.Tempfile);
end if;
end Finalize;
@@ -123,7 +122,7 @@ package body Deck_IO is
Temp : String := Generate_Temp_Name;
begin
UnZip.Extract (Filename, "collection.anki2", Temp);
- SQLite3.Open (Temp, Deck.SQL_Handle);
+ Deck.SQL_Handle.Open (Temp);
Deck.Opened := True;
Deck.Tempfile := +Temp;
end Open_Database;
@@ -143,7 +142,7 @@ package body Deck_IO is
if Deck.Opened = False then
return;
end if;
- SQLite3.Close (Deck.SQL_Handle);
+ Deck.SQL_Handle.Close;
Deck.Opened := False;
FD.Delete_File (-Deck.Tempfile);
Deck.Tempfile := +"";
@@ -250,10 +249,9 @@ package body Deck_IO is
Extract_Model (Name, Value, Models);
end JSON_Callback;
begin
- SQLite3.Prepare (Deck.SQL_Handle, "SELECT models FROM col", Statement);
- SQLite3.Step (Statement, Deck.Status);
- SQLite3.Column (Statement, 0, Raw_Data);
- SQLite3.Finish (Statement);
+ Deck.SQL_Handle.Prepare ("SELECT models FROM col", Statement);
+ Statement.Step;
+ Raw_Data := Statement.Column (0);
JSON_Data := JS.Read (-Raw_Data);
JS.Map_JSON_Object (JSON_Data, JSON_Callback'Access);
end Query_Models;