rails-uuid-pk 0.9.0 → 0.10.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/README.md +3 -3
- data/lib/rails_uuid_pk/migration_helpers.rb +11 -0
- data/lib/rails_uuid_pk/mysql2_adapter_extension.rb +22 -0
- data/lib/rails_uuid_pk/sqlite3_adapter_extension.rb +22 -0
- data/lib/rails_uuid_pk/version.rb +2 -2
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5c8d9367ce6e034ff5ecc94e41e482b38e56f0886fd7cbbcb73a43bd948e3f96
|
|
4
|
+
data.tar.gz: 972cf5ee47c2c0ca1120decb6f35e16da2e62d9b2e2d2cee8b171fb883bdc003
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fd95a444a62a9b337c0c6033530fe75db6e0873750bb8e43f1ac47a6bfdee4443b5139c9f79aa4b432752fcfdd54a32adfca598e6a1dfe5669b8085c2eb2b7cf
|
|
7
|
+
data.tar.gz: ad6c1eb9f0fed6a62b15930fca2a1e67b09d0c4940314f5fca8032e130637619105159b49f5dd37e96ceb2ccff7ad057ff30b81ae044a2d864e752dec748dde3
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v1.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.10.0] - 2026-01-15
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Migration Method `t.uuid`**: Added support for explicit `t.uuid` column definition in migrations for SQLite and MySQL, ensuring consistency with schema dumping and loading
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- **Documentation URI**: Corrected documentation URI in gemspec to use proper RubyDoc.info format
|
|
15
|
+
- **Schema Dumping for SQLite/MySQL**: Fixed "Unknown type" errors during `db:schema:dump` and `NoMethodError` during schema loading by implementing proper type registration and dumper overrides for non-native UUID adapters
|
|
16
|
+
|
|
17
|
+
### Documentation
|
|
18
|
+
- **Performance Claims**: Corrected UUID generation throughput from ~10,000 to ~800,000 UUIDs/second in README.md and PERFORMANCE.md to reflect actual benchmark results
|
|
19
|
+
- **Architecture Documentation**: Updated ARCHITECTURE.md with accurate database adapter descriptions, corrected PostgreSQL native support vs extension usage, and added proper code examples for MySQL/SQLite extensions
|
|
20
|
+
- **Agent Development Guide**: Updated AGENTS.md with current project structure, test organization, code architecture details, and Rails version requirements
|
|
21
|
+
- **Security Documentation**: Updated SECURITY.md supported versions table to reflect current version 0.10.0 as actively supported
|
|
22
|
+
|
|
8
23
|
## [0.9.0] - 2026-01-14
|
|
9
24
|
|
|
10
25
|
### Added
|
data/README.md
CHANGED
|
@@ -27,7 +27,7 @@ Automatically use UUID v7 for **all primary keys** in Rails applications. Works
|
|
|
27
27
|
Add to your `Gemfile`:
|
|
28
28
|
|
|
29
29
|
```ruby
|
|
30
|
-
gem "rails-uuid-pk", "~> 0.
|
|
30
|
+
gem "rails-uuid-pk", "~> 0.10"
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
Then run:
|
|
@@ -94,7 +94,7 @@ end
|
|
|
94
94
|
|
|
95
95
|
## Performance Overview
|
|
96
96
|
|
|
97
|
-
**Generation**: ~
|
|
97
|
+
**Generation**: ~800,000 UUIDs/second with cryptographic security and monotonic ordering
|
|
98
98
|
|
|
99
99
|
| Database | Storage | Index Performance | Notes |
|
|
100
100
|
|----------|---------|-------------------|--------|
|
|
@@ -214,7 +214,7 @@ DB=sqlite ./bin/test test/uuid/type_test.rb
|
|
|
214
214
|
gem build rails_uuid_pk.gemspec
|
|
215
215
|
|
|
216
216
|
# Install locally for testing
|
|
217
|
-
gem install rails-uuid-pk-0.
|
|
217
|
+
gem install rails-uuid-pk-0.10.0.gem
|
|
218
218
|
```
|
|
219
219
|
|
|
220
220
|
### Database Setup
|
|
@@ -162,6 +162,17 @@ module RailsUuidPk
|
|
|
162
162
|
# Alias for add_reference method (ActiveRecord compatibility)
|
|
163
163
|
alias_method :add_belongs_to, :add_reference
|
|
164
164
|
|
|
165
|
+
# Defines a UUID column in a table.
|
|
166
|
+
#
|
|
167
|
+
# @param args [Array] Arguments passed to the column method
|
|
168
|
+
# @param options [Hash] Options passed to the column method
|
|
169
|
+
# @return [void]
|
|
170
|
+
def uuid(*args, **options)
|
|
171
|
+
if respond_to?(:column)
|
|
172
|
+
column(*args, :uuid, **options)
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
|
|
165
176
|
private
|
|
166
177
|
|
|
167
178
|
# Checks if a table uses UUID primary keys.
|
|
@@ -25,6 +25,17 @@ module RailsUuidPk
|
|
|
25
25
|
)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
+
# Checks if a type is valid for this adapter.
|
|
29
|
+
#
|
|
30
|
+
# Overrides ActiveRecord's valid_type? to recognize the custom UUID type.
|
|
31
|
+
#
|
|
32
|
+
# @param type [Symbol] The type to check
|
|
33
|
+
# @return [Boolean] true if the type is valid
|
|
34
|
+
def valid_type?(type)
|
|
35
|
+
return true if type == :uuid
|
|
36
|
+
super
|
|
37
|
+
end
|
|
38
|
+
|
|
28
39
|
# Registers UUID type handlers in the adapter's type map.
|
|
29
40
|
#
|
|
30
41
|
# @param m [ActiveRecord::ConnectionAdapters::AbstractAdapter::TypeMap] The type map to register with
|
|
@@ -51,5 +62,16 @@ module RailsUuidPk
|
|
|
51
62
|
super
|
|
52
63
|
register_uuid_types
|
|
53
64
|
end
|
|
65
|
+
|
|
66
|
+
# Overrides type dumping to properly handle UUID columns.
|
|
67
|
+
#
|
|
68
|
+
# @param column [ActiveRecord::ConnectionAdapters::Column] The column to dump
|
|
69
|
+
# @return [Array] The type and options for the schema dump
|
|
70
|
+
def type_to_dump(column)
|
|
71
|
+
if column.type == :uuid
|
|
72
|
+
return [ :uuid, {} ]
|
|
73
|
+
end
|
|
74
|
+
super
|
|
75
|
+
end
|
|
54
76
|
end
|
|
55
77
|
end
|
|
@@ -25,6 +25,17 @@ module RailsUuidPk
|
|
|
25
25
|
)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
+
# Checks if a type is valid for this adapter.
|
|
29
|
+
#
|
|
30
|
+
# Overrides ActiveRecord's valid_type? to recognize the custom UUID type.
|
|
31
|
+
#
|
|
32
|
+
# @param type [Symbol] The type to check
|
|
33
|
+
# @return [Boolean] true if the type is valid
|
|
34
|
+
def valid_type?(type)
|
|
35
|
+
return true if type == :uuid
|
|
36
|
+
super
|
|
37
|
+
end
|
|
38
|
+
|
|
28
39
|
# Registers UUID type handlers in the adapter's type map.
|
|
29
40
|
#
|
|
30
41
|
# @param m [ActiveRecord::ConnectionAdapters::AbstractAdapter::TypeMap] The type map to register with
|
|
@@ -53,5 +64,16 @@ module RailsUuidPk
|
|
|
53
64
|
super unless open_transactions > 0
|
|
54
65
|
register_uuid_types
|
|
55
66
|
end
|
|
67
|
+
|
|
68
|
+
# Overrides type dumping to properly handle UUID columns.
|
|
69
|
+
#
|
|
70
|
+
# @param column [ActiveRecord::ConnectionAdapters::Column] The column to dump
|
|
71
|
+
# @return [Array] The type and options for the schema dump
|
|
72
|
+
def type_to_dump(column)
|
|
73
|
+
if column.type == :uuid
|
|
74
|
+
return [ :uuid, {} ]
|
|
75
|
+
end
|
|
76
|
+
super
|
|
77
|
+
end
|
|
56
78
|
end
|
|
57
79
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails-uuid-pk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.10.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joon Lee
|
|
@@ -163,6 +163,7 @@ metadata:
|
|
|
163
163
|
homepage_uri: https://github.com/seouri/rails-uuid-pk
|
|
164
164
|
source_code_uri: https://github.com/seouri/rails-uuid-pk
|
|
165
165
|
changelog_uri: https://github.com/seouri/rails-uuid-pk/blob/main/CHANGELOG.md
|
|
166
|
+
documentation_uri: https://www.rubydoc.info/gems/rails-uuid-pk
|
|
166
167
|
rdoc_options: []
|
|
167
168
|
require_paths:
|
|
168
169
|
- lib
|