Skip to content
This repository was archived by the owner on Jul 15, 2025. It is now read-only.
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
17 changes: 17 additions & 0 deletions driver/cassandra/cassandra.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,23 @@ func (driver *Driver) Initialize(rawurl string) error {
if _, ok := u.Query()["disable_init_host_lookup"]; ok {
cluster.DisableInitialHostLookup = true
}
if _, ok := u.Query()["ignore_peer_addr"]; ok {
cluster.IgnorePeerAddr = true
}
if msStr, ok := u.Query()["connect_timeout"]; ok && len(msStr) >= 0 {
if i, err := strconv.ParseInt(msStr[0], 10, 64); err == nil {
cluster.ConnectTimeout = time.Millisecond * time.Duration(i)
} else {
return fmt.Errorf("the 'connect_timeout' argument for cassandra must be a numeric number of milliseconds. Error: %v", err)
}
}
if msStr, ok := u.Query()["timeout"]; ok && len(msStr) >= 0 {
if i, err := strconv.ParseInt(msStr[0], 10, 64); err == nil {
cluster.Timeout = time.Millisecond * time.Duration(i)
} else {
return fmt.Errorf("the 'timeout' argument for cassandra must be a numeric number of milliseconds. Error: %v", err)
}
}

// Check if url user struct is null
if u.User != nil {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"github.com/fatih/color"
_ "github.com/gemnasium/migrate/driver/bash"
_ "github.com/gemnasium/migrate/driver/cassandra"
_ "github.com/oliverkofoed/migrate/driver/cassandra"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will create unexpected issues :)

_ "github.com/gemnasium/migrate/driver/crate"
_ "github.com/gemnasium/migrate/driver/mysql"
_ "github.com/gemnasium/migrate/driver/postgres"
Expand Down