unit test_unit;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, SQLite3Conn, SQLDB;
procedure my_test;
implementation
procedure my_test;
// need: uses SQLite3Conn, SQLDB
var
SQLite3Connection11: TSQLite3Connection;
SQLQuery11: TSQLQuery;
SQLTransaction11: TSQLTransaction;
begin
SQLite3Connection11:=TSQLite3Connection.Create(nil);
SQLTransaction11 := TSQLTransaction.Create(nil);
SQLQuery11:= TSQLQuery.Create(nil);
SQLite3Connection11.DatabaseName:='koza.db';
SQLite3Connection11.Transaction := SQLTransaction11;
SQLite3Connection11.Open;
// create table
SQLite3Connection11.ExecuteDirect('create table IF NOT EXISTS koza (ID INTEGER PRIMARY KEY AUTOINCREMENT, name text)');
// insert
SQLite3Connection11.ExecuteDirect('insert into koza(name) values ("RU:белая PL:ŁĘŃÓĆ KR:흰 염소")');
SQLQuery11.DataBase := SQLite3Connection11;
SQLQuery11.sql.Text:='select * from koza';
SQLQuery11.Open;
SQLQuery11.Insert;
SQLQuery11.FieldByName('name').AsString := ('RU:белая PL:ŁĘŃÓĆ KR:흰 염소');
SQLQuery11.ApplyUpdates;
SQLTransaction11.Commit;
SQLQuery11.free;
SQLTransaction11.free;
SQLite3Connection11.free;
end;
end.