Module: SQLite3
Constant Summary
-
SQLITE_LOADED_VERSION =
# File 'ext/sqlite3/sqlite3.c', line 212
(String) The version of the sqlite3 library loaded at runtime (e.g., “3.46.1”)
rb_str_new2(sqlite3_libversion())
-
SQLITE_PACKAGED_LIBRARIES =
# File 'ext/sqlite3/sqlite3.c', line 215Qtrue -
SQLITE_PRECOMPILED_LIBRARIES =
# File 'ext/sqlite3/sqlite3.c', line 221Qtrue -
SQLITE_VERSION =
# File 'ext/sqlite3/sqlite3.c', line 206
(String) The version of the sqlite3 library compiled with (e.g., “3.46.1”)
rb_str_new2(SQLITE_VERSION)
-
SQLITE_VERSION_NUMBER =
# File 'ext/sqlite3/sqlite3.c', line 209
(Integer) The version of the sqlite3 library compiled with (e.g., 346001)
INT2FIX(SQLITE_VERSION_NUMBER)
-
VERSION =
# File 'lib/sqlite3/version.rb', line 3
(String) the version of the sqlite3 gem, e.g. “2.1.1”
"2.8.0" -
VERSION_INFO =
# File 'lib/sqlite3/version_info.rb', line 3
a hash of descriptive metadata about the current version of the sqlite3 gem
{ ruby: RUBY_DESCRIPTION, gem: { version: SQLite3::VERSION }, sqlite: { compiled: SQLite3::SQLITE_VERSION, loaded: SQLite3::SQLITE_LOADED_VERSION, packaged: SQLite3::SQLITE_PACKAGED_LIBRARIES, precompiled: SQLite3::SQLITE_PRECOMPILED_LIBRARIES, sqlcipher: SQLite3.sqlcipher?, threadsafe: SQLite3.threadsafe? } }
Class Attribute Summary
- .sqlcipher? ⇒ Boolean readonly
-
.threadsafe
readonly
Returns the compile time setting of the SQLITE_THREADSAFE flag.
-
.threadsafe? ⇒ Boolean
readonly
Was sqlite3 compiled with thread safety on?
Class Method Summary
- .libversion
-
.status(parameter) → Hash)
Queries the
SQLite3library for run-time status information.
Class Attribute Details
.sqlcipher? ⇒ Boolean (readonly)
[ GitHub ]
# File 'ext/sqlite3/sqlite3.c', line 69
static VALUE
using_sqlcipher(VALUE UNUSED(klass))
{
#ifdef USING_SQLCIPHER
return Qtrue;
#else
return Qfalse;
#endif
}
.threadsafe (readonly)
Returns the compile time setting of the SQLITE_THREADSAFE flag. See: www.sqlite.org/c3ref/threadsafe.html
# File 'ext/sqlite3/sqlite3.c', line 82
static VALUE
threadsafe_p(VALUE UNUSED(klass))
{
return INT2NUM(sqlite3_threadsafe());
}
.threadsafe? ⇒ Boolean (readonly)
Was sqlite3 compiled with thread safety on?
# File 'lib/sqlite3.rb', line 14
def self.threadsafe? threadsafe > 0 end
Class Method Details
.libversion
[ GitHub ]# File 'ext/sqlite3/sqlite3.c', line 63
static VALUE
libversion(VALUE UNUSED(klass))
{
return INT2NUM(sqlite3_libversion_number());
}
.status(parameter) → Hash)
.status(parameter, reset_flag = false) → Hash)
Queries the SQLite3 library for run-time status information. Passing a truthy reset_flag will reset the highwater mark to the current value.
- Parameters
-
parameter(Integer,::SQLite3::Constants::Status): The status parameter to query. -
reset_flag(Boolean): Whether to reset the highwater mark. (default isfalse)
- Returns
-
A Hash containing
:currentand:highwaterkeys for integer values.
# File 'ext/sqlite3/sqlite3.c', line 103
static VALUE
rb_sqlite3_status(int argc, VALUE *argv, VALUE klass)
{
VALUE opArg, resetFlagArg;
rb_scan_args(argc, argv, "11", &opArg, &resetFlagArg);
int op = NUM2INT(opArg);
bool resetFlag = RTEST(resetFlagArg);
int pCurrent = 0;
int pHighwater = 0;
sqlite3_status(op, &pCurrent, &pHighwater, resetFlag);
VALUE hash = rb_hash_new();
rb_hash_aset(hash, ID2SYM(rb_intern("current")), INT2FIX(pCurrent));
rb_hash_aset(hash, ID2SYM(rb_intern("highwater")), INT2FIX(pHighwater));
return hash;
}