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

Method create_aggregate

crates/stdlib/src/_sqlite3.rs:1256–1284  ·  view source on GitHub ↗
(&self, args: CreateAggregateArgs, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1254
1255 #[pymethod]
1256 fn create_aggregate(&self, args: CreateAggregateArgs, vm: &VirtualMachine) -> PyResult<()> {
1257 let name = args.name.to_cstring(vm)?;
1258 let db = self.db_lock(vm)?;
1259 let Some(data) = CallbackData::new(args.aggregate_class, vm) else {
1260 return db.create_function(
1261 name.as_ptr(),
1262 args.narg,
1263 SQLITE_UTF8,
1264 null_mut(),
1265 None,
1266 None,
1267 None,
1268 None,
1269 vm,
1270 );
1271 };
1272
1273 db.create_function(
1274 name.as_ptr(),
1275 args.narg,
1276 SQLITE_UTF8,
1277 Box::into_raw(Box::new(data)).cast(),
1278 None,
1279 Some(CallbackData::step_callback),
1280 Some(CallbackData::finalize_callback),
1281 Some(CallbackData::destructor),
1282 vm,
1283 )
1284 }
1285
1286 #[pymethod]
1287 fn create_collation(

Callers 3

setUpMethod · 0.80
test_agg_keyword_argsMethod · 0.80
stdlib_sqlite.pyFile · 0.80

Calls 7

newFunction · 0.85
db_lockMethod · 0.80
create_functionMethod · 0.80
SomeClass · 0.50
to_cstringMethod · 0.45
as_ptrMethod · 0.45
castMethod · 0.45

Tested by 2

setUpMethod · 0.64
test_agg_keyword_argsMethod · 0.64