@@ -2036,14 +2036,22 @@ mod _sqlite {
2036
2036
}
2037
2037
2038
2038
#[ pyattr]
2039
- #[ pyclass( name, traverse) ]
2039
+ #[ pyclass( module = "sqlite3" , name = "Blob" , traverse) ]
2040
2040
#[ derive( Debug , PyPayload ) ]
2041
2041
struct Blob {
2042
2042
connection : PyRef < Connection > ,
2043
2043
#[ pytraverse( skip) ]
2044
2044
inner : PyMutex < Option < BlobInner > > ,
2045
2045
}
2046
2046
2047
+ impl Constructor for Blob {
2048
+ type Args = FuncArgs ;
2049
+
2050
+ fn py_new ( _cls : PyTypeRef , _args : Self :: Args , vm : & VirtualMachine ) -> PyResult {
2051
+ Err ( vm. new_type_error ( "cannot create 'sqlite3.Blob' instances" ) )
2052
+ }
2053
+ }
2054
+
2047
2055
#[ derive( Debug ) ]
2048
2056
struct BlobInner {
2049
2057
blob : SqliteBlob ,
@@ -2056,7 +2064,7 @@ mod _sqlite {
2056
2064
}
2057
2065
}
2058
2066
2059
- #[ pyclass( with( AsMapping ) ) ]
2067
+ #[ pyclass( with( AsMapping , Constructor ) ) ]
2060
2068
impl Blob {
2061
2069
#[ pymethod]
2062
2070
fn close ( & self ) {
@@ -2356,7 +2364,7 @@ mod _sqlite {
2356
2364
impl PrepareProtocol { }
2357
2365
2358
2366
#[ pyattr]
2359
- #[ pyclass( name) ]
2367
+ #[ pyclass( module = "sqlite3" , name = "Statement" ) ]
2360
2368
#[ derive( PyPayload ) ]
2361
2369
struct Statement {
2362
2370
st : PyMutex < SqliteStatement > ,
@@ -2373,7 +2381,15 @@ mod _sqlite {
2373
2381
}
2374
2382
}
2375
2383
2376
- #[ pyclass( ) ]
2384
+ impl Constructor for Statement {
2385
+ type Args = FuncArgs ;
2386
+
2387
+ fn py_new ( _cls : PyTypeRef , _args : Self :: Args , vm : & VirtualMachine ) -> PyResult {
2388
+ Err ( vm. new_type_error ( "cannot create 'sqlite3.Statement' instances" ) )
2389
+ }
2390
+ }
2391
+
2392
+ #[ pyclass( with( Constructor ) ) ]
2377
2393
impl Statement {
2378
2394
fn new (
2379
2395
connection : & Connection ,
0 commit comments