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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/lowdata.rb +8 -0
  3. data/lib/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a60081b4c639b69a294357c674a23d6883a2e6ef3ae07443d6973fcc8ae6b23b
4
- data.tar.gz: 928ba9f485e9b21c57792ae886019cf5d261b360381d0a3ddadfe48a41c17732
3
+ metadata.gz: 575de6b7701291fbe921534112c3806d64d9b842887a911b2c0076d97fb9736b
4
+ data.tar.gz: f7e2be3e91deb27a14a13d80edbd3724973dcbdd45422b3c506e4725254d4022
5
5
  SHA512:
6
- metadata.gz: efe0e943ce87714b3ddb6cd94e47ffd84df3361c55315d1738e13e3258f252af37b0de43bad34bf44c91503c9378628f090c46133d75b7d4da5a16c9a23cf1f9
7
- data.tar.gz: 9f473eb0e5dd98161f195abdca91b62dec026e778bec15bf37e114f88f87588b73ce596a6a8e0543c4d2b21e7f500eaeb5101a09a6c8406f05a3f035667f5b5c
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class LowData
4
- VERSION = '0.4.5'
4
+ VERSION = '0.4.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lowdata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - maedi