Module: SQLite::Pragmas

### Home Classes Methods

### In Files

- lib/sqlite/pragmas.rb

### Methods

- #cache_size
- #cache_size=
- #database_list
- #default_cache_size
- #default_cache_size=
- #default_synchronous
- #default_synchronous=
- #default_temp_store
- #default_temp_store=
- #foreign_key_list
- #full_column_names
- #full_column_names=
- #index_info
- #index_list
- #integrity_check
- #parser_trace
- #parser_trace=
- #synchronous
- #synchronous=
- #table_info
- #temp_store
- #temp_store=
- #vdbe_trace
- #vdbe_trace=

### Files

- README

### Class/Module Index

Quicksearch

- SQLite
- SQLite::API
- SQLite::Database
- SQLite::Database::FunctionProxy
- SQLite::Exceptions
- SQLite::Exceptions::AbortException
- SQLite::Exceptions::AuthorizationException
- SQLite::Exceptions::BusyException
- SQLite::Exceptions::CantOpenException
- SQLite::Exceptions::ConstraintException
- SQLite::Exceptions::CorruptException
- SQLite::Exceptions::DatabaseException
- SQLite::Exceptions::EmptyException
- SQLite::Exceptions::FormatException
- SQLite::Exceptions::FullException
- SQLite::Exceptions::IOErrorException
- SQLite::Exceptions::InternalException
- SQLite::Exceptions::InterruptException
- SQLite::Exceptions::LockedException
- SQLite::Exceptions::MismatchException
- SQLite::Exceptions::MisuseException
- SQLite::Exceptions::NotADatabaseException
- SQLite::Exceptions::NotFoundException
- SQLite::Exceptions::OutOfMemoryException
- SQLite::Exceptions::PermissionsException
- SQLite::Exceptions::ProtocolException
- SQLite::Exceptions::RangeException
- SQLite::Exceptions::ReadOnlyException
- SQLite::Exceptions::SQLException
- SQLite::Exceptions::SchemaChangedException
- SQLite::Exceptions::TooBigException
- SQLite::Exceptions::UnsupportedOSFeatureException
- SQLite::ParsedStatement
- SQLite::Pragmas
- SQLite::ResultSet
- SQLite::ResultSet::FieldsContainer
- SQLite::ResultSet::TypesContainer
- SQLite::Statement
- SQLite::Translator
- SQLite::Version

No matching classes.

# SQLite::Pragmas

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.

### Constants

SYNCHRONOUS_MODES

  The enumeration of valid synchronous modes.

TEMP_STORE_MODES

  The enumeration of valid temp store modes.

### Public Instance Methods

cache_size() click to toggle source

    # File lib/sqlite/pragmas.rb, line 142
    def cache_size
      get_int_pragma "cache_size"
    end

cache_size=( size ) click to toggle source

    # File lib/sqlite/pragmas.rb, line 146
    def cache_size=( size )
      set_int_pragma "cache_size", size
    end

database_list( ) click to toggle source

    # File lib/sqlite/pragmas.rb, line 214
    def database_list( &block ) # :yields: row
      get_query_pragma "database_list", &block
    end

default_cache_size() click to toggle source

    # File lib/sqlite/pragmas.rb, line 150
    def default_cache_size
      get_int_pragma "default_cache_size"
    end

default_cache_size=( size ) click to toggle source

    # File lib/sqlite/pragmas.rb, line 154
    def default_cache_size=( size )
      set_int_pragma "default_cache_size", size
    end

default_synchronous() click to toggle source

    # File lib/sqlite/pragmas.rb, line 158
    def default_synchronous
      get_enum_pragma "default_synchronous"
    end

default_synchronous=( mode ) click to toggle source

    # File lib/sqlite/pragmas.rb, line 162
    def default_synchronous=( mode )
      set_enum_pragma "default_synchronous", mode, SYNCHRONOUS_MODES
    end

default_temp_store() click to toggle source

    # File lib/sqlite/pragmas.rb, line 174
    def default_temp_store
      get_enum_pragma "default_temp_store"
    end

default_temp_store=( mode ) click to toggle source

    # File lib/sqlite/pragmas.rb, line 178
    def default_temp_store=( mode )
      set_enum_pragma "default_temp_store", mode, TEMP_STORE_MODES
    end

foreign_key_list( table ) click to toggle source

    # File lib/sqlite/pragmas.rb, line 218
    def foreign_key_list( table, &block ) # :yields: row
      get_query_pragma "foreign_key_list", table, &block
    end

full_column_names() click to toggle source

    # File lib/sqlite/pragmas.rb, line 190
    def full_column_names
      get_boolean_pragma "full_column_names"
    end

full_column_names=( mode ) click to toggle source

    # File lib/sqlite/pragmas.rb, line 194
    def full_column_names=( mode )
      set_boolean_pragma "full_column_names", mode
    end

index_info( index ) click to toggle source

    # File lib/sqlite/pragmas.rb, line 222
    def index_info( index, &block ) # :yields: row
      get_query_pragma "index_info", index, &block
    end

index_list( table ) click to toggle source

    # File lib/sqlite/pragmas.rb, line 226
    def index_list( table, &block ) # :yields: row
      get_query_pragma "index_list", table, &block
    end

integrity_check() click to toggle source

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

parser_trace() click to toggle source

    # File lib/sqlite/pragmas.rb, line 198
    def parser_trace
      get_boolean_pragma "parser_trace"
    end

parser_trace=( mode ) click to toggle source

    # File lib/sqlite/pragmas.rb, line 202
    def parser_trace=( mode )
      set_boolean_pragma "parser_trace", mode
    end

synchronous() click to toggle source

    # File lib/sqlite/pragmas.rb, line 166
    def synchronous
      get_enum_pragma "synchronous"
    end

synchronous=( mode ) click to toggle source

    # File lib/sqlite/pragmas.rb, line 170
    def synchronous=( mode )
      set_enum_pragma "synchronous", mode, SYNCHRONOUS_MODES
    end

table_info( table ) click to toggle source

    # File lib/sqlite/pragmas.rb, line 230
    def table_info( table, &block ) # :yields: row
      get_query_pragma "table_info", table, &block
    end

temp_store() click to toggle source

    # File lib/sqlite/pragmas.rb, line 182
    def temp_store
      get_enum_pragma "temp_store"
    end

temp_store=( mode ) click to toggle source

    # File lib/sqlite/pragmas.rb, line 186
    def temp_store=( mode )
      set_enum_pragma "temp_store", mode, TEMP_STORE_MODES
    end

vdbe_trace() click to toggle source

    # File lib/sqlite/pragmas.rb, line 206
    def vdbe_trace
      get_boolean_pragma "vdbe_trace"
    end

vdbe_trace=( mode ) click to toggle source

    # File lib/sqlite/pragmas.rb, line 210
    def vdbe_trace=( mode )
      set_boolean_pragma "vdbe_trace", mode
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.