stijnsanders / TSQLite

Delphi SQLite3.dll wrapper
http://yoy.be/TSQLite
MIT License
53 stars 19 forks source link

What does it do? #3

Closed Spelt closed 1 year ago

Spelt commented 1 year ago

Hi Stijn

What does TSQLite do? What can I do with it? Is there any code example ?

Sincerely, Edward

stijnsanders commented 1 year ago

To work with SQLite database files, (or in-memory SQLite databases) you need the SQLite.dll (that you can download from here), It exposes a C-API, which you need a Pascal wrapper for to access, that's the SQLite.pas unit. It takes a lot of separate calls to make things happen, so the SQLiteData.pas unit offers a set of objects to work with and do all the calls (in the right sequence) for you by using their methods.

(Much like how Delphi's own VCL objects are a structure around the Win32 API calls you need to make things work. Delphi VCL also has data-aware components, which TSQLite doesn't connect to, regretfully. But that wasn't the nitention of this project. I needed a 'light and thing' wrapper around the SQLite API for several non-VCL projects, and then created TSQLite.)

For an example, have alook at odo, a little tool that counts keystrokes and mouse-movement, and optionally stores historic data in a SQLite database. See the FormResize event handler for an example how the missing display is filled in with data from the table.

Spelt commented 1 year ago

Thanks! Could be interesting. Op 22 jul. 2023 om 11:18 heeft Stijn Sanders @.***> het volgende geschreven: To work with SQLite database files, (or in-memory SQLite databases) you need the SQLite.dll (that you can download from here), It exposes a C-API, which you need a Pascal wrapper for to access, that's the SQLite.pas unit. It takes a lot of separate calls to make things happen, so the SQLiteData.pas unit offers a set of objects to work with and do all the calls (in the right sequence) for you by using their methods. For an example, have alook at odo, a little tool that counts keystrokes and mouse-movement, and optionally stores historic data in a SQLite database. See the FormResize event handler for an example how the missing display is filled in with data from the table.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>