<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -324,38 +324,32 @@ static VALUE typecast(sqlite3_stmt *stmt, int i, VALUE ruby_class) {
 
 #define FLAG_PRESENT(query_values, flag) !NIL_P(rb_hash_aref(query_values, flag))
 
-static int cConnection_flags_from_uri(VALUE uri) {
+static int flags_from_uri(VALUE uri) {
   VALUE query_values = rb_funcall(uri, ID_QUERY_VALUES, 0);
-  
+
   int flags = 0;
   if (!NIL_P(query_values)) {
     /// scan for flags
     if (FLAG_PRESENT(query_values, OPEN_FLAG_READONLY)) {
       flags |= SQLITE_OPEN_READONLY;
-    } 
+    }
     if (FLAG_PRESENT(query_values, OPEN_FLAG_READWRITE)) {
       flags |= SQLITE_OPEN_READWRITE;
-    } 
+    }
     if (FLAG_PRESENT(query_values, OPEN_FLAG_CREATE)) {
       flags |= SQLITE_OPEN_CREATE;
-    } 
+    }
     if (FLAG_PRESENT(query_values, OPEN_FLAG_NO_MUTEX)) {
       flags |= SQLITE_OPEN_NOMUTEX;
-    } 
+    }
     if (FLAG_PRESENT(query_values, OPEN_FLAG_FULL_MUTEX)) {
       flags |= SQLITE_OPEN_FULLMUTEX;
-    } 
-    
+    }
   } else {
     flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE;
   }
-  
-  return  flags;
-}
 
-static VALUE cConnection_open_v2(VALUE self, VALUE path, VALUE uri, sqlite3 **db) {
-  int flags = cConnection_flags_from_uri(uri);
-  return sqlite3_open_v2(StringValuePtr(path), db, flags, 0);
+  return flags;
 }
 
 #endif
