File: sqlite_test.adb

package info (click to toggle)
libgnatcoll 1.6gpl2014-6
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 22,760 kB
  • ctags: 10,162
  • sloc: ada: 132,013; ansic: 94,291; python: 3,762; sh: 2,781; cpp: 1,394; makefile: 342; xml: 31; sql: 6
file content (22 lines) | stat: -rw-r--r-- 601 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
with Ada.Text_IO;
with GNATCOLL.SQL;          use GNATCOLL.SQL;
with GNATCOLL.SQL.Exec;     use GNATCOLL.SQL.Exec;
with GNATCOLL.SQL.Sqlite;
with GNATCOLL.Traces;       use GNATCOLL.Traces;

procedure SQLite_Test is
   Descr : Database_Description;
   DB    : Database_Connection;
begin
   GNATCOLL.Traces.Parse_Config_File;
   Descr := Sqlite.Setup (":memory:");
   DB := Descr.Build_Connection;
   
   DB.Execute ("create table bar (id string)");

   if not Check_Connection (DB) then
      Ada.Text_IO.Put_Line ("Check_Connection should return True");
   end if;
   
   DB.Commit;
end SQLite_Test;