Skip to content

Commit

Permalink
Adopt sqlite extension loading features of rails and sqlite3
Browse files Browse the repository at this point in the history
Lib files are necessary to adapt to the to_path interface expected by
the extension loading mechansim
  • Loading branch information
rossta committed Dec 18, 2024
1 parent 848a2b3 commit a98ef8b
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 90 deletions.
4 changes: 2 additions & 2 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ default: &default
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 3 } %>
timeout: 5000
extensions:
- sqlite_ulid
- sqlite_vec
- SqliteExt::ULID
- SqliteExt::Vec

development:
primary:
Expand Down
1 change: 1 addition & 0 deletions config/initializers/sqlite.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require_relative "../../lib/sqlite_ext"
12 changes: 0 additions & 12 deletions config/initializers/sqlpkg.rb

This file was deleted.

4 changes: 0 additions & 4 deletions lib/enhanced_sqlite3.rb

This file was deleted.

56 changes: 0 additions & 56 deletions lib/enhanced_sqlite3/adapter.rb

This file was deleted.

2 changes: 2 additions & 0 deletions lib/sqlite_ext.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require_relative "sqlite_ext/ulid"
require_relative "sqlite_ext/vec"
9 changes: 9 additions & 0 deletions lib/sqlite_ext/ulid.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require "sqlite_ulid"

module SqliteExt
module ULID
def self.to_path
SqliteUlid.ulid_loadable_path
end
end
end
7 changes: 7 additions & 0 deletions lib/sqlite_ext/vec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require "sqlite_vec"

module SqliteExt
module Vec
def self.to_path = SqliteVec.loadable_path
end
end
11 changes: 0 additions & 11 deletions lib/sqlpkg_loader.rb

This file was deleted.

5 changes: 0 additions & 5 deletions spec/lib/enhanced_sqlite3/adapter_spec.rb

This file was deleted.

0 comments on commit a98ef8b

Please sign in to comment.