clear v0.6 Release Notes

Release Date: 2019-02-25 // about 5 years ago
  • v0.6

    v0.6 should have shipped polymorphic relations, spec rework and improvement in
    ๐Ÿ“š documentation. That's a lot of work (honestly the biggest improvement since v0)
    ๐Ÿ‘ and since already a lot of stuff have been integrated, I think it's better to
    ๐Ÿš€ ship now and prepare it for the next release.

    ๐Ÿ‘€ Since few weeks I'm using Clear in a full-time project, so I can see and correct
    many bugs. Clear should now be more stable in term of compilation and should not
    crash the compiler (which happened in some borderline cases).

    ๐Ÿ”‹ Features

    ๐Ÿ“š Release of a guide and documentation to use Clear: https://clear.gitbook.io/project/

     json = JSON.parse(%({"first\_name": "John", "last\_name": "Doe", "tags": ["customer", "medical"] })) User.new(json)
    

    โž• Add of pluck and pluck_col methods to retrieve one or multiple column in a Tuple,
    which are super super fast and convenient!

    โž• Add Clear.with_cli method to allow to use the CLI in your project. Check the documentation !

    โž• Additional comments in the source code

    SelectQuery now inherits from Enumerable(Hash(String, Clear::SQL::Any))

    โž• Add optional block on Enum definition. This allow you to define custom methods for the enum:

    Clear.enum ClientType, "company", "non\_profit", "personnal" dodef pay\_vat? self == Personnalendend
    

    โž• Add ? support in raw method:

     a = 1 b = 1000 c = 2 where{ raw("generate\_series(?, ?, ?)", a, b, c) }
    

    [EXPERIMENTAL] Add << operation on collection which comes from has_many and has_many through:

    [EXPERIMENTAL] Add unlink method on collection which comes from has_many through:

    [EXPERIMENTAL] Add possibility to create model from JSON:

    ๐Ÿ’ฅ Breaking changes

    • ๐Ÿšš Migration: use of table.column instead of table.${type} (remove the method missing method); this was causing headache
      in some case where the syntax wasn't exactly followed, as the error output from the compiler was unclear.
    • Renaming of with_serial_pkey to primary_key; refactoring of the macro-code allowing to add other type of keys.
    • Now allow text, int and bigint primary key, with still the uuid, serial and bigserial primary keys available.
    • Renaming of Clear::Model::InvalidModelError to Clear::Model::InvalidError and Clear::Model::ReadOnlyError to
      Clear::Model::ReadOnly to simplify as those classes are already in the Clear::Model namespace
    • ๐Ÿ‘€ Model#set methods has been transfered to Model#reset, and Model#set now change the status of the column to dirty. (see #81)

    ๐Ÿ› Bug fixes