Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions db_changes/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@ func (l *Loader) getTablesFromSchema(schemaName string) (map[[2]string][]*sql.Co
ORDER BY table_schema, table_name
`

if l.dsn.Driver() == "clickhouse" {
query = `
SELECT database AS table_schema, name AS table_name
FROM system.tables
WHERE database = ?
AND engine NOT IN ('View', 'MaterializedView', 'Buffer')
ORDER BY table_schema, table_name
`
}

rows, err := l.DB.Query(query, schemaName)
if err != nil {
return nil, fmt.Errorf("querying tables: %w", err)
Expand Down
4 changes: 0 additions & 4 deletions db_changes/db/dsn.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ func (c *DSN) ConnString() string {
// In the old code, of there was options set and the host was localhost, we were switching
// to host 127.0.0.1 + change of scheme to http/https, let's keep that for now
host = "127.0.0.1"
scheme = "http"
if c.Options.Get("secure") == "true" {
scheme = "https"
}
}

baseURL := fmt.Sprintf("%s://%s:%s@%s:%d/%s", scheme, c.Username, c.Password, host, c.Port, c.Database)
Expand Down
Loading