Skip to content

Commit 99d1bab

Browse files
authored
Proposed solution for issue #37
#37 to solve this issue I had to to replace the following line in column.go , {{if eq $.DbSchema "*" }}table_schema || '.' || {{end}}table_name || '.' || column_name AS compare_name by , {{if eq $.DbSchema "*" }}table_schema || '.' || {{end}}table_name || '.' ||lpad(cast (ordinal_position as varchar), 5, '0')|| column_name AS compare_name this would add up the cardinal position of the column in the sort criteria compare_name leading to correct order
1 parent bb122a4 commit 99d1bab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

column.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var (
2626
func initColumnSqlTemplate() *template.Template {
2727
sql := `
2828
SELECT table_schema
29-
, {{if eq $.DbSchema "*" }}table_schema || '.' || {{end}}table_name || '.' || column_name AS compare_name
29+
, {{if eq $.DbSchema "*" }}table_schema || '.' || {{end}}table_name || '.' ||lpad(cast (ordinal_position as varchar), 5, '0')|| column_name AS compare_name
3030
, table_name
3131
, column_name
3232
, data_type

0 commit comments

Comments
 (0)