sqlite_crypto 1.0.0 → 1.0.2
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 +17 -0
- data/README.md +2 -2
- data/lib/sqlite_crypto/railtie.rb +6 -0
- data/lib/sqlite_crypto/schema_definitions.rb +17 -0
- data/lib/sqlite_crypto/sqlite3_adapter_extension.rb +12 -0
- data/lib/sqlite_crypto/version.rb +1 -1
- data/lib/sqlite_crypto.rb +1 -0
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e96e2b21abe2fda0fb427c7366a25fd6005aea24b9e4f34a43800bfc0ac86ca6
|
|
4
|
+
data.tar.gz: 1caad623be6f23c5d2e594d8d1ba2adfa335a870d82cc822f6b3c420d1aff716
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3ecb2d540c47219e2dc9fe1efb201419fef5f12c84c55b65779209a0a720a41563c63294822f5add66abfb2427ab3ee2ecce82e6712bbb49fe87fe690dd66af3
|
|
7
|
+
data.tar.gz: 1b7621ca195c0dd79343d8070072a8b964cb20dfeae36b7ef01dc659a3707807b02cc5c0b3944a52b84f487a406b5fdec2f6d0a41e0c9eb8305f7863c4d81513
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ 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/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.0.2] - 2025-12-21
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Schema Definitions**: Added global `uuid` and `ulid` helper methods for schema.rb
|
|
12
|
+
- Fixes `NameError: undefined local variable or method 'uuid'` when loading schema.rb
|
|
13
|
+
- Schema dumper now outputs `id: uuid` which correctly resolves to `:uuid` symbol
|
|
14
|
+
- Allows schema.rb to be loaded without errors
|
|
15
|
+
|
|
16
|
+
## [1.0.1] - 2025-12-21
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- **Native Database Types**: Added `native_database_types` registration for `:uuid` and `:ulid`
|
|
20
|
+
- UUID columns now correctly create `varchar(36)` in migrations instead of literal `uuid` type
|
|
21
|
+
- ULID columns now correctly create `varchar(26)` in migrations instead of literal `ulid` type
|
|
22
|
+
- Schema dumper now works properly without "Unknown type" errors
|
|
23
|
+
- Fixes compatibility issue discovered during real-world usage
|
|
24
|
+
|
|
8
25
|
## [1.0.0] - 2025-12-20
|
|
9
26
|
|
|
10
27
|
### Added
|
data/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SQLite crypto
|
|
2
2
|
|
|
3
|
-
[](https://github.com/bart-oz/sqlite_crypto/releases)
|
|
4
4
|
[](LICENSE.txt)
|
|
5
5
|
[](https://github.com/bart-oz/sqlite_crypto/actions)
|
|
6
|
-
[](https://github.com/bart-oz/sqlite_crypto/actions)
|
|
7
7
|
[](https://github.com/bart-oz/sqlite_crypto)
|
|
8
8
|
|
|
9
9
|
Seamless UUID and ULID primary key support for Rails with SQLite3.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require "sqlite_crypto/type/uuid"
|
|
4
4
|
require "sqlite_crypto/type/ulid"
|
|
5
|
+
require "sqlite_crypto/sqlite3_adapter_extension"
|
|
5
6
|
|
|
6
7
|
module SqliteCrypto
|
|
7
8
|
class Railtie < ::Rails::Railtie
|
|
@@ -13,6 +14,11 @@ module SqliteCrypto
|
|
|
13
14
|
ActiveRecord::Type.register(:ulid, SqliteCrypto::Type::ULID, adapter: :sqlite3)
|
|
14
15
|
end
|
|
15
16
|
|
|
17
|
+
initializer "sqlite_crypto.native_types" do
|
|
18
|
+
require "active_record/connection_adapters/sqlite3_adapter"
|
|
19
|
+
ActiveRecord::ConnectionAdapters::SQLite3Adapter.prepend(SqliteCrypto::Sqlite3AdapterExtension)
|
|
20
|
+
end
|
|
21
|
+
|
|
16
22
|
initializer "sqlite_crypto.schema_dumper", after: "active_record.initialize_database" do
|
|
17
23
|
require "active_record/connection_adapters/sqlite3_adapter"
|
|
18
24
|
require "sqlite_crypto/schema_dumper"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Module to add uuid/ulid helper methods to schema loading context
|
|
4
|
+
module SqliteCrypto
|
|
5
|
+
module SchemaDefinitions
|
|
6
|
+
def uuid
|
|
7
|
+
:uuid
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def ulid
|
|
11
|
+
:ulid
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Extend the main object context for schema.rb loading
|
|
17
|
+
Object.include(SqliteCrypto::SchemaDefinitions)
|
data/lib/sqlite_crypto.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sqlite_crypto
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- BartOz
|
|
@@ -164,7 +164,9 @@ files:
|
|
|
164
164
|
- lib/sqlite_crypto/migration_helpers.rb
|
|
165
165
|
- lib/sqlite_crypto/model_extensions.rb
|
|
166
166
|
- lib/sqlite_crypto/railtie.rb
|
|
167
|
+
- lib/sqlite_crypto/schema_definitions.rb
|
|
167
168
|
- lib/sqlite_crypto/schema_dumper.rb
|
|
169
|
+
- lib/sqlite_crypto/sqlite3_adapter_extension.rb
|
|
168
170
|
- lib/sqlite_crypto/type/base.rb
|
|
169
171
|
- lib/sqlite_crypto/type/ulid.rb
|
|
170
172
|
- lib/sqlite_crypto/type/uuid.rb
|