Replies: 1 comment 2 replies
-
You appear to be loading an extension into a different SQLite 3 database object than the one Sequel uses. Try: DB = Sequel.sqlite('/data/abn/abn.db',
after_connect: proc do|db|
db.enable_load_extension(true)
db.load_extension('./sqlite/regexp.so')
end
) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am trying to load a sqlite3 extension (sqlean regexp), but did not succeed at all.
Desperately, I even tried the folowing (hoping that sequels 'require sqlite3' would be a noop), but alas.
#!/bin/ruby
require 'sqlite3'
def sqlt
db = SQLite3::Database.open 'abn.db'
db.enable_load_extension(true)
db.load_extension('./sqlite/regexp.so')
pp db.execute("select regexp_like('abcdef', 'b.d')")
end
sqlt
require "sequel"
DB = Sequel.sqlite('/data/abn/abn.db')
Items = DB[:main]
sqlt
pp Items.select{regexp_like(:naam, '^BEL')}.all
Result:
[[1]]
[[1]]
/usr/local/share/gems/gems/sqlite3-2.6.0-x86_64-linux-gnu/lib/sqlite3/statement.rb:36:in `prepare': SQLite3::SQLException: no such function: regexp_like: (Sequel::DatabaseError)
I could find no documentation or anyone trying to do the same.
Cheers,
Han Holl
Beta Was this translation helpful? Give feedback.
All reactions