type = 'sqlite';
$params->file = $path;
$params->host = 'localhost';
$params->prefix = 'create_';
$this->db = Query($params);
// echo '
SQLite Queries
';
}
// --------------------------------------------------------------------------
public function TestInsertBatch()
{
if (empty($this->db)) return;
$insert_array = array(
array(
'id' => 6,
'key' => 2,
'val' => 3
),
array(
'id' => 5,
'key' => 6,
'val' => 7
),
array(
'id' => 8,
'key' => 1,
'val' => 2
)
);
$query = $this->db->insert_batch('test', $insert_array);
$this->assertNull($query);
}
// --------------------------------------------------------------------------
public function testQueryExplain()
{
$query = $this->db->select('id, key as k, val')
->explain()
->where('id >', 1)
->where('id <', 900)
->get('create_test', 2, 1);
$res = $query->fetchAll(PDO::FETCH_ASSOC);
var_export($res);
$expected = array (
array (
'selectid' => '0',
'order' => '0',
'from' => '0',
'detail' => 'SEARCH TABLE create_test USING INTEGER PRIMARY KEY (rowid>? AND rowid)',
),
);
//$this->assertEqual($expected, $res);
}
}