Unit SQLiteWrap

DescriptionusesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

SQLite 3.x object based wrapper

Can be used for object based access to SQLite3 databases.

Note: Requires Sqlite 3.7.1 and higher!

Designed for Delphi 6+ and Freepascal, Unicode support for Delphi 2009+

V3.0.0 Rework Unicode support. Library used on <D2007 and >D2009 returning same Ansistring data. But on >D2009 you can read and write data by new Unicode based methods too. With minimum implicit chartset conversions for the best speed.

V2.2.1 Fixed "No argument for format 's'" error.

V2.2.0 Changed error handling, extended error codes are used. Usage of Online Backup API

V2.1.2 Fixed raising of Exceptions.

V2.1.1 Fixed call of ExecSQL for a statement what returning some rows.

V2.1.0 Added BLOB parameters and improved BLOB handling. Added TotalChanges property. Some bugfixes.

V2.0.0 29 June 2010 Ported to D2009 Unicode by Roger Lascelles (support@veecad.com)

V1.0.0 by Lukáš Gebauer at http://www.ararat.cz/doku.php/en:sqlitewrap. based on work by Tim Anderson (tim@itwriting.com)

UNICODE HANDLING: Delphi 2009+ Pass data as native UnicodeString. Datas are converted to SQLite native UTF-8 internally.

pre-Delphi 2009 Pass data as UTF8String (it is AnsiString contains UTF8 datas) and you must convert data to UTF-8 explicitly! Pasing data by UTF8String typed variable made your source forward compatible with Delphi 2009+.

Sample usage:

procedure sample;
var
  database: TSqliteDatabase;
  tab: TSqliteTable;
  s: utf8string;
begin
  database := TSqliteDatabase.Create('somedatabase.db3');
  try
    database.AddParamInt(':key', 123456);
    tab := database.GetTable('SELECT * FROM some_table WHERE ROWID=:key');
    try
      while not tab.EOF do
      begin
        s := tab.FieldAsString(tab.FieldIndex['ROWID']);
        //do something with 'S' variable...
        //...
        //...then go to nexr row.
        tab.next;
      end;
    finally
      tab.free;
    end;
  finally
    database.free;
  end;
end;

Overview

Classes, Interfaces, Objects and Records

Name Description
Class ESQLiteException Exception Class for SQLite based errors
Class TSQliteParam Class for storing deferred parameters
Class TSQLiteDatabase Class for handling SQLite database
Class TSQLiteTable Class for handling SQLite query result

Types

THookQuery = procedure(Sender: TObject; const SQL: String) of object;

Description

Types

THookQuery = procedure(Sender: TObject; const SQL: String) of object;

procedural prototype for OnQuery hook.


Generated by PasDoc 0.9.0 on 2018-03-13 21:07:27