@@ -36,9 +36,13 @@ import (
36
36
_ "github.com/spf13/cobra"
37
37
)
38
38
39
+ const (
40
+ DUTY_DB_CREATE = "DUTY_DB_CREATE"
41
+ DUTY_DB_DISABLE_RLS = "DUTY_DB_DISABLE_RLS"
42
+ )
43
+
39
44
// Env vars for embedded db
40
45
const (
41
- DUTY_DB_CREATE = "DUTY_DB_CREATE"
42
46
DUTY_DB_DATA_DIR = "DUTY_DB_DATA_DIR"
43
47
DUTY_DB_URL = "DUTY_DB_URL"
44
48
TEST_DB_PORT = "TEST_DB_PORT"
@@ -99,7 +103,11 @@ func MustDB() *sql.DB {
99
103
var WithoutRLS = "rls_disabled"
100
104
var WithoutDummyData = "without_dummy_data"
101
105
var WithExistingDatabase = "with_existing_database"
102
- var recreateDatabase = os .Getenv (DUTY_DB_CREATE ) != "false"
106
+
107
+ var (
108
+ recreateDatabase = os .Getenv (DUTY_DB_CREATE ) != "false"
109
+ disableRLS = os .Getenv (DUTY_DB_DISABLE_RLS ) == "true"
110
+ )
103
111
104
112
func findFileInPath (filename string , depth int ) string {
105
113
if ! path .IsAbs (filename ) {
@@ -139,7 +147,6 @@ func SetupDB(dbName string, args ...interface{}) (context.Context, error) {
139
147
defer telemetry .InitTracer ()
140
148
141
149
importDummyData := true
142
- disableRLS := false
143
150
dbOptions := []duty.StartOption {duty .DisablePostgrest , duty .RunMigrations }
144
151
for _ , arg := range args {
145
152
if arg == WithoutDummyData {
0 commit comments