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

Method open

crates/stdlib/src/_sqlite3.rs:2862–2876  ·  view source on GitHub ↗
(path: *const libc::c_char, uri: bool, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

2860 }
2861
2862 fn open(path: *const libc::c_char, uri: bool, vm: &VirtualMachine) -> PyResult<Self> {
2863 let mut db = null_mut();
2864 let ret = unsafe {
2865 sqlite3_open_v2(
2866 path,
2867 &raw mut db,
2868 SQLITE_OPEN_READWRITE
2869 | SQLITE_OPEN_CREATE
2870 | if uri { SQLITE_OPEN_URI } else { 0 },
2871 null(),
2872 )
2873 };
2874 let zelf = Self { db };
2875 zelf.check(ret, vm).map(|_| zelf)
2876 }
2877
2878 fn _exec(self, sql: &[u8], vm: &VirtualMachine) -> PyResult<()> {
2879 let ret =

Callers 4

openFunction · 0.45
_write_atomicFunction · 0.45
utime_implFunction · 0.45
truncateFunction · 0.45

Calls 2

mapMethod · 0.45
checkMethod · 0.45

Tested by

no test coverage detected