MCPcopy Index your code
hub / github.com/RustPython/RustPython / prepare

Method prepare

crates/stdlib/src/_sqlite3.rs:2884–2898  ·  view source on GitHub ↗
(
            self,
            sql: *const libc::c_char,
            tail: *mut *const libc::c_char,
            vm: &VirtualMachine,
        )

Source from the content-addressed store, hash-verified

2882 }
2883
2884 fn prepare(
2885 self,
2886 sql: *const libc::c_char,
2887 tail: *mut *const libc::c_char,
2888 vm: &VirtualMachine,
2889 ) -> PyResult<Option<SqliteStatement>> {
2890 let mut st = null_mut();
2891 let ret = unsafe { sqlite3_prepare_v2(self.db, sql, -1, &mut st, tail) };
2892 self.check(ret, vm)?;
2893 if st.is_null() {
2894 Ok(None)
2895 } else {
2896 Ok(Some(SqliteStatement::from(SqliteStatementRaw::from(st))))
2897 }
2898 }
2899
2900 fn limit(self, category: c_int, limit: c_int, vm: &VirtualMachine) -> PyResult<c_int> {
2901 let old_limit = unsafe { sqlite3_limit(self.db, category, limit) };

Callers 2

executescriptMethod · 0.45
newMethod · 0.45

Calls 2

SomeClass · 0.50
checkMethod · 0.45

Tested by

no test coverage detected