Skip to content

Commit 485ab48

Browse files
committed
Add Makefile
1 parent 8c0c3f6 commit 485ab48

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Build the default binary
2+
build:
3+
go build
4+
# Build a static binary
5+
build-static:
6+
go build -a -tags osusergo,netgo -ldflags '-w -extldflags "-static"' -o harbourbridge main.go
7+
# Run unit tests
8+
test:
9+
go test -v ./...
10+
# Run code coverage with unit tests
11+
test-coverage:
12+
go test ./... -coverprofile coverage.out -covermode count
13+
go tool cover -func coverage.out

conversion/conversion.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,7 @@ var (
7474
const migrationMetadataKey = "cloud-spanner-migration-metadata"
7575

7676
// SchemaConv performs the schema conversion
77-
// TODO: Pass around cmd.SourceProfile instead of sqlConnectionStr and schemaSampleSize.
78-
// Doing that requires refactoring since that would introduce a circular dependency between
79-
// conversion.go and cmd/source_profile.go.
80-
// The sqlConnectionStr param provides the connection details to use the go SQL library.
81-
// It is empty in the following cases:
82-
// - Driver is DynamoDB or a dump file mode.
83-
// - This function is called as part of the legacy global CLI flag mode. (This string is constructed from env variables later on)
84-
// When using source-profile, the sqlConnectionStr is constructed from the input params.
77+
// The SourceProfile param provides the connection details to use the go SQL library.
8578
func SchemaConv(sourceProfile profiles.SourceProfile, targetProfile profiles.TargetProfile, ioHelper *utils.IOStreams) (*internal.Conv, error) {
8679
switch sourceProfile.Driver {
8780
case constants.POSTGRES, constants.MYSQL, constants.DYNAMODB, constants.SQLSERVER, constants.ORACLE:
@@ -94,11 +87,7 @@ func SchemaConv(sourceProfile profiles.SourceProfile, targetProfile profiles.Tar
9487
}
9588

9689
// DataConv performs the data conversion
97-
// The sqlConnectionStr param provides the connection details to use the go SQL library.
98-
// It is empty in the following cases:
99-
// - Driver is DynamoDB or a dump file mode.
100-
// - This function is called as part of the legacy global CLI flag mode. (This string is constructed from env variables later on)
101-
// When using source-profile, the sqlConnectionStr and schemaSampleSize are constructed from the input params.
90+
// The SourceProfile param provides the connection details to use the go SQL library.
10291
func DataConv(ctx context.Context, sourceProfile profiles.SourceProfile, targetProfile profiles.TargetProfile, ioHelper *utils.IOStreams, client *sp.Client, conv *internal.Conv, dataOnly bool, writeLimit int64) (*writer.BatchWriter, error) {
10392
config := writer.BatchWriterConfig{
10493
BytesLimit: 100 * 1000 * 1000,

0 commit comments

Comments
 (0)