Skip to content

Commit a4d49b2

Browse files
committed
disable load_extension after, update readme
1 parent 1af3764 commit a4d49b2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ 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.
47+
4648

4749
## Development
4850

lib/sqlite_extensions/uuid/rails.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ def configure_connection
2424
Rails.logger.error do
2525
"Error loading sqlite extension '#{SqliteExtensions::UUID.extension_path}' (#{e})"
2626
end
27+
ensure
28+
@raw_connection.enable_load_extension(false)
2729
end
2830
end
2931
end

0 commit comments

Comments
 (0)