postgres-switch-for-tests #255
Reference in New Issue
Block a user
Delete Branch "postgres-switch-for-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
also resolves #119
WIP: postgres-switch-for-teststo postgres-switch-for-testsI am wondering, since this affects the connection string, whether we should merge in the other PR into this one first.
@@ -27,3 +29,3 @@func init() {initializers.LoadEnvVariables()initializers.LoadEnvVariables(baseDir)I don't think we want to use the
testdataloaderpackage in main. Let's remove the basedir, and if needed using a different env/config file should be a matter of switches.@@ -88,6 +89,11 @@ func (ms *MenuStorageService) getOrCreateDb(ctx context.Context, existingDb db.Dreturn nil, fmt.Errorf("failed to select the database")}schema, ok := ctx.Value("Schema").(string)can we try to use the connection string instead of context, if it works? https://github.com/jackc/pgx/issues/1013
it fits better with the connection string refactor that I will merge this into afterwards.
@@ -101,0 +105,4 @@connStr := BuildConnStr()// Ensure the schema existserr = ensureSchemaExists(ctx, connStr, schema)If we are using connection string, then this needs to be url parsed to get the query string in order to determine the schema.