snowflaked 0.1.2-arm-linux → 0.1.3-arm-linux
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 +11 -0
- data/lib/snowflaked/3.2/snowflaked.so +0 -0
- data/lib/snowflaked/3.3/snowflaked.so +0 -0
- data/lib/snowflaked/3.4/snowflaked.so +0 -0
- data/lib/snowflaked/4.0/snowflaked.so +0 -0
- data/lib/snowflaked/model_extensions.rb +7 -3
- data/lib/snowflaked/version.rb +1 -1
- data/lib/snowflaked.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 38fc2352d02dd80016be6d3998758807ce1a4ccb38d1d023cc6162b08cbf9d1a
|
|
4
|
+
data.tar.gz: 0ae9a58b29de3bef02ce745d4e8fe6d53f7e4320403d392316b8ea87a357f675
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9861a1d5b31bb0089bdbd7099bfa22e18d37f6079e0e7e03394686ef874575547d4bfc214c2baa02001e18afa1356667a23c9e2efb64dee06e3778aaa14f7a8f
|
|
7
|
+
data.tar.gz: b588edc1d663adf0e6a59c6ef6c5c7b0ccff64450838d95b4d17ae27372f4cd621c08e70811bb437312c56cfc789e2d5fda21fb19c8e99686e3ad04988767da3
|
data/README.md
CHANGED
|
@@ -87,6 +87,13 @@ Snowflaked.configure do |config|
|
|
|
87
87
|
end
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
+
### Machine ID
|
|
91
|
+
|
|
92
|
+
> [!TIP]
|
|
93
|
+
> For multi-process servers like Puma, it is recommended to **not** configure `machine_id` explicitly. The gem automatically calculates a unique machine ID using `(hostname.hash ^ pid) % 1024`, which ensures each forked worker process gets a different ID and avoids duplicate Snowflake IDs.
|
|
94
|
+
|
|
95
|
+
If you must set `machine_id` explicitly, use environment variables that differ per worker process.
|
|
96
|
+
|
|
90
97
|
### Machine ID Resolution
|
|
91
98
|
|
|
92
99
|
If `machine_id` is not explicitly configured, it resolves in this order:
|
|
@@ -151,6 +158,10 @@ bundle install
|
|
|
151
158
|
bundle exec rake
|
|
152
159
|
```
|
|
153
160
|
|
|
161
|
+
## Acknowledgments
|
|
162
|
+
|
|
163
|
+
- [snowflaked-rs](https://github.com/MrGunflame/snowflaked-rs) - the Rust implementation of Snowflake IDs
|
|
164
|
+
|
|
154
165
|
## License
|
|
155
166
|
|
|
156
167
|
MIT
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -5,7 +5,7 @@ module Snowflaked
|
|
|
5
5
|
extend ActiveSupport::Concern
|
|
6
6
|
|
|
7
7
|
included do
|
|
8
|
-
class_attribute :_snowflake_attributes, instance_writer: false, default: [:id]
|
|
8
|
+
class_attribute :_snowflake_attributes, instance_writer: false, default: [:id]
|
|
9
9
|
before_validation :_generate_snowflake_ids, on: :create
|
|
10
10
|
end
|
|
11
11
|
|
|
@@ -17,9 +17,13 @@ module Snowflaked
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def _snowflake_columns_from_comments
|
|
20
|
-
return
|
|
20
|
+
return @_snowflake_columns_from_comments if defined?(@_snowflake_columns_from_comments)
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
@_snowflake_columns_from_comments = if table_exists?
|
|
23
|
+
columns.filter_map { |col| col.name.to_sym if col.comment == Snowflaked::SchemaDefinitions::COMMENT }
|
|
24
|
+
else
|
|
25
|
+
[]
|
|
26
|
+
end
|
|
23
27
|
end
|
|
24
28
|
end
|
|
25
29
|
|
data/lib/snowflaked/version.rb
CHANGED
data/lib/snowflaked.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: snowflaked
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: arm-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Luiz Eduardo Kowalski
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-01-
|
|
11
|
+
date: 2026-01-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A Ruby gem for generating Twitter Snowflake IDs using a high-performance
|
|
14
14
|
Rust backend. Thread-safe with configurable machine ID and custom epoch support.
|