lowdata 0.4.5 → 0.4.6
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/lib/lowdata.rb +8 -0
- data/lib/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: 575de6b7701291fbe921534112c3806d64d9b842887a911b2c0076d97fb9736b
|
|
4
|
+
data.tar.gz: f7e2be3e91deb27a14a13d80edbd3724973dcbdd45422b3c506e4725254d4022
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ceceec2da10e56bf604b7c13089029899d3daeb090966d5d2ded26493f788e43789e3aee64d6e58c39cc1a8a216b244facf474b4f617dd9c1bb6e6956f79a544
|
|
7
|
+
data.tar.gz: 6ea48177fa69ce66cda82acf41f374ed8848ce627e2cf9ad91f075936fcb373161dff3190c0fa2c2f6ba0cba9b7e51ca22f00b626355f5c54ead3dab0e4fa71c
|
data/lib/lowdata.rb
CHANGED
|
@@ -38,6 +38,14 @@ class LowData
|
|
|
38
38
|
@tables = nil
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
+
# Runs a block in one transaction so writes through several repositories all happen or none do. It takes Sequel's
|
|
42
|
+
# options, like `LowData.transaction(isolation: :serializable) { ... }`.
|
|
43
|
+
def transaction(...)
|
|
44
|
+
raise ConfigError, ConfigError::MISSING_DATABASE if database.nil?
|
|
45
|
+
|
|
46
|
+
database.transaction(...)
|
|
47
|
+
end
|
|
48
|
+
|
|
41
49
|
# The database's tables, cached until the database changes.
|
|
42
50
|
def tables
|
|
43
51
|
@tables ||= database.tables
|
data/lib/version.rb
CHANGED