Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[MySQL] Add in a few more vtables so we can iterate over a table, and…

… loop over row elements
  • Loading branch information...
commit 84feff6b0e790922cef5f7cfdee73326b04c0607 1 parent 4c6b989
@Whiteknight authored
Showing with 16 additions and 0 deletions.
  1. +5 −0 mysql/pmc/mysqldatarow.pmc
  2. +11 −0 mysql/pmc/mysqldatatable.pmc
View
5 mysql/pmc/mysqldatarow.pmc
@@ -64,4 +64,9 @@ pmclass MySqlDataRow dynpmc auto_attrs provides array provides hash {
STRING * const value = VTABLE_get_string_keyed_int(INTERP, SELF, idx);
return Parrot_pmc_box_string(INTERP, value);
}
+
+ VTABLE INTVAL elements()
+ {
+ return VTABLE_elements(INTERP, PARROT_MYSQLDATAROW(SELF)->data);
+ }
}
View
11 mysql/pmc/mysqldatatable.pmc
@@ -92,4 +92,15 @@ pmclass MySqlDataTable dynpmc auto_attrs provides iterator {
{
return (INTVAL)Parrot_hash_get(INTERP, PARROT_MYSQLDATATABLE(SELF)->colnames, (void*)colname);
}
+
+ VTABLE PMC *get_iter()
+ {
+ return SELF;
+ }
+
+ VTABLE void set_integer_native(INTVAL iter_dir)
+ {
+ // This is necessary for the iterator interface
+ UNUSED(iter_dir);
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.