Giter VIP home page Giter VIP logo

pmx's People

Contributors

wcamarao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pmx's Issues

Feature: access to commandTag would be very convenient, especially for e.g. "AffectedRows"

I like the (very) lean premise of pmx, since it enables us to avoid bloated ORMs.

However, the fact that for e.g. an pmx.Update query there is no return value that enables us to see whether there was in fact an update (i.e. "RowsAffected") is problematic, since usually one would like to make this distinction (additionally to error/no-error).

So it would be better to have either (always/optionally?) commandTag returned, or have an additional Update wrapper that can be chosen to get more feedback.

(Try to) upstream functionality to pgx

Hi, I've stumbled over your library while searching for how to use the pgx struct tags with insert / update operations. In my opinion the pgx functionality is quite incomplete because it only allows for scanning. Don't you think it would be a better idea to try to upstream the functionality of your library to the pgx project?

Insert() and returning filled in autogenerated fields?

If I'm calling Insert and passing a struct is it possible to get it to return with the autogenerated fields filled in?

type Request struct {
	ID        uuid.UUID `json:"-" generated:"auto" db:"id" table:"sign_request_user"`
	Request string    `json:"request" db:"request"`
	Created   time.Time `json:"-" generated:"auto" db:"-"`
	Updated   time.Time `json:"-" generated:"auto" db:"-"`
	Status    string    `json:"-" generated:"auto" db:"-"`

So I insert just the Request value into the struct and would get back filled in ID, Status and such.

Scan with join

type B struct {
	Type   string             `db:"type" table:"games_bets"`
	Game   Game               `db:"" table:"games"`
	User   storusermodel.User `db:"" table:"users"`
	Amount float64            `db:"amount"`
	Value  string             `db:"value"`
}

I have this struct, how i can scan into Game and User?

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.