@@ -28,6 +28,8 @@ static VALUE duckdb_prepared_statement_bind_null(VALUE self, VALUE vidx);
2828static VALUE duckdb_prepared_statement__statement_type (VALUE self );
2929static VALUE duckdb_prepared_statement__param_type (VALUE self , VALUE vidx );
3030static VALUE duckdb_prepared_statement__bind_uint8 (VALUE self , VALUE vidx , VALUE val );
31+ static VALUE duckdb_prepared_statement__bind_uint16 (VALUE self , VALUE vidx , VALUE val );
32+ static VALUE duckdb_prepared_statement__bind_uint32 (VALUE self , VALUE vidx , VALUE val );
3133static VALUE duckdb_prepared_statement__bind_date (VALUE self , VALUE vidx , VALUE year , VALUE month , VALUE day );
3234static VALUE duckdb_prepared_statement__bind_time (VALUE self , VALUE vidx , VALUE hour , VALUE min , VALUE sec , VALUE micros );
3335static VALUE duckdb_prepared_statement__bind_timestamp (VALUE self , VALUE vidx , VALUE year , VALUE month , VALUE day , VALUE hour , VALUE min , VALUE sec , VALUE micros );
@@ -389,6 +391,20 @@ static VALUE duckdb_prepared_statement__bind_uint16(VALUE self, VALUE vidx, VALU
389391 return self ;
390392}
391393
394+ /* :nodoc: */
395+ static VALUE duckdb_prepared_statement__bind_uint32 (VALUE self , VALUE vidx , VALUE val ) {
396+ rubyDuckDBPreparedStatement * ctx ;
397+ idx_t idx = check_index (vidx );
398+ uint32_t ui32val = (uint32_t )NUM2UINT (val );
399+
400+ TypedData_Get_Struct (self , rubyDuckDBPreparedStatement , & prepared_statement_data_type , ctx );
401+
402+ if (duckdb_bind_uint32 (ctx -> prepared_statement , idx , ui32val ) == DuckDBError ) {
403+ rb_raise (eDuckDBError , "fail to bind %llu parameter" , (unsigned long long )idx );
404+ }
405+ return self ;
406+ }
407+
392408/* :nodoc: */
393409static VALUE duckdb_prepared_statement__bind_date (VALUE self , VALUE vidx , VALUE year , VALUE month , VALUE day ) {
394410 rubyDuckDBPreparedStatement * ctx ;
@@ -543,6 +559,7 @@ void rbduckdb_init_duckdb_prepared_statement(void) {
543559 rb_define_method (cDuckDBPreparedStatement , "bind_null" , duckdb_prepared_statement_bind_null , 1 );
544560 rb_define_private_method (cDuckDBPreparedStatement , "_bind_uint8" , duckdb_prepared_statement__bind_uint8 , 2 );
545561 rb_define_private_method (cDuckDBPreparedStatement , "_bind_uint16" , duckdb_prepared_statement__bind_uint16 , 2 );
562+ rb_define_private_method (cDuckDBPreparedStatement , "_bind_uint32" , duckdb_prepared_statement__bind_uint32 , 2 );
546563 rb_define_private_method (cDuckDBPreparedStatement , "_statement_type" , duckdb_prepared_statement__statement_type , 0 );
547564 rb_define_private_method (cDuckDBPreparedStatement , "_param_type" , duckdb_prepared_statement__param_type , 1 );
548565 rb_define_private_method (cDuckDBPreparedStatement , "_bind_date" , duckdb_prepared_statement__bind_date , 4 );
0 commit comments