Breaking changes!
- Shaved 8 bytes from each line in database, by changing
dataandrow_idtodandr. This is incompatible with already existing data files. - Added database method
Database.exist("database_name")for easy check. - changed string concatenation to use
format()function, to save RAM. - Shortened exception texts.
- Fixed method
Table.__return_queryso now querying bytbl.query({"name": "Bob"})works correctly. Expanded capability (read bellow). Backward compatibility left. Note: Value strings are Case Sensitive! - Make compatible with full python (windows, linux).
- Table creattion method inherit
rows_per_pageandmax_rowsfrom database schema settings. - Do not increase
tbl.current_rowcounter if data has not passed validation yet. - New method
tbl.vacuum()to optimize pagefiles. Worth to use after some data has been deleted. - updated method
Table.__return_queryso now is possible to search by multiple keys and values. Imagine following persons_table data:fname lname age John Smith 37 Nicole Smith None Kim Smith 7 John Lee None Nicole Lee 32 Bart Lee 3 We want to get John and Nicole Smiths, but dont want all Smiths and no Lees. Following query tbl.query({"fname":["John", "Nicole"], "lname": "Smith"})and here is the result:You may add any number of search parameter in your query and all of them will be[{'fname': 'John', 'lname': 'Smith', 'age': 34}, {'fname': 'Nicole', 'lname': 'Smith', 'age': None}]AND. In sql definition upper search query represent following SQL:select * from persons_table where fname in ("John", "Nicole") and lname = "Smith"
- Changed
__insert_modify_data_fileso writing to files would be more efficient and faster in exchange in reliability if something unexpected happens. - Annotated all function's parameters
- Fixed
tests/test.pyfile to correcttly calculatee current row incheck_current_row()function
test/test.py and device_test.py passed succesfully on
MicroPython v1.9.4-2922-gce1dfde98-dirty on 2020-11-26; ESP32 module with ESP32