Simple user management go application using http methods with cockroachdb.
Clone the project
git clone https://github.com/KaranLathiya/http-cockroachdb.gitInstall Go version 1.21
go install 1.21 Install Cockroachdb on local machine
Read the migration.sql
Install dependencies
go mod tidy Start the server
go run main.goTo deploy this project run
go run main.goTo add new user details --POST
http://localhost:8080/user/add
To see all user details --GET
http://localhost:8080/alluserdetails
To see user details with specific ID --GET
http://localhost:8080/user/details
To delete user details with specific ID --DELETE
http://localhost:8080/user/delete
To update user details with specific ID --PUT
http://localhost:8080/user/update
| column_name | data_type | is_nullable | column_default | generation_expression | indices | is_hidden |
|---|---|---|---|---|---|---|
| id | INT8 | f | nextval('public.id_increment'::REGCLASS) | {accounts_name_key,accounts_pkey} | f | |
| name | STRING | f | NULL | {accounts_name_key,accounts_pkey} | f | |
| created_at | TIMESTAMP | f | NULL | {accounts_pkey} | f | |
| updated_at | TIMESTAMP | f | NULL | {accounts_pkey} | f |
| Sequence name | Create Statement |
|---|---|
| id_increment | CREATE SEQUENCE public.id_increment MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1 |