Re:Show HN: Book about writing web apps in Go without a fram...
by bezzi on Friday August 05, 2016 @11:54AM
(#12233263)
Don't you think that teaching how to use it with mysql or postegres would be more useful than sqlite?
[ Parent
| on HN ]
Re:Show HN: Book about writing web apps in Go without a fram...
by thewhitetulip on Friday August 05, 2016 @01:27PM
(#12234160)
Well, as others have pointed out, sqlite is simple and easy to use, that way we can work on the core functions of the app rather than having to worry about the database.
Also, as far as Go language is concerned, we do not really have to worry about the underlying database, the code, as others have rightly pointed out, is totally reusable
Re:Show HN: Book about writing web apps in Go without a fram...
by ianleeclark on Friday August 05, 2016 @12:06PM
(#12233382)
That seems a bit overkill. With telling a user how to use mysql/postgres/&c., there will also be questions about setting up these systems, so it seems that "just use sqlite" is a valid path if you're just wanting to go over basic usage.
Re:Show HN: Book about writing web apps in Go without a fram...
by thewhitetulip on Friday August 05, 2016 @01:37PM
(#12234244)
totally agree. +1
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.
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.
Re:Show HN: Book about writing web apps in Go without a fram...
by IndianAstronaut on Friday August 05, 2016 @12:13PM
(#12233445)
I would second this. One big issue I faced with Go is the lack of fb connectors. Had to scrap one project because of no Teradata connectivity.
Re:Show HN: Book about writing web apps in Go without a fram...
by Bromlife on Friday August 05, 2016 @09:59PM
(#12236702)
I would also think that BoltDB would be better than SQLite