Comments (7)
BTW, I'm using gorp (https://github.com/coopernurse/gorp). There doesn't seem to be much happening between the exec & the RowsAffected call:
res, err := exec.Exec(bi.query, bi.args...)
if err != nil {
return -1, err
}
rows, err := res.RowsAffected()
if err != nil {
return -1, err
}
from go-sqlite3.
Could you please show me the code you have?
from go-sqlite3.
My code is just calling the Update method on a DBMap struct from the Gorp library, which really just seems to do an Exec & then call RowsAffected on the result. It also happens with the Insert method and LastInsertId.
Code is here: https://github.com/coopernurse/gorp/blob/master/gorp.go
If you want to look at my code, I'm happy to add you to the project - I'm planning on open sourcing it, just waiting on approval from the client.
from go-sqlite3.
I was fixed about LastInsertId in yesterday. Please check latest.
from go-sqlite3.
Sorry to take so long to test this out. That doesn't seem to have resolved the issue:
goroutine 21 [syscall]:
github.com/mattn/go-sqlite3._Cfunc__sqlite3_changes(0x0, 0xf840397a00)
github.com/mattn/go-sqlite3/_obj/_cgo_defun.c:58 +0x2f
github.com/mattn/go-sqlite3.(_SQLiteResult).RowsAffected(0xf84039e8f8, 0xf8406dc160, 0x0, 0x0)
github.com/mattn/go-sqlite3/_obj/sqlite3.cgo1.go:264 +0x2e
database/sql.(_result).RowsAffected(0xf8406dc160, 0xf8400a2f00, 0xfc, 0xf840397a00)
/usr/local/go/src/pkg/database/sql/convert.go:0 +0x43
Any other suggestions?
from go-sqlite3.
github.com/mattn/go-sqlite3._Cfunc__sqlite3_changes(0x0, 0xf840397a00)
It seems that statement object is 0x0. Could you please show me your code?
from go-sqlite3.
I'm using the Gorp library. Code for the update method can be found here:
https://github.com/coopernurse/gorp/blob/master/gorp.go#L1078
I don't see any way for the result to be nil unless it somehow returns a nil result with a nil error - is that possible?
from go-sqlite3.
Related Issues (20)
- [Want help] How to use compiled go-sqlite3 on Windows? HOT 6
- RETURNING directive is not working. HOT 1
- strange disk I/O error: read-only file system, need help HOT 5
- Performance when not using build tag "libsqlite3" HOT 2
- Making Virtual Table Implementation Multi Tenant HOT 2
- Ordering of query parameters HOT 1
- gcc dependency removel HOT 1
- LastInsertId and RowsAffected methods of sqlite.Result object return constant nil error HOT 1
- SIGSEGV when create a table HOT 3
- Possible memory leak, with reproduce repo HOT 17
- Error "database is locked" in wal mode HOT 1
- Changing PRAGMA user_version via placeholders does not work; Without placeholders it works fine HOT 2
- In-memory database access fails with multiple goroutines HOT 3
- v3.45.0 release HOT 3
- v3.45.1 release HOT 1
- Scanning of timestamps not working when using "with time zone"
- Support for custom window functions
- Drop static_mock.go
- Getting Errors with go-sqlite3 HOT 4
- env “TMPDIR" can't change the tmp store diretory HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-sqlite3.