Skip to content

Commit

Permalink
disable load_extension after, update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jethrodaniel committed Oct 21, 2024
1 parent 1af3764 commit a4d49b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ It then exposes a method (`SqliteExtensions::UUID.extension_path`) which returns

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.

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


## Development

Expand Down
2 changes: 2 additions & 0 deletions lib/sqlite_extensions/uuid/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def configure_connection
Rails.logger.error do
"Error loading sqlite extension '#{SqliteExtensions::UUID.extension_path}' (#{e})"
end
ensure
@raw_connection.enable_load_extension(false)
end
end
end
Expand Down

0 comments on commit a4d49b2

Please sign in to comment.