https://github.com/letsila/simple-go-crud
A very simple Go application CRUD (without the U)
https://github.com/letsila/simple-go-crud
crud golang mysql webapps
Last synced: 3 months ago
JSON representation
A very simple Go application CRUD (without the U)
- Host: GitHub
- URL: https://github.com/letsila/simple-go-crud
- Owner: letsila
- Created: 2018-01-09T15:10:49.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-09T15:26:54.000Z (over 7 years ago)
- Last Synced: 2025-01-14T04:12:05.653Z (4 months ago)
- Topics: crud, golang, mysql, webapps
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README #
### What is this repository for? ###
This is a simple Go webapp, just to taste the interaction of MySQL with Go.
### Dependencies ###
You need to install the go-sql-driver from inside your workspace with the following command.
```bash
$ go get -u github.com/go-sql-driver/mysql
```### Database setup ###
This project uses MySQL. Then, you need to specify your database parameters in the `config.json` file at the root of the project folder.
Create a table named "todos" with the following structure.```sql
CREATE TABLE `todos` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT '',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
```### Running ###
From the root of the project, run the following command
```bash
$ go run server.go
```