Changelog History
Page 1
-
v0.21.1 Changes
July 11, 2020- 9c30762 Define
@@setter
withclass_getter
(#405) by @Blacksmoke16 - ๐ 310957b Support Crystal 0.35.0 (#406) by @drujensen
- 9f03488 Fix infinity loop (#409) by @OpakAlex
- 7230928 Bump Granite, Crystal, and Ameba versions (#412) by @Blacksmoke16
- 9c30762 Define
-
v0.21.0 Changes
May 27, 2020- ๐ b225462 Support custom queries in builder (#403) by @Serdnad
- af36d1e Add a to_json method for Granite::Error (#401) by @3n-k1
- ๐ 1daaa35 Fix read_attribute, see #396 (#397) by @msa7
- 536a9b4 Fix #394 by stripping the module name from the table name (#395) by @3n-k1
- 3d849eb Fix: Ensure
Granite::Error#to_s
returns string (#386) by @akadusei - 2dee196 Add empty "else" statement for compatibility with Crystal 0.34.0 (#399) by @MrSorcus
- ๐ fde10ca Replace deprecated Logger via Log. (#398) @MrSorcus
-
v0.20.0
April 12, 2020 -
v0.19.0 Changes
January 22, 2020- โก๏ธ 505a779 Update CI/deps to support Crystal 0.32.1 (#377) @Blacksmoke16
- 0๏ธโฃ 55f11af Handle
false
when a column has a default value (#374) @Blacksmoke16 - โก๏ธ cbf7669 Allow #update to set column to nil (#369) @Blacksmoke16
-
v0.18.0 Changes
October 03, 2019 -
v0.17.2 Changes
August 17, 2019e2784bf Handle string conversion & conversion errors (#357) by @Blacksmoke16
-
v0.17.1
August 07, 2019 -
v0.17.0 Changes
August 07, 2019๐ This release has some significant breaking changes to the DSL and leverages Annotations instead of the mutable constants and
final
macros. @Blacksmoke16 spent many months researching the use of Annotations and has overhauled Granite to take advantage of them.In the process, we have decided to change the DSL to be more database centric. Here is a list of the breaking changes:
- Adapters are now added to
Granite::Connections
array instead ofGranite::Adapters
- the
adapter
macro was renamed toconnection
- the
table_name
macro was renamed totable
- the
field
macro was renamed tocolumn
- the
primary
macro was changed into a flagprimary: true
on thecolumn
macro - 0๏ธโฃ a primary
id
field is no longer added by default - a
column
can be declared as Nilable using?
Here is an example of how to register a new connection:
Granite::Connections \<\< Granite::Adapter::Mysql.new(name: "mysql", url: "YOUR\_DATABASE\_URL")
Here is an example of a model:
require "granite/adapter/mysql"class Post \< Granite::Base connection mysql table posts # Name of the table to use for the model, defaults to class name snake cased column id : Int64, primary: true # Primary key, defaults to AUTO INCREMENT column name : String? # Nilable field column body : String # Not nil fieldend
Other changes:
- ๐ a866c10 Crystal v0.30.0 support (#354) by @bcardiff
- ๐ 9a2d4fe Count group by fixed (#352) by @unequaled86
- bdb879f Port Granite to use Annotations (#346) by @Blacksmoke16
- ce37f7a require "uuid" in fields.cr (#350) by @EnricoMonese
- โก๏ธ c4bc435 Update CRUD delete example code (#348) by @EnricoMonese
- b2754fc replace @@var with their getter (#345) by @Blacksmoke16
- 6f2e6a3 Adds an
exists?
class method (#343) by @Blacksmoke16 - ๐ 82cb04e Support custom field types (#342) by @Blacksmoke16
- bc68440 Disallow union types (#341) by @Blacksmoke16
- Adapters are now added to
-
v0.16.0 Changes
June 08, 2019- ๐ d9ab302 fixes for crystal 0.29.0 (#338) by @drujensen
- f4efb63 Find or create by (and find or initialize by) (#336) by @AndyRosenberg
- d5e4122 document on_to_json/yaml (#335) by @Blacksmoke16
- ๐ 46cafcd docs/relationships.md: add example many to many insert (#332) by @nathanj
- โก๏ธ 70afa14 Some updates for Crystal 0.28.0 (#330) by @Blacksmoke16
- 2de9e89 Extract Migrator#create and #drop sql into separate methods (#326) by @Jens0512
- db6b5ed Make primary_type return the class type vs string (#325) by @Blacksmoke16
- โก๏ธ 75e8473 Do not update created_at on update (#324) by @Blacksmoke16
- 040f1c1 Pass annotations from a
belongs_to
to the resulting field (#323) by @Blacksmoke16 - e9f8fe9 Make Granite::Base abstract (#322) by @Blacksmoke16
- 2a8bb18 Raise NilAssertionError on nil value (#321) by @Blacksmoke16
- 9b2991c Logger optimization (#315) by @Blacksmoke16
-
v0.15.2 Changes
January 07, 2019๐ Support default values (#312) @Blacksmoke16
โ Add colors to logged queries (#311) @Blacksmoke16
Implement #touch (#314) @Blacksmoke16
๐ Support array IN queries with query builder (#313) @Blacksmoke16