From d5acdc2c4251f6d46baec61f940d2f66eb73a5d9 Mon Sep 17 00:00:00 2001 From: Travis Tilley Date: Tue, 9 Feb 2010 10:50:51 +0100 Subject: [PATCH] added extension suppor to API --- lib/sqlite3/api.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/sqlite3/api.rb b/lib/sqlite3/api.rb index 662eddc..d4041df 100644 --- a/lib/sqlite3/api.rb +++ b/lib/sqlite3/api.rb @@ -40,5 +40,13 @@ module API attach_function :sqlite3_prepare, [:pointer, :string, :int, :pointer, :pointer], :int attach_function :sqlite3_reset, [:pointer], :int attach_function :sqlite3_step, [:pointer], :int + + begin + attach_function :sqlite3_enable_load_extension, [:pointer, :int], :int + attach_function :sqlite3_load_extension, [:pointer, :string, :string, :string], :int + EXTENSION_SUPPORT = true + rescue FFI::NotFoundError + EXTENSION_SUPPORT = false + end end end