@@ -66,6 +66,23 @@ static VALUE rb_sqlite3_open_v2(VALUE self, VALUE file, VALUE mode, VALUE zvfs)
6666 return self ;
6767}
6868
69+ static VALUE rb_sqlite3_disable_quirk_mode (VALUE self )
70+ {
71+ #if defined SQLITE_DBCONFIG_DQS_DDL
72+ sqlite3RubyPtr ctx ;
73+ Data_Get_Struct (self , sqlite3Ruby , ctx );
74+
75+ if (!ctx -> db ) return Qfalse ;
76+
77+ sqlite3_db_config (ctx -> db , SQLITE_DBCONFIG_DQS_DDL , 0 , (void * )0 );
78+ sqlite3_db_config (ctx -> db , SQLITE_DBCONFIG_DQS_DML , 0 , (void * )0 );
79+
80+ return Qtrue ;
81+ #else
82+ return Qfalse
83+ #endif
84+ }
85+
6986/* call-seq: db.close
7087 *
7188 * Closes this database.
@@ -805,6 +822,7 @@ void init_sqlite3_database()
805822 /* public "define_aggregator" is now a shim around define_aggregator2
806823 * implemented in Ruby */
807824 rb_define_private_method (cSqlite3Database , "define_aggregator2" , rb_sqlite3_define_aggregator2 , 2 );
825+ rb_define_private_method (cSqlite3Database , "disable_quirk_mode" , rb_sqlite3_disable_quirk_mode , 0 );
808826 rb_define_method (cSqlite3Database , "interrupt" , interrupt , 0 );
809827 rb_define_method (cSqlite3Database , "errmsg" , errmsg , 0 );
810828 rb_define_method (cSqlite3Database , "errcode" , errcode_ , 0 );
0 commit comments