Created
June 22, 2018 08:47
-
-
Save kitz99/24738df4ba8b31f979b2c79e8c67bc60 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func createRecord(post Post) error { | |
qryString := fmt.Sprintf( | |
"INSERT INTO posts (name, category, author, created_at, updated_at) VALUES ('%s', '%s', '%s', NOW(), NOW())", | |
post.Name, post.Category, post.Author) | |
_, err := roachConnection.Exec(qryString) | |
return err | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment