This module is intended for inclusion solely by the Database class. It defines convenience methods for the various pragmas supported by SQLite.
Two pragmas that have been intentionally excluded are SHOW_DATATYPES and EMPTY_RESULT_SETS, since these apply only to queries that use the SQLite "exec" function. The SQLite API does not employ that function, preferring instead the compile/step/finalize interface.
However, if you really must have those pragmas, you can always execute a pragma as if it were an SQL statement.
For a detailed description of these pragmas, see the SQLite documentation at sqlite.org/lang.html#pragma.
The enumeration of valid synchronous modes.
The enumeration of valid temp store modes.
# File lib/sqlite/pragmas.rb, line 142 def cache_size get_int_pragma "cache_size" end
# File lib/sqlite/pragmas.rb, line 146 def cache_size=( size ) set_int_pragma "cache_size", size end
# File lib/sqlite/pragmas.rb, line 214 def database_list( &block ) # :yields: row get_query_pragma "database_list", &block end
# File lib/sqlite/pragmas.rb, line 150 def default_cache_size get_int_pragma "default_cache_size" end
# File lib/sqlite/pragmas.rb, line 154 def default_cache_size=( size ) set_int_pragma "default_cache_size", size end
# File lib/sqlite/pragmas.rb, line 158 def default_synchronous get_enum_pragma "default_synchronous" end
# File lib/sqlite/pragmas.rb, line 162 def default_synchronous=( mode ) set_enum_pragma "default_synchronous", mode, SYNCHRONOUS_MODES end
# File lib/sqlite/pragmas.rb, line 174 def default_temp_store get_enum_pragma "default_temp_store" end
# File lib/sqlite/pragmas.rb, line 178 def default_temp_store=( mode ) set_enum_pragma "default_temp_store", mode, TEMP_STORE_MODES end
# File lib/sqlite/pragmas.rb, line 218 def foreign_key_list( table, &block ) # :yields: row get_query_pragma "foreign_key_list", table, &block end
# File lib/sqlite/pragmas.rb, line 190 def full_column_names get_boolean_pragma "full_column_names" end
# File lib/sqlite/pragmas.rb, line 194 def full_column_names=( mode ) set_boolean_pragma "full_column_names", mode end
# File lib/sqlite/pragmas.rb, line 222 def index_info( index, &block ) # :yields: row get_query_pragma "index_info", index, &block end
# File lib/sqlite/pragmas.rb, line 226 def index_list( table, &block ) # :yields: row get_query_pragma "index_list", table, &block end
Does an integrity check on the database. If the check fails, a SQLite::Exceptions::DatabaseException will be raised. Otherwise it returns silently.
# File lib/sqlite/pragmas.rb, line 136 def integrity_check execute( "PRAGMA integrity_check" ) do |row| raise Exceptions::DatabaseException, row[0] if row[0] != "ok" end end
# File lib/sqlite/pragmas.rb, line 198 def parser_trace get_boolean_pragma "parser_trace" end
# File lib/sqlite/pragmas.rb, line 202 def parser_trace=( mode ) set_boolean_pragma "parser_trace", mode end
# File lib/sqlite/pragmas.rb, line 166 def synchronous get_enum_pragma "synchronous" end
# File lib/sqlite/pragmas.rb, line 170 def synchronous=( mode ) set_enum_pragma "synchronous", mode, SYNCHRONOUS_MODES end
# File lib/sqlite/pragmas.rb, line 230 def table_info( table, &block ) # :yields: row get_query_pragma "table_info", table, &block end
# File lib/sqlite/pragmas.rb, line 182 def temp_store get_enum_pragma "temp_store" end
# File lib/sqlite/pragmas.rb, line 186 def temp_store=( mode ) set_enum_pragma "temp_store", mode, TEMP_STORE_MODES end
Generated with the Darkfish Rdoc Generator 2.