Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DebugMode = false
DebugMode is a flag controlling whether generated sql statements and debug information is outputted to the DebugWriter handle
NOTE: This should be disabled in production to avoid leaking sensitive data
var DebugWriter io.Writer = os.Stdout
DebugWriter is where the debug output will be sent if DebugMode is true
Functions ¶
func GetLocation ¶
GetLocation retrieves the global timestamp Location. This is the timezone used by the generated package for the automated setting of created_at and updated_at columns if the package was not generated with the --no-auto-timestamps flag.
func SetDB ¶
func SetDB(db Executor)
SetDB initializes the database handle for all template db interactions
func SetLocation ¶
SetLocation sets the global timestamp Location. This is the timezone used by the generated package for the automated setting of created_at and updated_at columns. If the package was generated with the --no-auto-timestamps flag then this function has no effect.
Types ¶
type Executor ¶
type Executor interface { Exec(query string, args ...interface{}) (sql.Result, error) Query(query string, args ...interface{}) (*sql.Rows, error) QueryRow(query string, args ...interface{}) *sql.Row }
Executor can perform SQL queries.
type Transactor ¶
Transactor can commit and rollback, on top of being able to execute queries.