skyward-orm 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -9
- data/lib/skyward/orm/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 30728b618b923c91d52bea989ff08d062f96f42bb4b9801189aace95f51e9eb9
|
|
4
|
+
data.tar.gz: b3a0b559b262ca8f251d768919773417f1bf54702a67576575006fa2b9898706
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 15e2e57c1074cf716dc2553d8d13be6ae0251df7004663d221611765ea33fc0e44bd145e6b3a1ef522a28391fa159de2784c63494f0b31590a0de326cf2489d0
|
|
7
|
+
data.tar.gz: 847b2103f06b2fae962b09ffbeffadca70c5c9ad71d4606d4cf89c67e264238c51b0d1afc09069ea5b333e0b328006e34087710f88bbf5611854b94d9aee738c
|
data/README.md
CHANGED
|
@@ -526,10 +526,10 @@ Values are always bound as parameters, never interpolated. If you leave out the
|
|
|
526
526
|
A write returns how many rows it changed, unless you ask for rows with `into`. [Drizzle](https://orm.drizzle.team) is the model: a write gives nothing back unless you ask, so it never reads more than you use.
|
|
527
527
|
|
|
528
528
|
```ruby
|
|
529
|
-
Todo.insert(title: 'Buy milk', list_id: 1)
|
|
530
|
-
Todo.insert_all([{ title: 'Eggs', list_id: 1 },
|
|
531
|
-
Todo.where(id: 42).update(done: true)
|
|
532
|
-
Todo.where(done: true).delete
|
|
529
|
+
Todo.insert(title: 'Buy milk', list_id: 1) # => 1
|
|
530
|
+
Todo.insert_all([{ title: 'Eggs', list_id: 1 }, { title: 'Bread', list_id: 1 }]) # => Integer, the rows inserted
|
|
531
|
+
Todo.where(id: 42).update(done: true) # => Integer, the rows updated
|
|
532
|
+
Todo.where(done: true).delete # => Integer, the rows deleted
|
|
533
533
|
```
|
|
534
534
|
|
|
535
535
|
`into` names the rows to return instead, through `RETURNING` of just its members' columns, or every column for the table class itself. It can come anywhere before the write. `insert` returns its one row, and `insert_all`, `update` and `delete` return an `Array`:
|
|
@@ -537,11 +537,11 @@ Todo.where(done: true).delete # => Integer, the rows d
|
|
|
537
537
|
```ruby
|
|
538
538
|
Id = Data.define(:id)
|
|
539
539
|
|
|
540
|
-
Todo.into(Todo).insert(title: 'Buy milk', list_id: 1)
|
|
541
|
-
Todo.into(Id).insert(title: 'Buy milk', list_id: 1)
|
|
542
|
-
Todo.into(Id).insert_all([{ title: 'Eggs', list_id: 1 },
|
|
543
|
-
Todo.where(id: 42).into(Todo).update(done: true)
|
|
544
|
-
Todo.where(done: true).into(Id).delete
|
|
540
|
+
Todo.into(Todo).insert(title: 'Buy milk', list_id: 1) # => Todo, every column
|
|
541
|
+
Todo.into(Id).insert(title: 'Buy milk', list_id: 1) # => Id, RETURNING "id"
|
|
542
|
+
Todo.into(Id).insert_all([{ title: 'Eggs', list_id: 1 }, { title: 'Bread', list_id: 1 }]) # => Array[Id], the inserted rows' ids
|
|
543
|
+
Todo.where(id: 42).into(Todo).update(done: true) # => Array[Todo], the updated rows
|
|
544
|
+
Todo.where(done: true).into(Id).delete # => Array[Id], the deleted rows' ids
|
|
545
545
|
```
|
|
546
546
|
|
|
547
547
|
`insert` and `insert_all` on a query take nothing but `into`. Anything else on the query, such as a `where`, an `order` or a join, raises an `ArgumentError` before any SQL runs.
|
data/lib/skyward/orm/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: skyward-orm
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jake Bottrall
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - '='
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.4.
|
|
18
|
+
version: 0.4.2
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - '='
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.4.
|
|
25
|
+
version: 0.4.2
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: bigdecimal
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|