1
0
mirror of https://github.com/ManyakRus/starter.git synced 2025-11-28 23:20:10 +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

@@ -562,6 +562,15 @@ func ReplaceSchema(TextSQL string) string {
return Otvet
}
// ReplaceSchemaName - заменяет имя схемы в тексте SQL
func ReplaceSchemaName(TextSQL, SchemaNameFrom string) string {
Otvet := TextSQL
Otvet = strings.ReplaceAll(Otvet, SchemaNameFrom+".", Settings.DB_SCHEMA+".")
return Otvet
}
// ReplaceTemporaryTableNamesToUnique - заменяет "public.TableName" на "public.TableName_UUID"
func ReplaceTemporaryTableNamesToUnique(TextSQL string) string {
Otvet := TextSQL