Skip to content

Commit 4f32d19

Browse files
committed
Removed pgsql helpers.
1 parent c7c00fc commit 4f32d19

3 files changed

Lines changed: 1 addition & 34 deletions

File tree

sqlparser/parser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919

2020
var (
2121
templateRoutineName string = "\ndeclare @RoutineName nvarchar(128)\nset @RoutineName = '%s'\n"
22-
supportedSqlExtensions []string = []string{".sql", ".pgsql"}
22+
supportedSqlExtensions []string = []string{".sql"}
2323
// consider something a "sqlcode source file" if it contains [code]
2424
// or a --sqlcode: header
2525
isSqlCodeRegex = regexp.MustCompile(`^--sqlcode:|\[code\]`)

sqlparser/parser_test.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"testing"
66
"testing/fstest"
77

8-
"github.com/jackc/pgx/v5/stdlib"
98
"github.com/stretchr/testify/assert"
109
"github.com/stretchr/testify/require"
1110
)
@@ -178,28 +177,6 @@ create procedure NotInCodeSchema.Test as begin end`),
178177
assert.NotEmpty(t, doc.Errors())
179178
})
180179

181-
t.Run("handles pgsql extension", func(t *testing.T) {
182-
fsys := fstest.MapFS{
183-
"test.pgsql": &fstest.MapFile{
184-
Data: []byte(`
185-
create procedure [code].test()
186-
language plpgsql
187-
as $$
188-
begin
189-
perform 1;
190-
end;
191-
$$;
192-
`),
193-
},
194-
}
195-
196-
filenames, doc, err := ParseFilesystems([]fs.FS{fsys}, nil)
197-
require.NoError(t, err)
198-
assert.Len(t, filenames, 1)
199-
assert.Len(t, doc.Creates(), 1)
200-
assert.Equal(t, &stdlib.Driver{}, doc.Creates()[0].Driver)
201-
})
202-
203180
t.Run("empty filesystem returns empty results", func(t *testing.T) {
204181
fsys := fstest.MapFS{}
205182

sqltest/fixture.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,6 @@ func (f *Fixture) RunMigrationFile(filename string) {
197197
}
198198
}
199199

200-
func (f *Fixture) RunIfPostgres(t *testing.T, name string, fn func(t *testing.T)) {
201-
t.Run("pgsql", func(t *testing.T) {
202-
if f.IsPostgresql() {
203-
t.Run(name, fn)
204-
} else {
205-
t.Skip()
206-
}
207-
})
208-
}
209-
210200
func (f *Fixture) RunIfMssql(t *testing.T, name string, fn func(t *testing.T)) {
211201
t.Run("mssql", func(t *testing.T) {
212202
if f.IsSqlServer() {

0 commit comments

Comments
 (0)