Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt sqlite extension loading #325

Merged
merged 4 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby file: ".ruby-version"

gem "rails" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", github: "rails/rails" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"

gem "puma", ">= 5.0" # Use the Puma web server [https://github.com/puma/puma]
gem "sqlite3", force_ruby_platform: true # Use sqlite3 as the database for Active Record [https://github.com/sparklemotion/sqlite3-ruby]
Expand Down
161 changes: 83 additions & 78 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,81 +1,66 @@
GIT
remote: https://github.com/railsadminteam/rails_admin.git
revision: e38c12d98e3e11b858d2f3caa752013b7478f926
specs:
rails_admin (3.2.1)
activemodel-serializers-xml (>= 1.0)
csv
kaminari (>= 0.14, < 2.0)
nested_form (~> 0.3)
rails (>= 6.0, < 9)
turbo-rails (>= 1.0, < 3)

GEM
remote: https://rubygems.org/
remote: https://github.com/rails/rails.git
revision: 8149a919848182018d061392136342ebc955d709
specs:
actioncable (8.0.0.1)
actionpack (= 8.0.0.1)
activesupport (= 8.0.0.1)
actioncable (8.1.0.alpha)
actionpack (= 8.1.0.alpha)
activesupport (= 8.1.0.alpha)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (8.0.0.1)
actionpack (= 8.0.0.1)
activejob (= 8.0.0.1)
activerecord (= 8.0.0.1)
activestorage (= 8.0.0.1)
activesupport (= 8.0.0.1)
actionmailbox (8.1.0.alpha)
actionpack (= 8.1.0.alpha)
activejob (= 8.1.0.alpha)
activerecord (= 8.1.0.alpha)
activestorage (= 8.1.0.alpha)
activesupport (= 8.1.0.alpha)
mail (>= 2.8.0)
actionmailer (8.0.0.1)
actionpack (= 8.0.0.1)
actionview (= 8.0.0.1)
activejob (= 8.0.0.1)
activesupport (= 8.0.0.1)
actionmailer (8.1.0.alpha)
actionpack (= 8.1.0.alpha)
actionview (= 8.1.0.alpha)
activejob (= 8.1.0.alpha)
activesupport (= 8.1.0.alpha)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (8.0.0.1)
actionview (= 8.0.0.1)
activesupport (= 8.0.0.1)
actionpack (8.1.0.alpha)
actionview (= 8.1.0.alpha)
activesupport (= 8.1.0.alpha)
nokogiri (>= 1.8.5)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actiontext (8.0.0.1)
actionpack (= 8.0.0.1)
activerecord (= 8.0.0.1)
activestorage (= 8.0.0.1)
activesupport (= 8.0.0.1)
actiontext (8.1.0.alpha)
actionpack (= 8.1.0.alpha)
activerecord (= 8.1.0.alpha)
activestorage (= 8.1.0.alpha)
activesupport (= 8.1.0.alpha)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (8.0.0.1)
activesupport (= 8.0.0.1)
actionview (8.1.0.alpha)
activesupport (= 8.1.0.alpha)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (8.0.0.1)
activesupport (= 8.0.0.1)
activejob (8.1.0.alpha)
activesupport (= 8.1.0.alpha)
globalid (>= 0.3.6)
activemodel (8.0.0.1)
activesupport (= 8.0.0.1)
activemodel-serializers-xml (1.0.3)
activemodel (>= 5.0.0.a)
activesupport (>= 5.0.0.a)
builder (~> 3.1)
activerecord (8.0.0.1)
activemodel (= 8.0.0.1)
activesupport (= 8.0.0.1)
activemodel (8.1.0.alpha)
activesupport (= 8.1.0.alpha)
activerecord (8.1.0.alpha)
activemodel (= 8.1.0.alpha)
activesupport (= 8.1.0.alpha)
timeout (>= 0.4.0)
activestorage (8.0.0.1)
actionpack (= 8.0.0.1)
activejob (= 8.0.0.1)
activerecord (= 8.0.0.1)
activesupport (= 8.0.0.1)
activestorage (8.1.0.alpha)
actionpack (= 8.1.0.alpha)
activejob (= 8.1.0.alpha)
activerecord (= 8.1.0.alpha)
activesupport (= 8.1.0.alpha)
marcel (~> 1.0)
activesupport (8.0.0.1)
activesupport (8.1.0.alpha)
base64
benchmark (>= 0.3)
bigdecimal
Expand All @@ -88,6 +73,48 @@ GEM
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
rails (8.1.0.alpha)
actioncable (= 8.1.0.alpha)
actionmailbox (= 8.1.0.alpha)
actionmailer (= 8.1.0.alpha)
actionpack (= 8.1.0.alpha)
actiontext (= 8.1.0.alpha)
actionview (= 8.1.0.alpha)
activejob (= 8.1.0.alpha)
activemodel (= 8.1.0.alpha)
activerecord (= 8.1.0.alpha)
activestorage (= 8.1.0.alpha)
activesupport (= 8.1.0.alpha)
bundler (>= 1.15.0)
railties (= 8.1.0.alpha)
railties (8.1.0.alpha)
actionpack (= 8.1.0.alpha)
activesupport (= 8.1.0.alpha)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)

