tarantool-model 0.1.0 → 0.3.0

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.
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'tarantool/model'
4
+ require 'zlib'
5
+
6
+ require_relative 'testing/memory_storage/keys'
7
+ require_relative 'testing/memory_storage/violation'
8
+ require_relative 'testing/memory_storage/index_declaration'
9
+ require_relative 'testing/memory_storage/declaration'
10
+ require_relative 'testing/memory_storage/operations'
11
+ require_relative 'testing/memory_storage/order'
12
+ require_relative 'testing/memory_storage/scan'
13
+ require_relative 'testing/memory_storage/sequence'
14
+ require_relative 'testing/memory_storage/space'
15
+ require_relative 'testing/memory_storage/box_mode'
16
+ require_relative 'testing/memory_storage/crud_mode'
17
+ require_relative 'testing/memory_storage'
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tarantool
4
4
  module Model
5
- VERSION = '0.1.0'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
@@ -15,6 +15,7 @@ require_relative 'model/types/binary'
15
15
  require_relative 'model/settings'
16
16
  require_relative 'model/state'
17
17
  require_relative 'model/persistence'
18
+ require_relative 'model/locking'
18
19
  require_relative 'model/counters'
19
20
  require_relative 'model/relation'
20
21
  require_relative 'model/querying'
@@ -27,6 +28,22 @@ module Tarantool
27
28
  module Model
28
29
  extend ActiveSupport::Concern
29
30
 
31
+ DEFAULT_STORAGE_LOCK = Mutex.new
32
+ private_constant :DEFAULT_STORAGE_LOCK
33
+
34
+ class << self
35
+ # Storage for models that set none of their own: a storage, or a Proc called once on first use.
36
+ attr_writer :default_storage
37
+
38
+ def default_storage
39
+ DEFAULT_STORAGE_LOCK.synchronize do
40
+ @default_storage = @default_storage.call if @default_storage.is_a?(Proc)
41
+
42
+ @default_storage
43
+ end
44
+ end
45
+ end
46
+
30
47
  include ActiveModel::API
31
48
  include ActiveModel::Attributes
32
49
  include ActiveModel::Dirty
@@ -35,6 +52,7 @@ module Tarantool
35
52
  include Settings
36
53
  include State
37
54
  include Persistence
55
+ include Locking
38
56
  include Counters
39
57
  include Transactional
40
58
  include Querying
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tarantool-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Starlexxx
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-16 00:00:00.000000000 Z
11
+ date: 2026-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 0.1.0
39
+ version: 0.2.0
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: 0.1.0
46
+ version: 0.2.0
47
47
  description: Attributes, validations, callbacks, dirty tracking and index-based queries
48
48
  with keyset pagination over Tarantool 2.11+ and 3.x spaces, through tarantool-client
49
49
  or tarantool-crud.
@@ -60,6 +60,7 @@ files:
60
60
  - lib/tarantool/model/counters.rb
61
61
  - lib/tarantool/model/errors.rb
62
62
  - lib/tarantool/model/key.rb
63
+ - lib/tarantool/model/locking.rb
63
64
  - lib/tarantool/model/persistence.rb
64
65
  - lib/tarantool/model/querying.rb
65
66
  - lib/tarantool/model/relation.rb
@@ -69,6 +70,19 @@ files:
69
70
  - lib/tarantool/model/storage/box.rb
70
71
  - lib/tarantool/model/storage/box/layout.rb
71
72
  - lib/tarantool/model/storage/crud.rb
73
+ - lib/tarantool/model/testing.rb
74
+ - lib/tarantool/model/testing/memory_storage.rb
75
+ - lib/tarantool/model/testing/memory_storage/box_mode.rb
76
+ - lib/tarantool/model/testing/memory_storage/crud_mode.rb
77
+ - lib/tarantool/model/testing/memory_storage/declaration.rb
78
+ - lib/tarantool/model/testing/memory_storage/index_declaration.rb
79
+ - lib/tarantool/model/testing/memory_storage/keys.rb
80
+ - lib/tarantool/model/testing/memory_storage/operations.rb
81
+ - lib/tarantool/model/testing/memory_storage/order.rb
82
+ - lib/tarantool/model/testing/memory_storage/scan.rb
83
+ - lib/tarantool/model/testing/memory_storage/sequence.rb
84
+ - lib/tarantool/model/testing/memory_storage/space.rb
85
+ - lib/tarantool/model/testing/memory_storage/violation.rb
72
86
  - lib/tarantool/model/transactional.rb
73
87
  - lib/tarantool/model/transactions.rb
74
88
  - lib/tarantool/model/types/binary.rb