File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -174,15 +174,28 @@ impl crate::statement::Stmt for crate::hrana::Statement<HttpSender> {
174174 fn reset ( & mut self ) { }
175175
176176 fn parameter_count ( & self ) -> usize {
177- todo ! ( )
177+ let stmt = & self . inner ;
178+ stmt. args . len ( ) + stmt. named_args . len ( )
178179 }
179180
180- fn parameter_name ( & self , _idx : i32 ) -> Option < & str > {
181- todo ! ( )
181+ fn parameter_name ( & self , idx : i32 ) -> Option < & str > {
182+ //FIXME: actual rules of named args are pretty convoluted and may require full AST parsing. Here we basically
183+ // assume, that if one needs a param name, they don't use named and un-named params mixed in.
184+ if !self . inner . args . is_empty ( ) {
185+ return None ;
186+ }
187+ let named_param = self . inner . named_args . get ( idx as usize ) ?;
188+ Some ( & named_param. name )
182189 }
183190
184191 fn columns ( & self ) -> Vec < crate :: Column > {
185- todo ! ( )
192+ //FIXME: there are several blockers here:
193+ // 1. We cannot know the column types before sending a query, so this method will never return results right
194+ // away.
195+ // 2. Even if we do execute query, Hrana doesn't return all info that Column exposes.
196+ // 3. Even if we would like to return some of the column info ie. column [ValueType], this information is not
197+ // present in Hrana [Col] but rather inferred from the row cell type.
198+ vec ! [ ]
186199 }
187200}
188201
You can’t perform that action at this time.
0 commit comments