lib/blind_index.rb in blind_index-2.0.0 vs lib/blind_index.rb in blind_index-2.0.1
- old
+ new
@@ -2,10 +2,11 @@
require "active_support"
require "openssl"
require "argon2/kdf"
# modules
+require "blind_index/backfill"
require "blind_index/key_generator"
require "blind_index/model"
require "blind_index/version"
module BlindIndex
@@ -124,9 +125,13 @@
raise BlindIndex::Error, "Key must use binary encoding" if key.encoding != Encoding::BINARY
raise BlindIndex::Error, "Key must be 32 bytes" if key.bytesize != 32
key
+ end
+
+ def self.backfill(relation, columns: nil, batch_size: 1000)
+ Backfill.new(relation, columns: columns, batch_size: batch_size).perform
end
end
ActiveSupport.on_load(:active_record) do
require "blind_index/extensions"