@@ -366,12 +360,15 @@ static VALUE cConnection_initialize(VALUE self, VALUE uri) {
   int ret;
   VALUE path;
   sqlite3 *db;
-  
+  int flags = 0;
+
   path = rb_funcall(uri, ID_PATH, 0);
 
 #ifdef HAVE_SQLITE3_OPEN_V2
-  ret = cConnection_open_v2(self, path, uri, &amp;db);
+  flags = flags_from_uri(uri);
+  ret = sqlite3_open_v2(StringValuePtr(path), &amp;db, flags, 0);
 #else
+  printf(&quot;Kiekeboe\n&quot;);
   ret = sqlite3_open(StringValuePtr(path), &amp;db);
 #endif
 
@@ -581,10 +578,6 @@ static VALUE cReader_row_count(VALUE self) {
   return rb_iv_get(self, &quot;@row_count&quot;);
 }
 
-static VALUE mSqlite3_sqlite_version(VALUE self) {
-  return rb_str_new2(sqlite3_libversion());
-}
-
 void Init_do_sqlite3_ext() {
   rb_require(&quot;bigdecimal&quot;);
   rb_require(&quot;date&quot;);
@@ -617,9 +610,7 @@ void Init_do_sqlite3_ext() {
 
   // Initialize the DataObjects::Sqlite3 module, and define its classes
   mSqlite3 = rb_define_module_under(mDO, &quot;Sqlite3&quot;);
-  puts(&quot;hi&quot;);
-  rb_define_singleton_method(mSqlite3, &quot;sqlite3_version&quot;, mSqlite3_sqlite_version, 0);
-  
+
   eSqlite3Error = rb_define_class(&quot;Sqlite3Error&quot;, rb_eStandardError);
 
   cConnection = SQLITE3_CLASS(&quot;Connection&quot;, cDO_Connection);</diff>
      <filename>do_sqlite3/ext/do_sqlite3_ext/do_sqlite3_ext.c</filename>
    </modified>
    <modified>
      <diff>@@ -36,10 +36,7 @@ end
 # create_makefile(extension_name)
 if have_header( &quot;sqlite3.h&quot; ) &amp;&amp; have_library( &quot;sqlite3&quot;, &quot;sqlite3_open&quot; )
   have_func(&quot;sqlite3_prepare_v2&quot;)
-  
-  if (have_func(&quot;sqlite3_open_v2&quot;))
-    puts &quot;Using sqlite3_open_v2&quot;
-  end
-  
+  have_func(&quot;sqlite3_open_v2&quot;)
+
   create_makefile(extension_name)
 end</diff>
      <filename>do_sqlite3/ext/do_sqlite3_ext/extconf.rb</filename>
    </modified>
    <modified>
      <diff>@@ -17,26 +17,15 @@ describe &quot;DataObjects::Sqlite3&quot; do
     end
   end
 
-  unless JRUBY
-    it &quot;should provide the sqlite3 version&quot; do
-      lambda {DataObjects::Sqlite3.sqlite3_version}.should_not raise_error
-      
-      DataObjects::Sqlite3.sqlite3_version.should match(/^3\.\d+(\.\d+)?/)
-    end
-  end
 end
 
 describe &quot;DataObjects::Sqlite3, open flags&quot; do
   include Sqlite3SpecHelpers
-  
+
   url = &quot;sqlite3://#{File.expand_path(File.dirname(__FILE__))}/ro_test.db&quot;
   ro_url = url + &quot;?read_only=true&quot;
 
-  
-  minor_version = DataObjects::Sqlite3.sqlite3_version.split(/\./)[1].to_i
-  
-  
-  unless JRUBY 
+  unless JRUBY
     before(:all) do
       @connection = DataObjects::Connection.new(url)
 
@@ -49,24 +38,15 @@ describe &quot;DataObjects::Sqlite3, open flags&quot; do
       insert(&quot;INSERT INTO users VALUES (1, 'A dummy user')&quot;)
       @connection.close
     end
-    
-    unless minor_version &lt; 5
-    
-      it &quot;should open a database in readonly mode if sqlite_open_v2 is available&quot; do
-        @connection = DataObjects::Connection.new(ro_url)
-        
-        lambda {insert(&quot;insert into users (2, 'not allowed dummy')&quot;)}.should raise_error
-        
-        @connection.close
-      end
-    else
-      it &quot;should ignore the ...open_v2 flags if sqlite version is not sufficient&quot; do
-        @connection = DataObjects::Connection.new(ro_url)
 
-        lambda {insert(&quot;INSERT INTO users VALUES (2, 'Allowed to')&quot;)}.should_not raise_error
-        @connection.close
-      end
-    end      
+    it &quot;should open a database in readonly mode if sqlite_open_v2 is available&quot; do
+      pending 'Client / Server versions available through the DO API'
+      @connection = DataObjects::Connection.new(ro_url)
+
+      lambda {insert(&quot;INSERT INTO users VALUES (2, 'not allowed dummy')&quot;)}.should raise_error
+
+      @connection.close
+    end
   end
 end
 </diff>
      <filename>do_sqlite3/spec/integration/do_sqlite3_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8da07d9341b3f05c7f40fe0affaa5e510a0b5ba8</id>
    </parent>
  </parents>
  <author>
    <name>Dirkjan Bussink</name>
    <email>d.bussink@gmail.com</email>
  </author>
  <url>http://github.com/sam/do/commit/b826a514375914546d4d910584be2683a84b1c0a</url>
  <id>b826a514375914546d4d910584be2683a84b1c0a</id>
  <committed-date>2009-01-25T11:19:44-08:00</committed-date>
  <authored-date>2009-01-25T11:18:05-08:00</authored-date>
  <message>Cleanup do_sqlite3 usage of open_v2

Renamed the methods because they are not part of the public API.
Also removed the sqlite3_version method, because DO should have a
more general API for retrieving client / server version numbers.</message>
  <tree>7aca302f3583cbb511fd821cf392f01a2cc490df</tree>
  <committer>
    <name>Dirkjan Bussink</name>
    <email>d.bussink@gmail.com</email>
  </committer>
</commit>
