/
githubmirror
/
sqlc
Обзор
Документация
Войти
/
githubmirror
/
sqlc
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
internal/codegen/sdk/sdk.go
33 строки
690 B
Kyle Gray
feat(codegen): Remove Go specific overrides from codegen proto (#2929)
31 окт 2023, 21:36
Не верифицирован
31 окт 2023, 21:36
d9e233e
Код
Авторство
О чём код?
package sdk import ( "github.com/sqlc-dev/sqlc/internal/pattern" "github.com/sqlc-dev/sqlc/internal/plugin" ) func DataType(n *plugin.Identifier) string { if n.Schema != "" { return n.Schema + "." + n.Name } else { return n.Name } } func MatchString(pat, target string) bool { matcher, err := pattern.MatchCompile(pat) if err != nil { panic(err) } return matcher.MatchString(target) } func SameTableName(tableID, f *plugin.Identifier, defaultSchema string) bool { if tableID == nil { return false } schema := tableID.Schema if tableID.Schema == "" { schema = defaultSchema } return tableID.Catalog == f.Catalog && schema == f.Schema && tableID.Name == f.Name }