Code Monkey home page Code Monkey logo

Comments (4)

aktau avatar aktau commented on July 22, 2024

After looking at the backtrace, this seems to have little to do with the *time.Time being nil.

What's also strange is that on the first run, with an empty database, the res value gives 1 (!) as the Affected value. While I'm positive that there's not row it could have possible matched... very strange.

It almost seems like the UPDATE statement is inserting rows... am I going crazy?

from pg.

aktau avatar aktau commented on July 22, 2024

Could it be that somehow, there can only be one prepared statement active at a time? And that the INSERT statement is overriding the UPDATE statement?

from pg.

vmihailenco avatar vmihailenco commented on July 22, 2024

Yeah, client did not support multiple statements in 1 transaction. Should be fixed by #24 . I will merge fix later today.

Also you are probably interested in RunInTransaction helper: http://godoc.org/gopkg.in/pg.v2#DB.RunInTransaction

from pg.

aktau avatar aktau commented on July 22, 2024

Also you are probably interested in RunInTransaction helper:

Indeed I was. I already switched to it when I saw it earlier (even before you mentioned it :)). The docs are a bit spartan, but that function name was clear enough. I'll learn to inspect go-pg's source better.

from pg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.