Skip to content

Commit

Permalink
chore: google idx setup
Browse files Browse the repository at this point in the history
  • Loading branch information
shihabmridha committed Jun 13, 2024
1 parent 2e2f2c4 commit 6688ee0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
_tmp
_testdata
.idx/.data
build
.env
26 changes: 26 additions & 0 deletions .idx/dev.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# To learn more about how to use Nix to configure your environment
# see: https://developers.google.com/idx/guides/customize-idx-env
{ pkgs, ... }: {
# Which nixpkgs channel to use.
channel = "stable-23.11"; # or "unstable"

# Use https://search.nixos.org/packages to find packages
packages = [
pkgs.go
pkgs.gnumake
pkgs.air
pkgs.goose
];

# Sets environment variables in the workspace
env = {};
idx = {
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
extensions = [
"golang.go"
"rangav.vscode-thunder-client"
];
};

services.mysql.enable = true;
}
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ build:
go ${command}

mg-status:
goose -dir migrations mysql "${DB_USERNAME}:${DB_PASSWORD}@tcp(${DB_HOST}:${DB_PORT})/${DB_NAME}?parseTime=true&tls=skip-verify&multiStatements=true" status
goose -dir migrations mysql "${DB_USERNAME}@tcp(${DB_HOST}:${DB_PORT})/${DB_NAME}?parseTime=true&tls=false&multiStatements=true" status

mg-new:
goose -dir migrations create ${name} sql

mg-up:
goose -dir migrations mysql "${DB_USERNAME}:${DB_PASSWORD}@tcp(${DB_HOST}:${DB_PORT})/${DB_NAME}?parseTime=true&tls=skip-verify&multiStatements=true" up
goose -dir migrations mysql "${DB_USERNAME}:${DB_PASSWORD}@tcp(${DB_HOST}:${DB_PORT})/${DB_NAME}?parseTime=true&tls=false&multiStatements=true" up

mg-down:
goose -dir migrations mysql "${DB_USERNAME}:${DB_PASSWORD}@tcp(${DB_HOST}:${DB_PORT})/${DB_NAME}?parseTime=true&tls=skip-verify&multiStatements=true" down
goose -dir migrations mysql "${DB_USERNAME}:${DB_PASSWORD}@tcp(${DB_HOST}:${DB_PORT})/${DB_NAME}?parseTime=true&tls=false&multiStatements=true" down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/shihabmridha/golang-app-template

go 1.22.1
go 1.22.3

require (
github.com/go-chi/chi/v5 v5.0.12
Expand Down

0 comments on commit 6688ee0

Please sign in to comment.