active_record_mysql_repl 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +71 -0
- data/lib/active_record_mysql_repl/database/configs.rb +1 -1
- data/lib/active_record_mysql_repl/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7893476abc10750ae8de2108f440da50b8a7082555bf04347bdaaeb2d92818a9
|
4
|
+
data.tar.gz: bfd86689e58838c910471ba54382724f810255c865edb7f2bdfc43827ecfbc99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e234c07ac4b8694e1ad8455b595fff7b20e99193d0ec417cf00a7a0b243e482ee7f01dc46c971ec6a68846d4bd8ef5d2d1080f1a5f39274d4e39c395fa598515
|
7
|
+
data.tar.gz: d6b382c634f63e326499eaeaec189f77fe9496a17c019c83eca21e0806f197f2e3a115315c34ddc88649e5457195ce9d4737bd78dd4b8114e49ac06784e05f0f
|
data/README.md
CHANGED
@@ -624,6 +624,77 @@ D, [2024-12-11T23:48:57.250492 #96381] DEBUG -- : Order Load (1.8ms) SELECT `
|
|
624
624
|
|
625
625
|
</details>
|
626
626
|
|
627
|
+
Convenient syntax sugar such as `'value'.{table_name}` `'value'.{table_name}s` `'value'.{table_name}_by_{column_name}` are available as dynamically defined methods.
|
628
|
+
|
629
|
+
```rb
|
630
|
+
[1] test(main)> :'1'.order
|
631
|
+
```
|
632
|
+
|
633
|
+
<details><summary>output:</summary>
|
634
|
+
|
635
|
+
```rb
|
636
|
+
D, [2024-12-13T11:40:17.290699 #48059] DEBUG -- : Order Load (2.2ms) SELECT `orders`.* FROM `orders` WHERE `orders`.`id` = '1' LIMIT 1
|
637
|
+
#<Order:0x0000000122e7f0e0> {
|
638
|
+
:id => "1",
|
639
|
+
:user_id => "1",
|
640
|
+
:item_id => "1"
|
641
|
+
}
|
642
|
+
```
|
643
|
+
|
644
|
+
</details>
|
645
|
+
|
646
|
+
```rb
|
647
|
+
[2] test(main)> '1'.order
|
648
|
+
```
|
649
|
+
|
650
|
+
<details><summary>output:</summary>
|
651
|
+
|
652
|
+
```rb
|
653
|
+
D, [2024-12-13T11:40:21.217724 #48059] DEBUG -- : Order Load (2.4ms) SELECT `orders`.* FROM `orders` WHERE `orders`.`id` = '1' LIMIT 1
|
654
|
+
#<Order:0x000000010512c450> {
|
655
|
+
:id => "1",
|
656
|
+
:user_id => "1",
|
657
|
+
:item_id => "1"
|
658
|
+
}
|
659
|
+
```
|
660
|
+
|
661
|
+
</details>
|
662
|
+
|
663
|
+
```rb
|
664
|
+
[3] test(main)> '1'.orders
|
665
|
+
```
|
666
|
+
|
667
|
+
<details><summary>output:</summary>
|
668
|
+
|
669
|
+
```rb
|
670
|
+
D, [2024-12-13T11:40:22.781925 #48059] DEBUG -- : Order Load (2.7ms) SELECT `orders`.* FROM `orders` WHERE `orders`.`id` = '1' LIMIT 1
|
671
|
+
#<Order:0x0000000105129750> {
|
672
|
+
:id => "1",
|
673
|
+
:user_id => "1",
|
674
|
+
:item_id => "1"
|
675
|
+
}
|
676
|
+
```
|
677
|
+
|
678
|
+
</details>
|
679
|
+
|
680
|
+
```rb
|
681
|
+
[4] test(main)> '1'.user_by_profile_id
|
682
|
+
```
|
683
|
+
|
684
|
+
<details><summary>output:</summary>
|
685
|
+
|
686
|
+
```rb
|
687
|
+
D, [2024-12-13T11:40:47.497002 #48059] DEBUG -- : User Load (7.9ms) SELECT `users`.* FROM `users` WHERE `users`.`profile_id` = 1
|
688
|
+
[
|
689
|
+
[0] #<User:0x00000001243fc0f8> {
|
690
|
+
:id => "1",
|
691
|
+
:login_id => "login_id1",
|
692
|
+
:profile_id => 1
|
693
|
+
}
|
694
|
+
]
|
695
|
+
```
|
696
|
+
|
697
|
+
</details>
|
627
698
|
---
|
628
699
|
|
629
700
|
`.csv(orientation)` is defined to generate csv format. The default orientation is same as `.tab`.
|