[Module] JSON Database (All OS)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

[Module] JSON Database (All OS)

Post by Thorsten1867 »

JSON Database - Module (All OS / DPI)

For a project, I need a database that I can pack or encrypt directly from the memory into an archive without having to take the diversions via the hard disk. JSON seems to me to be the most suitable way to do this.

- Simpler handling compared to SQL
- Syntax for queries based on SQL as far as necessary
- Queries can be copied directly into a linked list (#CopyToList)
- Direct saving and loading to/from an archive possible
- AES encryption supported
- Supported data types: String, Integer, Quad, Float, Double, Boolean and Blob
- Loading or saving of blobs (e.g. pictures) directly from or into a file

Code: Select all

; jDB::Create()          - Create a new database
; jDB::Open()            - Open a database file
; jDB::Save()            - Save database as file
; jDB::AddPack()         - Save database in an archive
; jDB::UncompressPack()  - Load database from an archive
; jDB::Close()           - Close database
;
; jDB::AddTable()        - Add a database table
; jDB::AddColumn()       - Add a table column
; jDB::AddDataset()      - Add new database row with column data
; 
; jDB::Drop()            - Delete database table
; jDB::Table()           - Select a table
;
; jDB::AffectedRows()    - Number of database rows affected or selected
; jDB::ColumnType()      - Returns the type of the column (#String/#Integer/#Quad/#Float/#Double/#Blob)
; jDB::CheckNull()       - Returns #True if column = literal zero
;
; jDB::SelectRow()       - Select a row with its ID
; jDB::Query()           - Select several rows by means of an expression
; jDB::FinishQuery()     - Resets the selection and releases the resources
; jDB::Update()          - Update selected row(s) by means of an expression
; jDB::FinishUpdate()    - Resets the selection and releases the resources
; jDB::Combine()         - Combine two tables
; jDB::FinishCombine()   - Resets the selection and and removes the temporary table
; jDB::Join()            - Combine two tables and create a new table
;
; jDB::Delete()          - Delete selected row(s) by means of an expressio
; jDB::Sort()            - Change the order of the selected rows
;
; jDB::FirstRow          - Go to the first selected row
; jDB::PreviousRow()     - Go to the previous selected row
; jDB::NextRow()         - Go to the next selected row
; jDB::LastRow()         - Go to the last selected row
; jDB::ResetRows()       - Go before the first row to process all rows with NextRow()
;
; jDB::GetBoolean()      - Get the content of the column from the current row (Boolean)
; jDB::GetInteger()      - Get the content of the column from the current row (Integer)
; jDB::GetQuad()         - Get the content of the column from the current row (Quad)
; jDB::GetFloat()        - Get the content of the column from the current row (Float)
; jDB::GetDouble()       - Get the content of the column from the current row (Double)
; jDB::GetString()       - Get the content of the column from the current row (String)
;
; jDB::UpdateDataset()   - Change the value of all column from the current row
;
; jDB::SetBoolean()      - Change the value of the column from the current row (Boolean)
; jDB::SetInteger()      - Change the value of the column from the current row (Integer)
; jDB::SetQuad()         - Change the value of the column from the current row (Quad)
; jDB::SetFloat()        - Change the value of the column from the current row (Float)
; jDB::SetDouble()       - Change the value of the column from the current row (Double)
; jDB::SetString()       - Change the value of the column from the current row (String)
;
; jDB::GetBlob()         - Loads the blob into the memory
; jDB::BlobSize()        - Returns the size of the blob for allocating the memory 
; jDB::SaveBlob()        - Saves the blob as a file
;
; jDB::SetBlob()         - Saves the memory as a blob in the column
; jDB::LoadBlob()        - Saves the file as a blob in the column

; jDB::FileToBlob()      - Returns file as blob string for the use with DataSet()
; jDB::MemoryToBlob()    - Returns memory as blob string for the use with DataSet()

Download: JsonDatabaseModule.pbi
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]