On Wed, Aug 21, 2013 at 10:17 PM, Daniel Theophanes <
kard...@gmail.com> wrote:
> I would stick with things like Stored procedures and shun ORMs. Things you
> can use:
> Alex's odbc driver:
https://code.google.com/p/odbc/
> Multi-line literals can be useful sometimes (back-tick) `.
> PostgreSQL is also a good database with good documentation and good go
> drivers:
github.com/bmizerany/pq
>
Can anyone pass me an example where the INSERT INTO query returns back
the last inserted row id ? I was trying with
ret, err := db.Exec("INSERT INTO components (name, description,
product_id, cowner) VALUES ($1, $2, $3, $4) RETURNING id", name, desc,
product_id, owner)
if err == nil {
rid, err := ret.LastInsertId()
fmt.Println(rid)
}
I tried the above given driver and also
github.com/lib/pq driver.
Kushal