revel/examples

Hotel Booking Example : how to compile sqlite3

Closed this issue · 2 comments

I am trying to run the revel example "Hotel Booking".
The information on the example page are not mentioning how to install sqlite, and I am facing some problems. (the sqlite3 page is not very helpfull either). I have gcc on my machine
It tried to install go sqlite, but It is not working :

go get github.com/mattn/go-sqlite3

github.com/mattn/go-sqlite3

../../../mattn/go-sqlite3/sqlite3_go18.go:26: undefined: driver.NamedValue
../../../mattn/go-sqlite3/sqlite3_go18.go:35: undefined: driver.NamedValue
../../../mattn/go-sqlite3/sqlite3_go18.go:49: undefined: driver.TxOptions
../../../mattn/go-sqlite3/sqlite3_go18.go:54: undefined: driver.NamedValue
../../../mattn/go-sqlite3/sqlite3_go18.go:63: undefined: driver.NamedValue


Then of course when I run the app I get errors:

ERROR 14:08:42 revel build.go:146: # gopkg.in/Masterminds/squirrel.v1
../../../../gopkg.in/Masterminds/squirrel.v1/squirrel_ctx.go:36: r.DB.QueryRowContext undefined (type *sql.DB has no field or method QueryRowContext)
../../../../gopkg.in/Masterminds/squirrel.v1/squirrel_ctx.go:40: r.Tx.QueryRowContext undefined (type *sql.Tx has no field or method QueryRowContext)
../../../../gopkg.in/Masterminds/squirrel.v1/stmtcacher.go:80: cannot use db (type *sql.DB) as type PreparerContext in argument to NewStmtCacher:
*sql.DB does not implement PreparerContext (missing PrepareContext method)
../../../../gopkg.in/Masterminds/squirrel.v1/stmtcacher_ctx.go:57: stmt.ExecContext undefined (type *sql.Stmt has no field or method ExecContext)
../../../../gopkg.in/Masterminds/squirrel.v1/stmtcacher_ctx.go:57: not enough arguments to return
../../../../gopkg.in/Masterminds/squirrel.v1/stmtcacher_ctx.go:65: stmt.QueryContext undefined (type *sql.Stmt has no field or method QueryContext)
../../../../gopkg.in/Masterminds/squirrel.v1/stmtcacher_ctx.go:65: not enough arguments to return
../../../../gopkg.in/Masterminds/squirrel.v1/stmtcacher_ctx.go:73: stmt.QueryRowContext undefined (type *sql.Stmt has no field or method QueryRowContext)

github.com/go-sql-driver/mysql

../../../go-sql-driver/mysql/connection_go18.go:43: undefined: driver.TxOptions
../../../go-sql-driver/mysql/connection_go18.go:55: undefined: sql.IsolationLevel
../../../go-sql-driver/mysql/connection_go18.go:55: undefined: sql.LevelDefault
../../../go-sql-driver/mysql/connection_go18.go:69: undefined: driver.NamedValue
../../../go-sql-driver/mysql/connection_go18.go:88: undefined: driver.NamedValue
../../../go-sql-driver/mysql/connection_go18.go:122: undefined: driver.NamedValue
../../../go-sql-driver/mysql/connection_go18.go:141: undefined: driver.NamedValue
../../../go-sql-driver/mysql/utils_go18.go:21: c.Clone undefined (type *tls.Config has no field or method Clone, but does have tls.clone)
../../../go-sql-driver/mysql/utils_go18.go:24: undefined: driver.NamedValue
../../../go-sql-driver/mysql/utils_go18.go:36: undefined: driver.IsolationLevel
../../../go-sql-driver/mysql/utils_go18.go:21: too many errors

github.com/lib/pq

../../../lib/pq/conn_go18.go:15: undefined: driver.NamedValue
../../../lib/pq/conn_go18.go:33: undefined: driver.NamedValue
../../../lib/pq/conn_go18.go:47: undefined: driver.TxOptions
../../../lib/pq/conn_go18.go:50: undefined: sql.IsolationLevel
../../../lib/pq/conn_go18.go:51: undefined: sql.LevelDefault
../../../lib/pq/conn_go18.go:53: undefined: sql.LevelReadUncommitted
../../../lib/pq/conn_go18.go:55: undefined: sql.LevelReadCommitted
../../../lib/pq/conn_go18.go:57: undefined: sql.LevelRepeatableRead
../../../lib/pq/conn_go18.go:59: undefined: sql.LevelSerializable

github.com/mattn/go-sqlite3

../../../mattn/go-sqlite3/sqlite3_go18.go:26: undefined: driver.NamedValue
../../../mattn/go-sqlite3/sqlite3_go18.go:35: undefined: driver.NamedValue
../../../mattn/go-sqlite3/sqlite3_go18.go:49: undefined: driver.TxOptions
../../../mattn/go-sqlite3/sqlite3_go18.go:54: undefined: driver.NamedValue
../../../mattn/go-sqlite3/sqlite3_go18.go:63: undefined: driver.NamedValue

I got it to work by login as root.