chore: Implement joins with golang templates (#6429)

* feat: Implement view for workspace builds to include rbac info

* Removes the need to fetch the workspace to run an rbac check.
* chore: Use workspace build as RBAC object
* chore: Use golang templates instead of sqlc files
This commit is contained in:
Steven Masley
2023-03-10 09:44:38 -06:00
committed by GitHub
parent a666539bfa
commit 8b125d6c5d
36 changed files with 894 additions and 660 deletions
+5 -1
View File
@@ -13,12 +13,16 @@ import (
"github.com/coder/coder/coderd/database/postgres"
)
func UsingRealDatabase() bool {
return os.Getenv("DB") != ""
}
func NewDB(t *testing.T) (database.Store, database.Pubsub) {
t.Helper()
db := dbfake.New()
pubsub := database.NewPubsubInMemory()
if os.Getenv("DB") != "" {
if UsingRealDatabase() {
connectionURL := os.Getenv("CODER_PG_CONNECTION_URL")
if connectionURL == "" {
var (