Skip to content

Commit

Permalink
Only initialize once
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Oct 8, 2024
1 parent 275677b commit ee540f1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/neighbor/sqlite.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
module Neighbor
module SQLite
def self.initialize!
return if defined?(@initialized)

require_relative "type/sqlite_vector"
require_relative "type/sqlite_int8_vector"

require "sqlite_vec"
require "active_record/connection_adapters/sqlite3_adapter"

ActiveRecord::ConnectionAdapters::SQLite3Adapter.prepend(InstanceMethods)

@initialized = true
end

module InstanceMethods
Expand Down

0 comments on commit ee540f1

Please sign in to comment.