Skip to content

4.0.0-alpha.5

Pre-release
Pre-release
Compare
Choose a tag to compare
@QSmally QSmally released this 25 Aug 16:32
· 923 commits to v4 since this release

This release drafts the final alpha version of QDB4.

This release implements a few breaking fixes, especially for the Modify and Invert methods. Array-methods, such as Push, now also accept multiple inputs - and they're inserted in the order of input.

Furthermore, there have been a few new functions added to the Connection setup:

  • <Connection>.Each(Fn<Entry, Idx>: Function, Evict?: Boolean) -> Connection
    • MyDB.Each((Entry, Idx) => { ... });
    • Iterates through the entire database. When Evict is enabled, it clears the cache afterwards due to the increase of memory usage.
  • <Connection>.Select(Fn<Entry, Idx>: Function) -> Object
    • MyDB.Select((Entry, Idx) => <Condition with Entry and Idx>);
    • Filters out rows in this database, and returns it as an object. This might change in the future to a Collection (or DataStore). Method also immediately flushes the cache of the newly fetched entries.
  • <Connection>.Shift(KeyOrPath: Pathlike, ...Values: [Any]?) -> Any|Number
    • const NewOrder = MyDB.Shift("1234.Orders");
    • MyDB.Shift("1234.Orders", Order1, Order2);
    • Shifts the pointed array, or unshifts it and inserts a value at the front when there are values in the input. Returns the shifted item, or the new length of the array when you inserted items.

Lastly, I've implemented wrapper support for Transactions.

  • Start a transaction in the current Connection with const Transaction = <Connection>.Transaction();;
  • Change something with the database synchronously;
  • Either implement your changes with Transaction.Commit();, or if there was an error with your data or the database, Transaction.Rollback();.