Skip to content

Commit a89ff17

Browse files
committed
tiny updates
1 parent 4a4dd88 commit a89ff17

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ It then exposes a method (`SqliteExtensions::UUID.extension_path`) which returns
4343

4444
For Rails, it also exposes a [railtie](https://api.rubyonrails.org/v7.2/classes/Rails/Railtie.html) (via `require: "sqlite_extensions/uuid/rails"`) that patches Rails' [configure_connection](https://github.com/rails/rails/blob/v8.0.0.rc1/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L815) method for the SQLite adapter, so that all SQLite database connections load the extension.
4545

46-
Ideally, Rails will eventually provide an official way to configure the SQLite connection, at which point we can migrate the railtie to that approach.
46+
This doesn't scale well to supporting multiple SQLite extensions, but works fine if all you need is the UUID extension.
4747

48+
Ideally, Rails will eventually provide an official way to configure the SQLite connection, at which point we can migrate the railtie to that approach.
4849

4950
## Development
5051

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
# frozen_string_literal: true
2+
13
require_relative "railtie"

lib/sqlite_extensions/uuid/railtie.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ def configure_connection
2020
@raw_connection.enable_load_extension(true)
2121
@raw_connection.load_extension(SqliteExtensions::UUID.extension_path)
2222
rescue SQLite3::Exception => e
23-
# no such function: uuid (SQLite3::SQLException)
24-
Rails.logger.error do
25-
"Error loading sqlite extension '#{SqliteExtensions::UUID.extension_path}' (#{e})"
26-
end
23+
Rails.logger.error { "Error loading sqlite extension '#{SqliteExtensions::UUID.extension_path}' (#{e})" }
2724
ensure
2825
@raw_connection.enable_load_extension(false)
2926
end

0 commit comments

Comments
 (0)