mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-05 01:04:22 +01:00
Merge pull request #142 from imor/clippy_fixes
This commit is contained in:
@@ -171,7 +171,7 @@ fn display_schema(
|
||||
Ok(Some(ref mut rows)) => {
|
||||
let mut found = false;
|
||||
loop {
|
||||
match rows.next()? {
|
||||
match rows.next_row()? {
|
||||
RowResult::Row(row) => {
|
||||
if let Some(Value::Text(schema)) = row.values.first() {
|
||||
println!("{};", schema);
|
||||
@@ -216,7 +216,7 @@ fn query(
|
||||
match conn.query(sql) {
|
||||
Ok(Some(ref mut rows)) => match output_mode {
|
||||
OutputMode::Raw => loop {
|
||||
match rows.next()? {
|
||||
match rows.next_row()? {
|
||||
RowResult::Row(row) => {
|
||||
for (i, value) in row.values.iter().enumerate() {
|
||||
if i > 0 {
|
||||
@@ -241,7 +241,7 @@ fn query(
|
||||
OutputMode::Pretty => {
|
||||
let mut table_rows: Vec<Vec<_>> = vec![];
|
||||
loop {
|
||||
match rows.next()? {
|
||||
match rows.next_row()? {
|
||||
RowResult::Row(row) => {
|
||||
table_rows.push(
|
||||
row.values
|
||||
|
||||
@@ -16,7 +16,7 @@ fn bench(c: &mut Criterion) {
|
||||
let io = io.clone();
|
||||
b.iter(|| {
|
||||
let mut rows = stmt.query().unwrap();
|
||||
match rows.next().unwrap() {
|
||||
match rows.next_row().unwrap() {
|
||||
limbo_core::RowResult::Row(row) => {
|
||||
assert_eq!(row.get::<i64>(0).unwrap(), 1);
|
||||
}
|
||||
@@ -38,7 +38,7 @@ fn bench(c: &mut Criterion) {
|
||||
let io = io.clone();
|
||||
b.iter(|| {
|
||||
let mut rows = stmt.query().unwrap();
|
||||
match rows.next().unwrap() {
|
||||
match rows.next_row().unwrap() {
|
||||
limbo_core::RowResult::Row(row) => {
|
||||
assert_eq!(row.get::<i64>(0).unwrap(), 1);
|
||||
}
|
||||
@@ -61,7 +61,7 @@ fn bench(c: &mut Criterion) {
|
||||
let io = io.clone();
|
||||
b.iter(|| {
|
||||
let mut rows = stmt.query().unwrap();
|
||||
match rows.next().unwrap() {
|
||||
match rows.next_row().unwrap() {
|
||||
limbo_core::RowResult::Row(row) => {
|
||||
assert_eq!(row.get::<i64>(0).unwrap(), 1);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use super::{Completion, File, WriteCompletion, IO};
|
||||
use anyhow::{Ok, Result};
|
||||
use std::rc::Rc;
|
||||
use log::trace;
|
||||
use std::cell::RefCell;
|
||||
use std::io::{Read, Seek, Write};
|
||||
use log::trace;
|
||||
use std::rc::Rc;
|
||||
|
||||
pub struct WindowsIO {}
|
||||
|
||||
@@ -48,7 +48,7 @@ impl File for WindowsFile {
|
||||
&self,
|
||||
pos: usize,
|
||||
buffer: Rc<RefCell<crate::Buffer>>,
|
||||
c: Rc<WriteCompletion>,
|
||||
_c: Rc<WriteCompletion>,
|
||||
) -> Result<()> {
|
||||
let mut file = self.file.borrow_mut();
|
||||
file.seek(std::io::SeekFrom::Start(pos as u64))?;
|
||||
|
||||
@@ -63,7 +63,7 @@ impl Database {
|
||||
let rows = conn.query("SELECT * FROM sqlite_schema")?;
|
||||
if let Some(mut rows) = rows {
|
||||
loop {
|
||||
match rows.next()? {
|
||||
match rows.next_row()? {
|
||||
RowResult::Row(row) => {
|
||||
let ty = row.get::<&str>(0)?;
|
||||
if ty != "table" {
|
||||
@@ -257,7 +257,7 @@ impl Rows {
|
||||
Self { stmt }
|
||||
}
|
||||
|
||||
pub fn next(&mut self) -> Result<RowResult<'_>> {
|
||||
pub fn next_row(&mut self) -> Result<RowResult<'_>> {
|
||||
self.stmt.step()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,6 +177,12 @@ impl PseudoTable {
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for PseudoTable {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
fn create_table(
|
||||
tbl_name: QualifiedName,
|
||||
body: CreateTableBody,
|
||||
@@ -271,7 +277,7 @@ fn create_table(
|
||||
})
|
||||
}
|
||||
|
||||
pub fn build_pseudo_table(columns: &[ResultColumn]) -> PseudoTable {
|
||||
pub fn _build_pseudo_table(columns: &[ResultColumn]) -> PseudoTable {
|
||||
let table = PseudoTable::new();
|
||||
for column in columns {
|
||||
match column {
|
||||
|
||||
@@ -543,7 +543,7 @@ mod tests {
|
||||
#[case(&[0x12, 0x34, 0x56, 0x78], SerialType::BEInt32, OwnedValue::Integer(0x12345678))]
|
||||
#[case(&[0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC], SerialType::BEInt48, OwnedValue::Integer(0x123456789ABC))]
|
||||
#[case(&[0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF], SerialType::BEInt64, OwnedValue::Integer(0x123456789ABCDEFF))]
|
||||
#[case(&[64, 9, 33, 251, 84, 68, 45, 24], SerialType::BEFloat64, OwnedValue::Float(3.141592653589793))]
|
||||
#[case(&[64, 9, 33, 251, 84, 68, 45, 24], SerialType::BEFloat64, OwnedValue::Float(std::f64::consts::PI))]
|
||||
#[case(&[], SerialType::ConstInt0, OwnedValue::Integer(0))]
|
||||
#[case(&[], SerialType::ConstInt1, OwnedValue::Integer(1))]
|
||||
#[case(&[1, 2, 3], SerialType::Blob(3), OwnedValue::Blob(vec![1, 2, 3].into()))]
|
||||
|
||||
@@ -37,7 +37,7 @@ struct LoopInfo {
|
||||
|
||||
struct SrcTable {
|
||||
table: Table,
|
||||
join_info: Option<ast::JoinedSelectTable>, // FIXME: preferably this should be a reference with lifetime == Select ast expr
|
||||
_join_info: Option<ast::JoinedSelectTable>, // FIXME: preferably this should be a reference with lifetime == Select ast expr
|
||||
}
|
||||
|
||||
struct ColumnInfo {
|
||||
@@ -56,10 +56,7 @@ impl ColumnInfo {
|
||||
}
|
||||
|
||||
pub fn is_aggregation_function(&self) -> bool {
|
||||
match self.func {
|
||||
Some(Func::Agg(_)) => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self.func, Some(Func::Agg(_)))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,30 +106,27 @@ fn build_select(schema: &Schema, select: ast::Select) -> Result<Select> {
|
||||
let mut joins = Vec::new();
|
||||
joins.push(SrcTable {
|
||||
table: Table::BTree(table.clone()),
|
||||
join_info: None,
|
||||
_join_info: None,
|
||||
});
|
||||
match from.joins {
|
||||
Some(selected_joins) => {
|
||||
for join in selected_joins {
|
||||
let table_name = match &join.table {
|
||||
ast::SelectTable::Table(name, ..) => name.name.clone(),
|
||||
_ => todo!(),
|
||||
};
|
||||
let table_name = &table_name.0;
|
||||
let table = match schema.get_table(table_name) {
|
||||
Some(table) => table,
|
||||
None => anyhow::bail!("Parse error: no such table: {}", table_name),
|
||||
};
|
||||
joins.push(SrcTable {
|
||||
table: Table::BTree(table),
|
||||
join_info: Some(join.clone()),
|
||||
});
|
||||
}
|
||||
if let Some(selected_joins) = from.joins {
|
||||
for join in selected_joins {
|
||||
let table_name = match &join.table {
|
||||
ast::SelectTable::Table(name, ..) => name.name.clone(),
|
||||
_ => todo!(),
|
||||
};
|
||||
let table_name = &table_name.0;
|
||||
let table = match schema.get_table(table_name) {
|
||||
Some(table) => table,
|
||||
None => anyhow::bail!("Parse error: no such table: {}", table_name),
|
||||
};
|
||||
joins.push(SrcTable {
|
||||
table: Table::BTree(table),
|
||||
_join_info: Some(join.clone()),
|
||||
});
|
||||
}
|
||||
None => {}
|
||||
};
|
||||
}
|
||||
|
||||
let table = Table::BTree(table);
|
||||
let _table = Table::BTree(table);
|
||||
let column_info = analyze_columns(&columns, &joins);
|
||||
let exist_aggregation = column_info
|
||||
.iter()
|
||||
@@ -264,8 +258,10 @@ fn translate_select(mut select: Select) -> Result<Program> {
|
||||
};
|
||||
program.emit_insn(Insn::Halt);
|
||||
let halt_offset = program.offset() - 1;
|
||||
if limit_info.is_some() && limit_info.as_ref().unwrap().goto_label < 0 {
|
||||
program.resolve_label(limit_info.as_ref().unwrap().goto_label, halt_offset);
|
||||
if let Some(limit_info) = limit_info {
|
||||
if limit_info.goto_label < 0 {
|
||||
program.resolve_label(limit_info.goto_label, halt_offset);
|
||||
}
|
||||
}
|
||||
program.resolve_label(init_label, program.offset());
|
||||
program.emit_insn(Insn::Transaction);
|
||||
@@ -298,7 +294,7 @@ fn insert_where_clause_instructions(
|
||||
) -> Result<Option<BranchOffset>> {
|
||||
if let Some(w) = &select.where_clause {
|
||||
let label = program.allocate_label();
|
||||
translate_condition_expr(program, &select, w, label)?;
|
||||
translate_condition_expr(program, select, w, label)?;
|
||||
Ok(Some(label))
|
||||
} else {
|
||||
Ok(None)
|
||||
@@ -476,8 +472,8 @@ fn analyze_expr(expr: &Expr, column_info_out: &mut ColumnInfo) {
|
||||
};
|
||||
if func_type.is_none() {
|
||||
let args = args.as_ref().unwrap();
|
||||
if args.len() > 0 {
|
||||
analyze_expr(&args.get(0).unwrap(), column_info_out);
|
||||
if !args.is_empty() {
|
||||
analyze_expr(args.first().unwrap(), column_info_out);
|
||||
}
|
||||
} else {
|
||||
column_info_out.func = func_type;
|
||||
@@ -847,7 +843,7 @@ fn translate_aggregation(
|
||||
if args.len() == 2 {
|
||||
match &args[1] {
|
||||
ast::Expr::Id(ident) => {
|
||||
if ident.0.starts_with("\"") {
|
||||
if ident.0.starts_with('"') {
|
||||
delimiter_expr =
|
||||
ast::Expr::Literal(Literal::String(ident.0.to_string()));
|
||||
} else {
|
||||
@@ -923,7 +919,7 @@ fn translate_aggregation(
|
||||
|
||||
match &args[1] {
|
||||
ast::Expr::Id(ident) => {
|
||||
if ident.0.starts_with("\"") {
|
||||
if ident.0.starts_with('"') {
|
||||
anyhow::bail!("Parse error: no such column: \",\" - should this be a string literal in single-quotes?");
|
||||
} else {
|
||||
delimiter_expr = args[1].clone();
|
||||
@@ -1079,10 +1075,9 @@ fn update_pragma(name: &str, value: i64, header: Rc<RefCell<DatabaseHeader>>, pa
|
||||
}
|
||||
|
||||
fn maybe_apply_affinity(col: &Column, target_register: usize, program: &mut ProgramBuilder) {
|
||||
match col.ty {
|
||||
crate::schema::Type::Real => program.emit_insn(Insn::RealAffinity {
|
||||
if col.ty == crate::schema::Type::Real {
|
||||
program.emit_insn(Insn::RealAffinity {
|
||||
register: target_register,
|
||||
}),
|
||||
_ => {}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
58
core/vdbe.rs
58
core/vdbe.rs
@@ -268,7 +268,7 @@ impl ProgramBuilder {
|
||||
pub fn alloc_cursor_id(&mut self, table: Table) -> usize {
|
||||
let cursor = self.next_free_cursor_id;
|
||||
self.next_free_cursor_id += 1;
|
||||
if self.cursor_ref.iter().find(|t| **t == table).is_some() {
|
||||
if self.cursor_ref.iter().any(|t| *t == table) {
|
||||
todo!("duplicate table is unhandled. see how resolve_ident_table() calls resolve_cursor_id")
|
||||
}
|
||||
self.cursor_ref.push(table);
|
||||
@@ -343,7 +343,7 @@ impl ProgramBuilder {
|
||||
|
||||
let label_references = &mut self.unresolved_labels[label_index];
|
||||
assert!(
|
||||
label_references.len() > 0,
|
||||
!label_references.is_empty(),
|
||||
"Trying to resolve an empty created label, all labels must be resolved for now."
|
||||
);
|
||||
for insn_reference in label_references.iter() {
|
||||
@@ -354,59 +354,62 @@ impl ProgramBuilder {
|
||||
*target_pc = to_offset;
|
||||
}
|
||||
Insn::Eq {
|
||||
lhs,
|
||||
rhs,
|
||||
lhs: _lhs,
|
||||
rhs: _rhs,
|
||||
target_pc,
|
||||
} => {
|
||||
assert!(*target_pc < 0);
|
||||
*target_pc = to_offset;
|
||||
}
|
||||
Insn::Ne {
|
||||
lhs,
|
||||
rhs,
|
||||
lhs: _lhs,
|
||||
rhs: _rhs,
|
||||
target_pc,
|
||||
} => {
|
||||
assert!(*target_pc < 0);
|
||||
*target_pc = to_offset;
|
||||
}
|
||||
Insn::Lt {
|
||||
lhs,
|
||||
rhs,
|
||||
lhs: _lhs,
|
||||
rhs: _rhs,
|
||||
target_pc,
|
||||
} => {
|
||||
assert!(*target_pc < 0);
|
||||
*target_pc = to_offset;
|
||||
}
|
||||
Insn::Le {
|
||||
lhs,
|
||||
rhs,
|
||||
lhs: _lhs,
|
||||
rhs: _rhs,
|
||||
target_pc,
|
||||
} => {
|
||||
assert!(*target_pc < 0);
|
||||
*target_pc = to_offset;
|
||||
}
|
||||
Insn::Gt {
|
||||
lhs,
|
||||
rhs,
|
||||
lhs: _lhs,
|
||||
rhs: _rhs,
|
||||
target_pc,
|
||||
} => {
|
||||
assert!(*target_pc < 0);
|
||||
*target_pc = to_offset;
|
||||
}
|
||||
Insn::Ge {
|
||||
lhs,
|
||||
rhs,
|
||||
lhs: _lhs,
|
||||
rhs: _rhs,
|
||||
target_pc,
|
||||
} => {
|
||||
assert!(*target_pc < 0);
|
||||
*target_pc = to_offset;
|
||||
}
|
||||
Insn::IfNot { reg, target_pc } => {
|
||||
Insn::IfNot {
|
||||
reg: _reg,
|
||||
target_pc,
|
||||
} => {
|
||||
assert!(*target_pc < 0);
|
||||
*target_pc = to_offset;
|
||||
}
|
||||
Insn::RewindAwait {
|
||||
cursor_id,
|
||||
cursor_id: _cursor_id,
|
||||
pc_if_empty,
|
||||
} => {
|
||||
assert!(*pc_if_empty < 0);
|
||||
@@ -416,18 +419,24 @@ impl ProgramBuilder {
|
||||
assert!(*target_pc < 0);
|
||||
*target_pc = to_offset;
|
||||
}
|
||||
Insn::DecrJumpZero { reg, target_pc } => {
|
||||
Insn::DecrJumpZero {
|
||||
reg: _reg,
|
||||
target_pc,
|
||||
} => {
|
||||
assert!(*target_pc < 0);
|
||||
*target_pc = to_offset;
|
||||
}
|
||||
Insn::SorterNext {
|
||||
cursor_id,
|
||||
cursor_id: _cursor_id,
|
||||
pc_if_next,
|
||||
} => {
|
||||
assert!(*pc_if_next < 0);
|
||||
*pc_if_next = to_offset;
|
||||
}
|
||||
Insn::NotNull { reg, target_pc } => {
|
||||
Insn::NotNull {
|
||||
reg: _reg,
|
||||
target_pc,
|
||||
} => {
|
||||
assert!(*target_pc < 0);
|
||||
*target_pc = to_offset;
|
||||
}
|
||||
@@ -507,7 +516,7 @@ impl Program {
|
||||
for (addr, insn) in self.insns.iter().enumerate() {
|
||||
indent_count = get_indent_count(indent_count, insn, prev_insn);
|
||||
print_insn(
|
||||
&self,
|
||||
self,
|
||||
addr as InsnReference,
|
||||
insn,
|
||||
indent.repeat(indent_count),
|
||||
@@ -864,7 +873,6 @@ impl Program {
|
||||
Insn::RealAffinity { register } => {
|
||||
if let OwnedValue::Integer(i) = &state.registers[*register] {
|
||||
state.registers[*register] = OwnedValue::Float(*i as f64);
|
||||
} else {
|
||||
};
|
||||
state.pc += 1;
|
||||
}
|
||||
@@ -1061,7 +1069,7 @@ impl Program {
|
||||
let AggContext::GroupConcat(acc) = agg.borrow_mut() else {
|
||||
unreachable!();
|
||||
};
|
||||
if acc.to_string().len() == 0 {
|
||||
if acc.to_string().is_empty() {
|
||||
*acc = col;
|
||||
} else {
|
||||
*acc += delimiter;
|
||||
@@ -1622,14 +1630,12 @@ fn get_indent_count(indent_count: usize, curr_insn: &Insn, prev_insn: Option<&In
|
||||
indent_count
|
||||
};
|
||||
|
||||
let indent_count = match curr_insn {
|
||||
match curr_insn {
|
||||
Insn::NextAsync { cursor_id: _ } => indent_count - 1,
|
||||
Insn::SorterNext {
|
||||
cursor_id: _,
|
||||
pc_if_next: _,
|
||||
} => indent_count - 1,
|
||||
_ => indent_count,
|
||||
};
|
||||
|
||||
indent_count
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ fn main() {
|
||||
let conn = db.connect();
|
||||
let mut stmt = conn.prepare("SELECT 1").unwrap();
|
||||
let mut rows = stmt.query().unwrap();
|
||||
match rows.next().unwrap() {
|
||||
match rows.next_row().unwrap() {
|
||||
limbo_core::RowResult::Row(row) => {
|
||||
assert_eq!(row.get::<i64>(0).unwrap(), 1);
|
||||
}
|
||||
|
||||
@@ -60,27 +60,27 @@ int sqlite3_exec(sqlite3 *db, const char *sql, int (*_callback)(void), void *_co
|
||||
|
||||
int sqlite3_reset(sqlite3_stmt *stmt);
|
||||
|
||||
int sqlite3_changes(sqlite3 *db);
|
||||
int sqlite3_changes(sqlite3 *_db);
|
||||
|
||||
int sqlite3_stmt_readonly(sqlite3_stmt *stmt);
|
||||
int sqlite3_stmt_readonly(sqlite3_stmt *_stmt);
|
||||
|
||||
int sqlite3_stmt_busy(sqlite3_stmt *stmt);
|
||||
int sqlite3_stmt_busy(sqlite3_stmt *_stmt);
|
||||
|
||||
int sqlite3_serialize(sqlite3 *_db, const char *_schema, void **_out, int *_out_bytes, unsigned int _flags);
|
||||
|
||||
int sqlite3_deserialize(sqlite3 *_db, const char *_schema, const void *_in_, int _in_bytes, unsigned int _flags);
|
||||
|
||||
int sqlite3_get_autocommit(sqlite3 *db);
|
||||
int sqlite3_get_autocommit(sqlite3 *_db);
|
||||
|
||||
int sqlite3_total_changes(sqlite3 *db);
|
||||
int sqlite3_total_changes(sqlite3 *_db);
|
||||
|
||||
int64_t sqlite3_last_insert_rowid(sqlite3 *db);
|
||||
int64_t sqlite3_last_insert_rowid(sqlite3 *_db);
|
||||
|
||||
void sqlite3_interrupt(sqlite3 *db);
|
||||
void sqlite3_interrupt(sqlite3 *_db);
|
||||
|
||||
int sqlite3_db_config(sqlite3 *_db, int _op);
|
||||
|
||||
sqlite3 *sqlite3_db_handle(sqlite3_stmt *stmt);
|
||||
sqlite3 *sqlite3_db_handle(sqlite3_stmt *_stmt);
|
||||
|
||||
void sqlite3_sleep(int _ms);
|
||||
|
||||
@@ -90,7 +90,7 @@ void *sqlite3_malloc64(int _n);
|
||||
|
||||
void sqlite3_free(void *_ptr);
|
||||
|
||||
int sqlite3_errcode(sqlite3 *db);
|
||||
int sqlite3_errcode(sqlite3 *_db);
|
||||
|
||||
const char *sqlite3_errstr(int _err);
|
||||
|
||||
@@ -110,35 +110,35 @@ char *sqlite3_expanded_sql(sqlite3_stmt *_stmt);
|
||||
|
||||
int sqlite3_data_count(sqlite3_stmt *stmt);
|
||||
|
||||
int sqlite3_bind_parameter_count(sqlite3_stmt *stmt);
|
||||
int sqlite3_bind_parameter_count(sqlite3_stmt *_stmt);
|
||||
|
||||
const char *sqlite3_bind_parameter_name(sqlite3_stmt *_stmt, int _idx);
|
||||
|
||||
int sqlite3_bind_null(sqlite3_stmt *stmt, int idx);
|
||||
int sqlite3_bind_null(sqlite3_stmt *_stmt, int _idx);
|
||||
|
||||
int sqlite3_bind_int64(sqlite3_stmt *stmt, int idx, int64_t val);
|
||||
int sqlite3_bind_int64(sqlite3_stmt *_stmt, int _idx, int64_t _val);
|
||||
|
||||
int sqlite3_bind_double(sqlite3_stmt *stmt, int idx, double val);
|
||||
int sqlite3_bind_double(sqlite3_stmt *_stmt, int _idx, double _val);
|
||||
|
||||
int sqlite3_bind_text(sqlite3_stmt *stmt, int idx, const char *text, int len, void *_destroy);
|
||||
int sqlite3_bind_text(sqlite3_stmt *_stmt, int _idx, const char *_text, int _len, void *_destroy);
|
||||
|
||||
int sqlite3_bind_blob(sqlite3_stmt *stmt, int idx, const void *blob, int len, void *_destroy);
|
||||
int sqlite3_bind_blob(sqlite3_stmt *_stmt, int _idx, const void *_blob, int _len, void *_destroy);
|
||||
|
||||
int sqlite3_column_type(sqlite3_stmt *stmt, int idx);
|
||||
int sqlite3_column_type(sqlite3_stmt *_stmt, int _idx);
|
||||
|
||||
int sqlite3_column_count(sqlite3_stmt *stmt);
|
||||
int sqlite3_column_count(sqlite3_stmt *_stmt);
|
||||
|
||||
const char *sqlite3_column_decltype(sqlite3_stmt *stmt, int idx);
|
||||
const char *sqlite3_column_decltype(sqlite3_stmt *_stmt, int _idx);
|
||||
|
||||
const char *sqlite3_column_name(sqlite3_stmt *stmt, int idx);
|
||||
const char *sqlite3_column_name(sqlite3_stmt *_stmt, int _idx);
|
||||
|
||||
int64_t sqlite3_column_int64(sqlite3_stmt *stmt, int idx);
|
||||
int64_t sqlite3_column_int64(sqlite3_stmt *_stmt, int _idx);
|
||||
|
||||
double sqlite3_column_double(sqlite3_stmt *stmt, int idx);
|
||||
double sqlite3_column_double(sqlite3_stmt *_stmt, int _idx);
|
||||
|
||||
const void *sqlite3_column_blob(sqlite3_stmt *stmt, int idx);
|
||||
const void *sqlite3_column_blob(sqlite3_stmt *_stmt, int _idx);
|
||||
|
||||
int sqlite3_column_bytes(sqlite3_stmt *stmt, int idx);
|
||||
int sqlite3_column_bytes(sqlite3_stmt *_stmt, int _idx);
|
||||
|
||||
int sqlite3_value_type(void *value);
|
||||
|
||||
@@ -218,7 +218,7 @@ int sqlite3_create_window_function(sqlite3 *_db,
|
||||
void (*_x_inverse)(void),
|
||||
void (*_destroy)(void));
|
||||
|
||||
const char *sqlite3_errmsg(sqlite3 *db);
|
||||
const char *sqlite3_errmsg(sqlite3 *_db);
|
||||
|
||||
int sqlite3_extended_errcode(sqlite3 *_db);
|
||||
|
||||
|
||||
@@ -14,13 +14,13 @@ pub const SQLITE_ROW: ffi::c_int = 100;
|
||||
pub const SQLITE_DONE: ffi::c_int = 101;
|
||||
|
||||
pub struct sqlite3 {
|
||||
pub(crate) db: limbo_core::Database,
|
||||
pub(crate) _db: limbo_core::Database,
|
||||
pub(crate) conn: limbo_core::Connection,
|
||||
}
|
||||
|
||||
impl sqlite3 {
|
||||
pub fn new(db: limbo_core::Database, conn: limbo_core::Connection) -> Self {
|
||||
Self { db, conn }
|
||||
Self { _db: db, conn }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,17 +230,17 @@ pub unsafe extern "C" fn sqlite3_reset(stmt: *mut sqlite3_stmt) -> ffi::c_int {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_changes(db: *mut sqlite3) -> ffi::c_int {
|
||||
pub unsafe extern "C" fn sqlite3_changes(_db: *mut sqlite3) -> ffi::c_int {
|
||||
todo!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_stmt_readonly(stmt: *mut sqlite3_stmt) -> ffi::c_int {
|
||||
pub unsafe extern "C" fn sqlite3_stmt_readonly(_stmt: *mut sqlite3_stmt) -> ffi::c_int {
|
||||
todo!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_stmt_busy(stmt: *mut sqlite3_stmt) -> ffi::c_int {
|
||||
pub unsafe extern "C" fn sqlite3_stmt_busy(_stmt: *mut sqlite3_stmt) -> ffi::c_int {
|
||||
todo!();
|
||||
}
|
||||
|
||||
@@ -267,22 +267,22 @@ pub unsafe extern "C" fn sqlite3_deserialize(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_get_autocommit(db: *mut sqlite3) -> ffi::c_int {
|
||||
pub unsafe extern "C" fn sqlite3_get_autocommit(_db: *mut sqlite3) -> ffi::c_int {
|
||||
todo!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_total_changes(db: *mut sqlite3) -> ffi::c_int {
|
||||
pub unsafe extern "C" fn sqlite3_total_changes(_db: *mut sqlite3) -> ffi::c_int {
|
||||
todo!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_last_insert_rowid(db: *mut sqlite3) -> i64 {
|
||||
pub unsafe extern "C" fn sqlite3_last_insert_rowid(_db: *mut sqlite3) -> i64 {
|
||||
todo!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_interrupt(db: *mut sqlite3) {
|
||||
pub unsafe extern "C" fn sqlite3_interrupt(_db: *mut sqlite3) {
|
||||
todo!();
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ pub unsafe extern "C" fn sqlite3_db_config(_db: *mut sqlite3, _op: ffi::c_int) -
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_db_handle(stmt: *mut sqlite3_stmt) -> *mut sqlite3 {
|
||||
pub unsafe extern "C" fn sqlite3_db_handle(_stmt: *mut sqlite3_stmt) -> *mut sqlite3 {
|
||||
todo!();
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ pub unsafe extern "C" fn sqlite3_free(_ptr: *mut std::ffi::c_void) {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_errcode(db: *mut sqlite3) -> ffi::c_int {
|
||||
pub unsafe extern "C" fn sqlite3_errcode(_db: *mut sqlite3) -> ffi::c_int {
|
||||
todo!();
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ pub unsafe extern "C" fn sqlite3_data_count(stmt: *mut sqlite3_stmt) -> ffi::c_i
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_bind_parameter_count(stmt: *mut sqlite3_stmt) -> ffi::c_int {
|
||||
pub unsafe extern "C" fn sqlite3_bind_parameter_count(_stmt: *mut sqlite3_stmt) -> ffi::c_int {
|
||||
todo!();
|
||||
}
|
||||
|
||||
@@ -400,34 +400,37 @@ pub unsafe extern "C" fn sqlite3_bind_parameter_name(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_bind_null(stmt: *mut sqlite3_stmt, idx: ffi::c_int) -> ffi::c_int {
|
||||
pub unsafe extern "C" fn sqlite3_bind_null(
|
||||
_stmt: *mut sqlite3_stmt,
|
||||
_idx: ffi::c_int,
|
||||
) -> ffi::c_int {
|
||||
todo!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_bind_int64(
|
||||
stmt: *mut sqlite3_stmt,
|
||||
idx: ffi::c_int,
|
||||
val: i64,
|
||||
_stmt: *mut sqlite3_stmt,
|
||||
_idx: ffi::c_int,
|
||||
_val: i64,
|
||||
) -> ffi::c_int {
|
||||
todo!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_bind_double(
|
||||
stmt: *mut sqlite3_stmt,
|
||||
idx: ffi::c_int,
|
||||
val: f64,
|
||||
_stmt: *mut sqlite3_stmt,
|
||||
_idx: ffi::c_int,
|
||||
_val: f64,
|
||||
) -> ffi::c_int {
|
||||
todo!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_bind_text(
|
||||
stmt: *mut sqlite3_stmt,
|
||||
idx: ffi::c_int,
|
||||
text: *const std::ffi::c_char,
|
||||
len: ffi::c_int,
|
||||
_stmt: *mut sqlite3_stmt,
|
||||
_idx: ffi::c_int,
|
||||
_text: *const std::ffi::c_char,
|
||||
_len: ffi::c_int,
|
||||
_destroy: *mut std::ffi::c_void,
|
||||
) -> ffi::c_int {
|
||||
todo!();
|
||||
@@ -435,10 +438,10 @@ pub unsafe extern "C" fn sqlite3_bind_text(
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_bind_blob(
|
||||
stmt: *mut sqlite3_stmt,
|
||||
idx: ffi::c_int,
|
||||
blob: *const std::ffi::c_void,
|
||||
len: ffi::c_int,
|
||||
_stmt: *mut sqlite3_stmt,
|
||||
_idx: ffi::c_int,
|
||||
_blob: *const std::ffi::c_void,
|
||||
_len: ffi::c_int,
|
||||
_destroy: *mut std::ffi::c_void,
|
||||
) -> ffi::c_int {
|
||||
todo!();
|
||||
@@ -446,55 +449,55 @@ pub unsafe extern "C" fn sqlite3_bind_blob(
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_column_type(
|
||||
stmt: *mut sqlite3_stmt,
|
||||
idx: ffi::c_int,
|
||||
_stmt: *mut sqlite3_stmt,
|
||||
_idx: ffi::c_int,
|
||||
) -> ffi::c_int {
|
||||
todo!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_column_count(stmt: *mut sqlite3_stmt) -> ffi::c_int {
|
||||
pub unsafe extern "C" fn sqlite3_column_count(_stmt: *mut sqlite3_stmt) -> ffi::c_int {
|
||||
todo!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_column_decltype(
|
||||
stmt: *mut sqlite3_stmt,
|
||||
idx: ffi::c_int,
|
||||
_stmt: *mut sqlite3_stmt,
|
||||
_idx: ffi::c_int,
|
||||
) -> *const std::ffi::c_char {
|
||||
todo!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_column_name(
|
||||
stmt: *mut sqlite3_stmt,
|
||||
idx: ffi::c_int,
|
||||
_stmt: *mut sqlite3_stmt,
|
||||
_idx: ffi::c_int,
|
||||
) -> *const std::ffi::c_char {
|
||||
todo!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_column_int64(stmt: *mut sqlite3_stmt, idx: ffi::c_int) -> i64 {
|
||||
pub unsafe extern "C" fn sqlite3_column_int64(_stmt: *mut sqlite3_stmt, _idx: ffi::c_int) -> i64 {
|
||||
todo!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_column_double(stmt: *mut sqlite3_stmt, idx: ffi::c_int) -> f64 {
|
||||
pub unsafe extern "C" fn sqlite3_column_double(_stmt: *mut sqlite3_stmt, _idx: ffi::c_int) -> f64 {
|
||||
todo!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_column_blob(
|
||||
stmt: *mut sqlite3_stmt,
|
||||
idx: ffi::c_int,
|
||||
_stmt: *mut sqlite3_stmt,
|
||||
_idx: ffi::c_int,
|
||||
) -> *const std::ffi::c_void {
|
||||
todo!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_column_bytes(
|
||||
stmt: *mut sqlite3_stmt,
|
||||
idx: ffi::c_int,
|
||||
_stmt: *mut sqlite3_stmt,
|
||||
_idx: ffi::c_int,
|
||||
) -> ffi::c_int {
|
||||
todo!();
|
||||
}
|
||||
@@ -740,7 +743,7 @@ pub unsafe extern "C" fn sqlite3_create_window_function(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sqlite3_errmsg(db: *mut sqlite3) -> *const std::ffi::c_char {
|
||||
pub unsafe extern "C" fn sqlite3_errmsg(_db: *mut sqlite3) -> *const std::ffi::c_char {
|
||||
todo!();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user