Module: MDB

Extended by:
FFI::Library
Includes:
FFIHelpers
Defined in:
lib/mdb.rb,
lib/mdbsql.rb

Defined Under Namespace

Modules: SQL Classes: BoundLength, BoundValue, MdbAny, MdbBackend, MdbBackendType, MdbCatalogEntry, MdbColumn, MdbFile, MdbFormatConstants, MdbHandle, MdbIndex, MdbIndexChain, MdbIndexPage, MdbProperties, MdbSargNode, MdbStatistics, MdbTableDef, PtrArray

Constant Summary collapse

BIND_SIZE =
16384
MAX_IDX_COLS =
10
MAX_INDEX_DEPTH =
10
MAX_OBJ_NAME =
256
MEMO_OVERHEAD =
12
PGSIZE =
4096
SHEXP_DROPTABLE =
1<<0
SHEXP_CST_NOTNULL =
1<<1
SHEXP_CST_NOTEMPTY =
1<<2
SHEXP_COMMENTS =
1<<3
SHEXP_DEFVALUES =
1<<4
SHEXP_INDEXES =
1<<5
SHEXP_RELATIONS =
1<<6
SHEXP_DEFAULT =
SHEXP_CST_NOTNULL | SHEXP_COMMENTS | SHEXP_INDEXES | SHEXP_RELATIONS

Class Method Summary collapse

Methods included from FFIHelpers

included

Class Method Details

.mdb_ole_read_full(handle, column, length) ⇒ Object

some older versions of mdbtools that are distributed with Ubuntu are missing this method



321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/mdb.rb', line 321

def self.mdb_ole_read_full(handle, column, length)
  ole_ptr = FFI::MemoryPointer.new(:char, MEMO_OVERHEAD)

 ole_ptr = col[:bind_ptr]

 len = mdb_ole_read(mdb, col, ole_ptr, BIND_SIZE)
 result = col[:bind_ptr].read_string
 while (mdb_ole_read_next(mdb, col, ole_ptr) != 0 ) do
  result += col[:bind_ptr].read_string
 end
 result
end