Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(codegen): Port Go to plugin types (#1460)
* convert to spaces in proto, fix up insert_into_table * remove use of core.FQN from sameTableName
- Loading branch information
Showing
17 changed files
with
1,045 additions
and
450 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
package golang | ||
|
||
import ( | ||
"github.com/kyleconroy/sqlc/internal/core" | ||
"github.com/kyleconroy/sqlc/internal/sql/ast" | ||
"github.com/kyleconroy/sqlc/internal/plugin" | ||
) | ||
|
||
func sameTableName(n *ast.TableName, f core.FQN, defaultSchema string) bool { | ||
if n == nil { | ||
func sameTableName(tableID, f *plugin.Identifier, defaultSchema string) bool { | ||
if tableID == nil { | ||
return false | ||
} | ||
schema := n.Schema | ||
if n.Schema == "" { | ||
schema := tableID.Schema | ||
if tableID.Schema == "" { | ||
schema = defaultSchema | ||
} | ||
return n.Catalog == f.Catalog && schema == f.Schema && n.Name == f.Rel | ||
return tableID.Catalog == f.Catalog && schema == f.Schema && tableID.Name == f.Name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.