Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/AHK-just-me/Class_SQLiteDB
AHK SQLite API wrapper class
https://github.com/AHK-just-me/Class_SQLiteDB
Last synced: 25 days ago
JSON representation
AHK SQLite API wrapper class
- Host: GitHub
- URL: https://github.com/AHK-just-me/Class_SQLiteDB
- Owner: AHK-just-me
- License: unlicense
- Created: 2013-12-20T05:10:20.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2022-10-03T10:34:41.000Z (about 2 years ago)
- Last Synced: 2024-08-04T01:03:00.059Z (4 months ago)
- Language: AutoHotkey
- Homepage:
- Size: 89.8 KB
- Stars: 101
- Watchers: 14
- Forks: 30
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-AutoHotkey - Class_SQLiteDB - by just Me - AHK SQLite API wrapper class. Forum thread: [link](https://autohotkey.com/boards/viewtopic.php?t=1064). (Libraries / Database)
README
# Class_SQLiteDB #
### AHK SQLite API Wrapper ###
AHK class providing support to access SQLite databases.
### Additional stuff ###
- [SQLite documentation](http://www.sqlite.org/docs.html)
- [SQLite download page](http://www.sqlite.org/download.html)### Basic usage ###
- Create a new instance of the class SQLiteDB calling `MyDB := New SQLiteDB`
- Open your database calling `MyDB.OpenDB(MyDatabaseFilePath)`. If the file doesn't exist, a new database will be created unless you specify "False" as the third parameter.
- MyDB object provides four methods to pass SQL statements to the database:
- `MyDB.Exec(SQL)`
Should be called for all SQL statements which don't return values from the database (e.g. CREATE, INSERT, UPDATE, etc.).
- `MyDB.GetTable(SQL, Table, ...)`
Should be called for SELECT statements whenever you want to get the complete result of the query as a "Table" object for direct access via the row index. All field values will be returned "in their zero-terminated string representation" (and accordingly an empty string for NULL values).
- `MyDB.Query(SQL, RecordSet, ...)`
Should be called for SELECT statements whenever you want to get the result of the query as a "RecordSet" object. You'll have to call the built-in method `RecordSet.Next()` to access the records sequentially. Only `DB-Query()` does handle BLOBs properly. All other field types will be returned as strings (see `DB.GetTable()`). If you don't need the RecordSet anymore, call `RecordSet.Free()` to release the resources.
- `MyDB.StoreBLOB(SQL, BlobArray)`
Should be called whenever BLOBs shall be stored in the database. For each BLOB in the row you have to specify a `?` parameter within the statement. The parameters are numbered automatically from left to right starting with 1. For each parameter you have to pass an object within BlobArray containing the address and the size of the BLOB.
- After all work is done, call `MyDB.CloseDB()` to close the database. For all still existing queries `RecordSet.Free()` will be called internally.
- For further details look at the inline documentation in the class script and the sample scripts, please.