This file contains hidden or 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
//go:build ignore | |
// +build ignore | |
package main | |
import ( | |
"entgo.io/ent/entc" | |
"entgo.io/ent/entc/gen" | |
"log" | |
) |
This file contains hidden or 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
package datastore | |
import ( | |
"entgo.io/ent/dialect" | |
"github.com/go-sql-driver/mysql" | |
"planetscale-witn-ent/config" | |
"planetscale-witn-ent/ent" | |
) | |
// New returns data source name |
This file contains hidden or 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
package main | |
import ( | |
"context" | |
"log" | |
"planetscale-witn-ent/config" | |
"planetscale-witn-ent/datastore" | |
"planetscale-witn-ent/ent" | |
"planetscale-witn-ent/ent/migrate" | |
) |
This file contains hidden or 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
appEnv: staging | |
database: | |
user: zwol6dt8f5hl | |
password: your password | |
net: tcp | |
addr: fzqo67lk4imj.ap-northeast-2.psdb.cloud | |
dbname: planet-ent-example | |
allowNativePasswords: true | |
params: |
This file contains hidden or 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
package config | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"path" | |
"path/filepath" | |
"runtime" |
This file contains hidden or 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
expect.POST(router.QueryPath).WithJSON(map[string]string{ | |
"query": ` | |
mutation { | |
createUser(input: {name: "Tom1", age: 20}) { | |
age | |
name | |
id | |
createdAt | |
updatedAt | |
} |
This file contains hidden or 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
package repository_test | |
import ( | |
"context" | |
"golang-clean-architecture-ent-gqlgen/ent" | |
"golang-clean-architecture-ent-gqlgen/pkg/adapter/repository" | |
"golang-clean-architecture-ent-gqlgen/pkg/entity/model" | |
"golang-clean-architecture-ent-gqlgen/testutil" | |
"testing" |
This file contains hidden or 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
package testutil | |
import ( | |
"context" | |
"golang-clean-architecture-ent-gqlgen/ent" | |
"golang-clean-architecture-ent-gqlgen/ent/enttest" | |
"golang-clean-architecture-ent-gqlgen/pkg/infrastructure/datastore" | |
"testing" | |
"entgo.io/ent/dialect" |
This file contains hidden or 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
package testutil | |
import ( | |
"golang-clean-architecture-ent-gqlgen/config" | |
"golang-clean-architecture-ent-gqlgen/pkg/util/environment" | |
) | |
// ReadConfig reads config file for test. | |
func ReadConfig() { | |
config.ReadConfig(config.ReadConfigOption{ |
This file contains hidden or 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
#!/bin/bash | |
cd docker || exit | |
docker compose cp ./mysql_data/sql mysql:/var/lib/mysql/ | |
docker compose exec mysql bash -c "mysql -uroot -proot < /var/lib/mysql/sql/reset_database.test.sql" |