GIT
remote: https://github.com/railsadminteam/rails_admin.git
revision: e38c12d98e3e11b858d2f3caa752013b7478f926
specs:
rails_admin (3.2.1)
activemodel-serializers-xml (>= 1.0)
csv
kaminari (>= 0.14, < 2.0)
nested_form (~> 0.3)
rails (>= 6.0, < 9)
turbo-rails (>= 1.0, < 3)

GEM
remote: https://rubygems.org/
specs:
activemodel-serializers-xml (1.0.3)
activemodel (>= 5.0.0.a)
activesupport (>= 5.0.0.a)
builder (~> 3.1)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
annotaterb (4.13.0)
Expand Down Expand Up @@ -407,20 +434,6 @@ GEM
rack (>= 1.3)
rackup (2.2.1)
rack (>= 3)
rails (8.0.0.1)
actioncable (= 8.0.0.1)
actionmailbox (= 8.0.0.1)
actionmailer (= 8.0.0.1)
actionpack (= 8.0.0.1)
actiontext (= 8.0.0.1)
actionview (= 8.0.0.1)
activejob (= 8.0.0.1)
activemodel (= 8.0.0.1)
activerecord (= 8.0.0.1)
activestorage (= 8.0.0.1)
activesupport (= 8.0.0.1)
bundler (>= 1.15.0)
railties (= 8.0.0.1)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
Expand All @@ -436,14 +449,6 @@ GEM
json
require_all (~> 3.0)
ruby-progressbar
railties (8.0.0.1)
actionpack (= 8.0.0.1)
activesupport (= 8.0.0.1)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.2.1)
rdoc (6.8.1)
Expand Down Expand Up @@ -552,7 +557,7 @@ GEM
sqlite-ulid (0.2.1-x86_64-linux)
sqlite-vec (0.1.6-arm64-darwin)
sqlite-vec (0.1.6-x86_64-linux)
sqlite3 (2.3.1)
sqlite3 (2.4.1)
mini_portile2 (~> 2.8.0)
sqlpkg (0.2.3.1-arm64-darwin)
sqlpkg (0.2.3.1-x86_64-linux)
Expand Down Expand Up @@ -662,7 +667,7 @@ DEPENDENCIES
propshaft
puma (>= 5.0)
rack-mini-profiler
rails
rails!
rails_admin!
rails_best_practices
reek
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/test/fixtures/views/searches/combobox.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
</svg><label for="search-combobox" class="sr-only">Query</label> <input value="Rails" autofocus="autofocus" role="combobox" aria-expanded="false" aria-autocomplete="none" aria-controls="search-listbox" aria-owns="search-listbox" aria-haspopup="listbox" aria-activedescendant="" id="search-combobox" data-action="
focus-&gt;combobox#tryOpen
input-&gt;autosubmit-form#submit
" placeholder="Search Joy of Rails" class="w-full step-1" type="search" name="query" /></div><input value="search" autocomplete="off" type="hidden" name="name" id="name" /></form><ul id="search-listbox" role="listbox" class="grid" data-controller="search-listbox"><li aria-label="Here’the thing" role="option" id="search-option_search_result_articles-heres-the-thing" class="rounded"><a href="/articles/heres-the-thing"><div>Here’the thing</div><div>Ruby is a programming language</div></a></li><li aria-label="Introducing Joy of Rails" role="option" id="search-option_search_result_articles-joy-of-rails" class="rounded"><a href="/articles/joy-of-rails"><div>Introducing Joy of Rails</div><div>Rails is a web application framework</div></a></li></ul></div>
" placeholder="Search Joy of Rails" class="w-full step-1" type="search" name="query" /></div><input autocomplete="off" value="search" type="hidden" name="name" id="name" /></form><ul id="search-listbox" role="listbox" class="grid" data-controller="search-listbox"><li aria-label="Here’the thing" role="option" id="search-option_search_result_articles-heres-the-thing" class="rounded"><a href="/articles/heres-the-thing"><div>Here’the thing</div><div>Ruby is a programming language</div></a></li><li aria-label="Introducing Joy of Rails" role="option" id="search-option_search_result_articles-joy-of-rails" class="rounded"><a href="/articles/joy-of-rails"><div>Introducing Joy of Rails</div><div>Rails is a web application framework</div></a></li></ul></div>
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.

Loading