• v1.0.0-beta4 5201e564ca

    v1, Beta 4 Pre-Release

    danieljsummers released this 2024-07-04 16:12:17 +00:00 | 16 commits to main since this release

    Parameters::json accepts either an object or an array for its value. In beta 3, an array was unaware of pjson annotations, so custom serialization functions were not called. In this release, if the document array has one entry, and that entry is an array of objects that support toJson() (pjson's serialization function), these will now use the pjson-aware serialization.

    This change allows an array of custom items to be replaced using Patch and passing a single key array with these items. Example:

    Patch::byId('doc_table', 'abc123', ['items' => [$item1, $item2, $item3]]);
    

    This also adds the flags passed to the non-pjson json_encode options to it as well (unescaped slashes and unicode).

    Downloads
  • v1.0.0-beta3 478684621c

    v1, Beta 3 Pre-Release

    danieljsummers released this 2024-06-29 15:53:39 +00:00 | 17 commits to main since this release

    This release implement support for pjson-decorated classes. If the class has a toJson instance method, it will be used to serialize the JSON instead of json_encode, and if the class has a fromJsonString static method, it will be used to deserialize the JSON instead of json_decode and JsonMapper::map. (Both of these are provided by the JsonSerialize trait provided in the pjson project.)

    The conditional nature of this means that you can choose between pjson or the previous behavior. pjson ignores any field not annotated with #[Json]; so, while it provides more control (particularly in deserialization), it also levies requirements on the classes which it will handle.

    Downloads
  • v1.0.0-beta2 50854275a8

    v1, Beta 2 Pre-Release

    danieljsummers released this 2024-06-25 14:56:07 +00:00 | 18 commits to main since this release

    For this release, Custom::single, Find::byId, and Find::firstBy* now return Options rather than a document or false. This better represents a successful or unsuccessful document retrieval attempt, and the Option type provides things like getOrElse() and getOrCall() for handling occasions when the document was not found.

    Downloads
  • v1.0.0-beta1 124426fa12

    v1, Beta 1 Pre-Release

    danieljsummers released this 2024-06-21 13:54:18 +00:00 | 20 commits to main since this release

    This release implements PostgreSQL support. In addition to the byId and byFields functions, PosgtreSQL supports JSON containment queries (the @> operator; these queries are very efficient with GIN indexes) and JSON Path match queries (the @? operator; the string combines a JSON Path with a condition, ex. $.field ? (@ > 7)).

    One consequence of this support is that many more functions throw DocumentException if the database mode is not set; your IDE may complain more when upgrading from 1.0.0-alpha2. The database mode is derived from the PDO data source name, but it can also be set explicitly via Configuration::$mode using a value from the Mode enum.

    Downloads
  • v1.0.0-alpha2 330e272187

    v1, Alpha 2 Pre-Release

    danieljsummers released this 2024-06-11 11:15:39 +00:00 | 21 commits to main since this release

    This has two overall changes:

    • byFields functions now take an optional FieldMatch enumeration instead of a string; FieldMatch::All equates to AND, and FieldMatch::Any equates to OR
    • IDs can now be generated automatically; information has been added to the README
    Downloads
  • v1.0.0-alpha1 f784f3e52c

    v1, Alpha 1 Pre-Release

    danieljsummers released this 2024-06-09 00:01:39 +00:00 | 25 commits to main since this release

    This is the initial release of the project. The SQLite code should be good, and the API is nearly stable (the convention with multiple fields may change).

    Downloads