Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

[sqlgen] Insert: add support for column specification #6

Open
fsouza opened this issue Mar 28, 2012 · 0 comments
Open

[sqlgen] Insert: add support for column specification #6

fsouza opened this issue Mar 28, 2012 · 0 comments

Comments

@fsouza
Copy link
Contributor

fsouza commented Mar 28, 2012

It should be possible to generate an insert statement only for given fields. Something like this:

type Person struct {
    Id int
    Name string
    Age int
}

p := Person{Name:"Francisco", Age:"23"}
sql, _ := sqlgen.Insert(p, "name", "age")

It should generate:

insert into person (name, age) values (?, ?)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant