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

Is NextResultSet implemented for driver.Rows in go-ora? #573

Open
lifthelm opened this issue Jul 17, 2024 · 1 comment
Open

Is NextResultSet implemented for driver.Rows in go-ora? #573

lifthelm opened this issue Jul 17, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@lifthelm
Copy link

lifthelm commented Jul 17, 2024

I am using go_ora.Connection.QueryContext(...) that returns driver.Rows.

I want to use NextResultSet call like in database/sql:Rows

go-ora version: 2.8.19

What I am trying to do:

...
conn, err := go_ora.NewConnection(connectionString, nil)
if err != nil {
	return err
}
...
err = conn.Open()
if err != nil {
	return err
}
...
driverRows, err := conn.QueryContext(ctx, query, args...)
if err != nil {
	return err
}

...
// driverRows.NextResultSet()?
for driverRows.NextResultSet() {
	for driverRows.Next(values) == nil {
		...
	}
}

Maybe I should use as in Golang standard library?

nextResultSet, ok := rs.rowsi.(driver.RowsNextResultSet)
if !ok {
	doClose = true
	return false
}

// Lock the driver connection before calling the driver interface
// rowsi to prevent a Tx from rolling back the connection at the same time.
rs.dc.Lock()
defer rs.dc.Unlock()

rs.lasterr = nextResultSet.NextResultSet()
if rs.lasterr != nil {
	doClose = true
	return false
}

I tried to find implementation of NextResultSet in go-ora source code same as in godror:
https://github.com/godror/godror/blob/010a6de91d2687e91c1563126d3b76578c9771b5/rows.go#L776-L814

But only found this commented line:

// var _ = driver.RowsNextResultSet((*DataSet)(nil))

@lifthelm
Copy link
Author

lifthelm commented Aug 5, 2024

As I see DataSet does not implement NextResultSet as DataSet can not be converted to driver.RowsNextResultSet

@sijms sijms added the enhancement New feature or request label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants