Merge 'CREATE TABLE support' from Pekka Enberg

Closes #383
This commit is contained in:
Pere Diaz Bou 2024-11-18 13:40:20 +01:00
commit 9c4ca28bd9
10 changed files with 431 additions and 58 deletions

View file

@ -875,6 +875,42 @@ pub fn insn_to_str(
0,
format!("r[{}]=r[{}]", dst_reg, src_reg),
),
Insn::CreateBtree { db, root, flags } => (
"CreateBtree",
*db as i32,
*root as i32,
*flags as i32,
OwnedValue::Text(Rc::new("".to_string())),
0,
format!("r[{}]=root iDb={} flags={}", root, db, flags),
),
Insn::Close { cursor_id } => (
"Close",
*cursor_id as i32,
0,
0,
OwnedValue::Text(Rc::new("".to_string())),
0,
"".to_string(),
),
Insn::IsNull { src, target_pc } => (
"IsNull",
*src as i32,
*target_pc as i32,
0,
OwnedValue::Text(Rc::new("".to_string())),
0,
format!("if (r[{}]==NULL) goto {}", src, target_pc),
),
Insn::ParseSchema { db, where_clause } => (
"ParseSchema",
*db as i32,
0,
0,
OwnedValue::Text(Rc::new(where_clause.clone())),
0,
where_clause.clone(),
),
};
format!(
"{:<4} {:<17} {:<4} {:<4} {:<4} {:<13} {:<2} {}",