Skip to content

Commit

Permalink
Merge pull request #96 from imdrasil/bump_0.4.3
Browse files Browse the repository at this point in the history
Bump to 0.4.3
  • Loading branch information
imdrasil committed Jan 2, 2018
2 parents 836455d + c10b6f9 commit 92985ea
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 11 deletions.
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
# 0.4.3 (2-01-2018)

* All macro methods were rewritten to new 0.24.1 crystal syntax

**Adapter**

* removed `Jennifer::Adapter::TICKS_PER_MICROSECOND`
* fixes `Jennifer::Adapter::Mysql#table_column_count` bug

**Model**

* add `Primary32` and `Primary64` shortcuts for primary key mapping (view mapping respects this as well)
* add `::create!` & `::create` with splatted named tuple arguments
* now relation retrieveness is updated for any superclass relations as well
* a relation will be retrieved from db for only persisted record
* move `Jennifer::Mode::build` method to `%mapping` macro
* allow retrieving and building sti records using base class
* fix `#reload` method for sti record
* optimize building sti record from hash

**QueryBuilder**

* fix `Criteria#not`
* add `Criteria#ilike`

**View**

* introduce `View::Materialized` superclass for materialized views
* add `COLUMNS_METADATA` constant
* add `::columns_tuple` which retrns `COLUMNS_METADATA`
* remove `::children_classes`
* make `after_initialize` callback respect inheritance
* add `::adapter`

**Exceptions**

* add `AbstractMethod` exception which represents expectation of overriding current method by parents (is usefull when method can't be real abstract one)
* add `UnknownSTIType`

# 0.4.2 (24-11-2017)

**SqlGenerator**
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ Add this to your application's `shard.yml`:
dependencies:
jennifer:
github: imdrasil/jennifer.cr
version: "~> 0.4.3"
```

**Also** you need to choose one of existing adapters for your db: [mysql](https://github.com/crystal-lang/crystal-mysql) or [postgres](https://github.com/will/crystal-pg).
#### Requirements

- you need to choose one of existing adapters for your db: [mysql](https://github.com/crystal-lang/crystal-mysql) or [postgres](https://github.com/will/crystal-pg);
- if you prefer to use crystal `<0.23.1` - use jennifer `<0.4.2` (crystal `0.23.0` is buggy and not supported).

## Usage

Expand Down
15 changes: 8 additions & 7 deletions docs/query_dsl.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ And operator-like methods:
| `regexp` | `REGEXP`, `~` (accepts `String`) |
| `not_regexp` |`NOT REGEXP` |
| `like` | `LIKE` |
| `ilike` | `ILIKE` for pg and `LIKE` for mysql |
| `not_like` | `NOT LIKE` |
| `is` | `IS` and provided value |
| `not` | `NOT` and provided value (or as unary operator if no one is given) |
Expand All @@ -70,13 +71,13 @@ For mysql both `take` and `path` methods behave in the same way.

Thera are 2 supported cases:

*
```SQL
WHERE field_name->"$.selector"
```
could be specified using
*
```SQL
WHERE field_name->"$.selector"
```
could be specified using

```crystal
```crystal
where { _field_name["$.selector"]}
```

Expand Down Expand Up @@ -111,7 +112,7 @@ Query will be inserted "as is". Usage of `#sql` allows to use nested plain reque
- all regexp methods accepts string representation of regexp
- use parenthesis for binary operators (`&` and `|`)
- `nil` given to `!=` and `==` will be transformed to `IS NOT NULL` and `IS NULL`
- `is` and `not` operator accepts next values: `:nil`, `nil`, `:unknown`, `true`, `false`
- `is` and `not` operator accepts next values: `nil`, `:unknown`, `true`, `false`

At the end - several examples:

Expand Down
4 changes: 2 additions & 2 deletions shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: jennifer
version: 0.4.2
version: 0.4.3

authors:
- Roman Kalnytskyi <moranibaca@gmail.com>
Expand Down Expand Up @@ -32,4 +32,4 @@ dependencies:
version: "~> 1.1.0"
ifrit:
github: imdrasil/ifrit
version: "~> 0.1.1"
version: "~> 0.1.2"
2 changes: 1 addition & 1 deletion src/jennifer/version.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Jennifer
VERSION = "0.4.2"
VERSION = "0.4.3"
end

0 comments on commit 92985ea

Please sign in to comment.