update backend
This commit is contained in:
@ -39,11 +39,11 @@ func main() {
|
||||
// (a) 参数版:用 $1
|
||||
paramQ := strings.Replace(base, "%s", "$1", 1)
|
||||
fmt.Println("=== (a) 参数版 $1 ===")
|
||||
testQ(db, paramQ, "brand")
|
||||
testQ(db, paramQ, "brands")
|
||||
|
||||
// (b) 内联版:把 'brand' 直接拼进 SQL(模拟 simple-protocol 内联)
|
||||
inlineQ := strings.Replace(base, "%s", "'brand'", 1)
|
||||
fmt.Println("=== (b) 内联版 'brand' ===")
|
||||
// (b) 内联版:把 'brands' 直接拼进 SQL(模拟 simple-protocol 内联)
|
||||
inlineQ := strings.Replace(base, "%s", "'brands'", 1)
|
||||
fmt.Println("=== (b) 内联版 'brands' ===")
|
||||
testQ(db, inlineQ)
|
||||
|
||||
// (c) 去掉 LIKE 表达式的版本(用 is_identity 代替)
|
||||
@ -54,7 +54,7 @@ func main() {
|
||||
COALESCE(c.column_default, ''),
|
||||
(c.is_identity = 'YES')
|
||||
FROM information_schema.columns c
|
||||
WHERE c.table_schema = 'public' AND c.table_name = 'brand'
|
||||
WHERE c.table_schema = 'public' AND c.table_name = 'brands'
|
||||
ORDER BY c.ordinal_position`
|
||||
fmt.Println("=== (c) 去掉 LIKE 表达式版 ===")
|
||||
testQ(db, noLike)
|
||||
|
||||
Reference in New Issue
Block a user