Add get rows number method

@joost can you review this? thanks.