Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init() error
Init creates the database schema by running all the needed migrations.
func InsertWithID ¶
InsertWithID executes an insert statement and returns the value of the field given by "r". Depending on the database, it uses different ways to do just that.
func JSONBytes ¶
JSONBytes converts a string or a []uint8 to a []byte value. We need this with sqlite and postgresql not returning the same data type for their json fields.
Types ¶
type Connector ¶
type Connector interface { // Dialect returns the connector's dialect Dialect() string // Open creates a new db connection. Open(*url.URL) (*sql.DB, error) // HasTable checks if a given table exists in the // database. It's used by the migration system. HasTable(string) (bool, error) }
Connector is an interface for a database connector.
Click to show internal directories.
Click to hide internal directories.