Skip to content

Commit 0d17097

Browse files
committed
Refactor: dialect/oracle: move SQLs from main.go to *.sql using "embed"
1 parent 0229adb commit 0d17097

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

dialect/oracle/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ import (
1010
"github.com/hymkor/sqlbless/dialect"
1111
)
1212

13+
//go:embed tables.sql
14+
var tablesSql string
15+
1316
//go:embed columns.sql
1417
var columnsSql string
1518

1619
var oracleSpec = &dialect.Entry{
1720
Usage: "sqlbless oracle://<USERNAME>:<PASSWORD>@<HOSTNAME>:<PORT>/<SERVICE>",
1821
SQLForColumns: columnsSql,
19-
SQLForTables: `select * from tab where tname not like 'BIN$%'`,
22+
SQLForTables: tablesSql,
2023
TypeConverterFor: typeNameToConv,
2124
TableNameField: "tname",
2225
ColumnNameField: "name",

dialect/oracle/tables.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
select *
2+
from tab
3+
where tname not like 'BIN$%'

0 commit comments

Comments
 (0)