dialect/sql/schema: resource positions: remove unnecessary function a… (#4391)

* dialect/sql/schema: resource positions: remove unnecessary function argument

* fix linter
This commit is contained in:
Jannik Clausen
2025-05-21 15:19:30 +02:00
committed by GitHub
parent c12502dba5
commit eec2a183c0
2 changed files with 3 additions and 6 deletions

View File

@@ -647,9 +647,7 @@ func Dump(ctx context.Context, dialect, version string, tables []*Table, opts ..
}
return ""
}(),
func() string {
return t.Name
}(),
t.Name,
func() string {
if t.View {
return "view"

View File

@@ -6,7 +6,6 @@ package schema
import (
"context"
"fmt"
"strings"
"testing"
@@ -217,7 +216,7 @@ func TestDump(t *testing.T) {
}
tables = []*Table{users, pets, petsWithoutFur, petNames}
my := fmt.Sprintf(strings.ReplaceAll(`-- Add new schema named "s1"
my := strings.ReplaceAll(`-- Add new schema named "s1"
CREATE DATABASE $s1$;
-- Add new schema named "s2"
CREATE DATABASE $s2$;
@@ -243,7 +242,7 @@ CREATE TABLE $s2$.$pets$ (
) CHARSET utf8mb4 COLLATE utf8mb4_bin;
-- Add "pets_without_fur" view
CREATE VIEW $s3$.$pets_without_fur$ ($id$, $name$, $owner_id$) AS SELECT id, name, owner_id FROM pets;
`, "$", "`"))
`, "$", "`")
pg := `-- Add new schema named "s1"
CREATE SCHEMA "s1";