Documentation ¶
Index ¶
- Constants
- func CreatePersonTable(db *sql.DB) (sql.Result, error)
- func DeletePerson(db *sql.DB, firstName, lastName string, age uint) error
- func InsertPerson(db *sql.DB, person Person) (sql.Result, error)
- func SelectPerson(db *sql.DB, firstName, lastName string, age uint, result *Person) error
- func UpdatePerson(db *sql.DB, firstName, lastName string, age uint, newPerson Person) error
- type Person
Constants ¶
View Source
const ( // PersonTableName is the name of the table for the person model PersonTableName = "person" // PersonFirstNameCol is the column name of the model's first name PersonFirstNameCol = "first_name" // PersonLastNameCol is the column name of the model's last name PersonLastNameCol = "last_name" // PersonAgeCol is the column name of the model's age PersonAgeCol = "age" )
Variables ¶
This section is empty.
Functions ¶
func CreatePersonTable ¶
CreatePersonTable uses db to create a new table for Person models, and returns the result
func DeletePerson ¶
DeletePerson deletes the person with the given first & last names and age. Returns a non-nil error if the delete failed, and nil if the delete succeeded
func InsertPerson ¶
InsertPerson inserts person into db
func SelectPerson ¶
SelectPerson selects a person with the given first & last names and age. On success, writes the result into result and on failure, returns a non-nil error and makes no modifications to result
Types ¶
Click to show internal directories.
Click to hide internal directories.