Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for batch read #554

Open
tchaton opened this issue Aug 8, 2023 · 0 comments
Open

Add support for batch read #554

tchaton opened this issue Aug 8, 2023 · 0 comments

Comments

@tchaton
Copy link

tchaton commented Aug 8, 2023

Hey there,

Thanks a lot for this library !

I wondered if it could be possible to have a batch read where we could provide the list of indices to read directly. I believe this would be faster than using a combinaison of SkipRows and Reads.

	num = int(pr.GetNumRows())
	for i := 0; i < num/10; i++ {
		stus := make([]Student2, 10) //read 10 rows
		if err = pr.Read(&stus, [0, 2, 4, 6, 8, ..., 18]); err != nil {
			log.Println("Read error", err)
		}
		log.Println(stus)
	}

Best,
T.C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant