Module: SQLite3::Pragmas

Module SQLite3::Pragmas |
In: | lib/sqlite3/pragmas.rb

This module is intended for inclusion solely by the Database class. It defines convenience methods for the various pragmas supported by SQLite3.

For a detailed description of these pragmas, see the SQLite3 documentation at sqlite.org/pragma.html.

Methods

- auto_vacuum
- auto_vacuum=
- 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=
- schema_cookie
- schema_cookie=
- synchronous
- synchronous=
- table_info
- temp_store
- temp_store=
- user_cookie
- user_cookie=
- vdbe_trace
- vdbe_trace=

Constants

SYNCHRONOUS_MODES | = | [ [ 'full', 2 ], [ 'normal', 1 ], [ 'off', 0 ] ]
| The enumeration of valid synchronous modes.
TEMP_STORE_MODES | = | [ [ 'default', 0 ], [ 'file', 1 ], [ 'memory', 2 ] ]
| The enumeration of valid temp store modes.

Public Instance methods
auto_vacuum()

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 136
    136:     def auto_vacuum
    137:       get_boolean_pragma "auto_vacuum"
    138:     end

auto_vacuum=( mode )

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 140
    140:     def auto_vacuum=( mode )
    141:       set_boolean_pragma "auto_vacuum", mode
    142:     end

cache_size()

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 160
    160:     def cache_size
    161:       get_int_pragma "cache_size"
    162:     end

cache_size=( size )

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 164
    164:     def cache_size=( size )
    165:       set_int_pragma "cache_size", size
    166:     end

database_list( ) {|row| ...}

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 232
    232:     def database_list( &block ) # :yields: row
    233:       get_query_pragma "database_list", &block
    234:     end

default_cache_size()

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 168
    168:     def default_cache_size
    169:       get_int_pragma "default_cache_size"
    170:     end

default_cache_size=( size )

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 172
    172:     def default_cache_size=( size )
    173:       set_int_pragma "default_cache_size", size
    174:     end

default_synchronous()

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 176
    176:     def default_synchronous
    177:       get_enum_pragma "default_synchronous"
    178:     end

default_synchronous=( mode )

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 180
    180:     def default_synchronous=( mode )
    181:       set_enum_pragma "default_synchronous", mode, SYNCHRONOUS_MODES
    182:     end

default_temp_store()

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 192
    192:     def default_temp_store
    193:       get_enum_pragma "default_temp_store"
    194:     end

default_temp_store=( mode )

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 196
    196:     def default_temp_store=( mode )
    197:       set_enum_pragma "default_temp_store", mode, TEMP_STORE_MODES
    198:     end

foreign_key_list( table ) {|row| ...}

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 236
    236:     def foreign_key_list( table, &block ) # :yields: row
    237:       get_query_pragma "foreign_key_list", table, &block
    238:     end

full_column_names()

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 208
    208:     def full_column_names
    209:       get_boolean_pragma "full_column_names"
    210:     end

full_column_names=( mode )

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 212
    212:     def full_column_names=( mode )
    213:       set_boolean_pragma "full_column_names", mode
    214:     end

index_info( index ) {|row| ...}

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 240
    240:     def index_info( index, &block ) # :yields: row
    241:       get_query_pragma "index_info", index, &block
    242:     end

index_list( table ) {|row| ...}

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 244
    244:     def index_list( table, &block ) # :yields: row
    245:       get_query_pragma "index_list", table, &block
    246:     end

integrity_check()

Does an integrity check on the database. If the check fails, a SQLite3::Exception will be raised. Otherwise it returns silently.

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 130
    130:     def integrity_check
    131:       execute( "PRAGMA integrity_check" ) do |row|
    132:         raise Exception, row[0] if row[0] != "ok"
    133:       end
    134:     end

parser_trace()

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 216
    216:     def parser_trace
    217:       get_boolean_pragma "parser_trace"
    218:     end

parser_trace=( mode )

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 220
    220:     def parser_trace=( mode )
    221:       set_boolean_pragma "parser_trace", mode
    222:     end

schema_cookie()

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 144
    144:     def schema_cookie
    145:       get_int_pragma "schema_cookie"
    146:     end

schema_cookie=( cookie )

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 148
    148:     def schema_cookie=( cookie )
    149:       set_int_pragma "schema_cookie", cookie
    150:     end

synchronous()

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 184
    184:     def synchronous
    185:       get_enum_pragma "synchronous"
    186:     end

synchronous=( mode )

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 188
    188:     def synchronous=( mode )
    189:       set_enum_pragma "synchronous", mode, SYNCHRONOUS_MODES
    190:     end

table_info( table ) {|row| ...}

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 248
    248:     def table_info( table, &block ) # :yields: row
    249:       get_query_pragma "table_info", table, &block
    250:     end

temp_store()

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 200
    200:     def temp_store
    201:       get_enum_pragma "temp_store"
    202:     end

temp_store=( mode )

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 204
    204:     def temp_store=( mode )
    205:       set_enum_pragma "temp_store", mode, TEMP_STORE_MODES
    206:     end

user_cookie()

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 152
    152:     def user_cookie
    153:       get_int_pragma "user_cookie"
    154:     end

user_cookie=( cookie )

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 156
    156:     def user_cookie=( cookie )
    157:       set_int_pragma "user_cookie", cookie
    158:     end

vdbe_trace()

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 224
    224:     def vdbe_trace
    225:       get_boolean_pragma "vdbe_trace"
    226:     end

vdbe_trace=( mode )

[ show source ]

         # File lib/sqlite3/pragmas.rb, line 228
    228:     def vdbe_trace=( mode )
    229:       set_boolean_pragma "vdbe_trace", mode
    230:     end

[Validate]