1
0
mirror of https://github.com/ManyakRus/starter.git synced 2025-11-26 23:10:42 +02:00

сделал ReplaceSchemaName()

This commit is contained in:
Nikitin Aleksandr
2025-01-20 15:28:58 +03:00
parent d04cdcf7e1
commit 474c59aed5
2 changed files with 19 additions and 0 deletions

View File

@@ -336,3 +336,13 @@ func TestSetSingularTableNames(t *testing.T) {
t.Errorf("Expected SingularTable to be %v, but got %v", IsSingular, NamingStrategy.SingularTable)
}
}
func TestReplaceSchemaName(t *testing.T) {
TextSQL := "SELECT * FROM public.users"
Settings.DB_SCHEMA = "myschema"
ExpectedSQL := "SELECT * FROM myschema.users"
ActualSQL := ReplaceSchemaName(TextSQL, "public")
if ActualSQL != ExpectedSQL {
t.Errorf("Expected %v, but got %v", ExpectedSQL, ActualSQL)
}
}