All Versions
10
Latest Version
Avg Release Cycle
14 days
Latest Release
2532 days ago

Changelog History

  • v0.2.7 Changes

    April 13, 2017

    πŸ‘Œ Support default value(#9) πŸŽ‰
    πŸ‘€ See discussion here

    0️⃣ Sample for this feature is here

  • v0.2.6 Changes

    March 25, 2017

    πŸš€ This release includes following topics.

    • πŸ‘ Time column support (#6)
    • id can be Int64 (#5)
    • βž• Added development_dependencies (#4)

    🍱 All pull requests are by @ZhomartπŸŽ‰
    Thanks a lot!

    🍱 Very welcome to up PR from youπŸ˜„

  • v0.2.5 Changes

    March 10, 2017

    πŸš€ This release includes following topics.

    • πŸ› bug fix of time format for PostgreSQL.(See #3)
  • v0.2.4 Changes

    February 23, 2017

    πŸš€ I'm happy to announce to release new tool that build a kemal project with topaz. πŸŽ‰
    You can simply start with it like

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/topaz-crystal/topaz/master/tools/install.rb)"
    

    πŸš€ This release includes bug fixes and refactoring.

  • v0.2.3 Changes

    January 02, 2017

    ⚑️ Updates

    • πŸ‘Œ Support table migration!πŸŽ‰ Doc
    • πŸ› Bug fixes (Especially for PostgreSQL)
  • v0.2.2 Changes

    December 26, 2016

    🍱 Suppoort Crystal version 0.20.3 πŸŽ‰
    πŸ‘€ Nullable column is accepted.(See below sample)
    Support to_json and from_json(#json is deprecated)
    Topaz::Log.show_query is now Topaz::Db.show_query

    class NullableModel < Topaz::Model
      columns(
        name: String,
        nullable: {type: String, nullable: true},
        not_nullable: {type: String, nullable: false},
      )
    end
    
    NullableModel.create("sample", nil, "not nullable")
    
  • v0.2.1 Changes

    December 17, 2016
    • πŸ‘Œ Support transaction! πŸŽ‰ (Thanks @bcardiff)
    • πŸ—„ join is deprecated

    πŸ‘€ See sample/transaction.cr as a sample code

    [Sample code]
    Topaz::Db.shared.transaction do |tx|
        Sample.in(tx).create("sample0")
        Sample.in(tx).create("sample1")
        ...
        t0 = Sample.in(tx).find(1)
        t0.in(tx).update(name: "sample0 updated")
    end
    
  • v0.2.0 Changes

    December 14, 2016
    • πŸ‘Œ Support PostgreSQLπŸŽ‰ (Thanks @will and @asterite)
    • Simplify core macros(columns, has_many, belongs_to)
    • πŸ—„ primary is deprecated (You have to control it on code level)

    Example:

    Previous

    class Parent \< Topaz::Model columns( {name: name, type: String} ) has\_many( {model: Child, as: childlen, key: p\_id} )end
    

    Now

    class Parent \< Topaz::Model columns( name: String ) has\_many( childlen: {model: Child, key: p\_id} )end
    
  • v0.1.0 Changes

    December 09, 2016

    Version 0.1.0
    🍱 Now Topaz is enough stable so that increment minor version from 0 to 1 πŸŽ‰
    ⬇️ Reduced Database overhead by keeping opening connection with it. Thanks @asterite !

    Any issues or PRs are welcome :)

  • v0.0.5 Changes

    December 07, 2016

    Converting models to jsons is a necessary feature for who develops api server.
    Now your api easily generate and return jsons of models with Topaz.

    For example, when we have

    JsonParent(name)
     - JsonChild(age, p_id)
       - JsonToy(name, price, c_id)
        - JsonPart(t_id)
     - JsonPet(p_id)
    

    Then we can write like

    p = JsonParent.select.firstputs p.jsonputs p.json({include: :childlen, except: :id})puts p.json({include: {childlen: {except: [:id, :p\_id]}, pets: nil} })puts p.json({include: {childlen: {include: {toies: {include: :parts, only: :price} } }, pets: nil} })
    

    We got

    {"id": 1, "name": "John"}
    
    {"name": "John", "childlen": [{"id": 1, "age": 12, "p_id": 1}, {"id": 2, "age": 15, "p_id": 1}, {"id": 3, "age": 23, "p_id": 1}]}
    
    {"id": 1, "name": "John", "childlen": [{"age": 12}, {"age": 15}, {"age": 23}], "pets": [{"id": 1, "p_id": 1}, {"id": 2, "p_id": 1}, {"id": 3, "p_id": 1}, {"id": 4, "p_id": 1}]}
    
    {"id": 1, "name": "John", "childlen": [{"id": 1, "age": 12, "p_id": 1, "toies": [{"price": 10, "parts": [{"id": 1, "t_id": 1}]}, {"price": 12, "parts": []}]}, {"id": 2, "age": 15, "p_id": 1, "toies": [{"price": 15, "parts": [{"id": 2, "t_id": 3}, {"id": 3, "t_id": 3}, {"id": 4, "t_id": 3}]}]}, {"id": 3, "age": 23, "p_id": 1, "toies": []}], "pets": [{"id": 1, "p_id": 1}, {"id": 2, "p_id": 1}, {"id": 3, "p_id": 1}, {"id": 4, "p_id": 1}]}