Re:Show HN: Book about writing web apps in Go without a fram...
by astockwell on Friday August 05, 2016 @12:19PM
(#12233497)
The code is typically identical/reusable, it's all using the same stdlib database package. The only two lines that would change would be the import (import a mysql or postgres driver instead of sqlite) and the database handle - `db, err := sql.Open("sqlite3", "./newtask.db")` would become something like `db, err := sql.Open("postgres", "user=pqgotest dbname=pqgotest sslmode=verify-full")`. One of the many bright spots of Go.
[ Parent
| on HN ]
Re:Show HN: Book about writing web apps in Go without a fram...
by joncalhoun on Friday August 05, 2016 @12:50PM
(#12233822)
There are a few more use cases where it changes with postgres iirc and a few are not obvious.
For example the Result type's LastInsertId() method doesnt work in a few cases for postgres that it does for others.