diff --git a/example/redshift/main.go b/example/redshift/main.go index e4d20cf..4387a7c 100644 --- a/example/redshift/main.go +++ b/example/redshift/main.go @@ -4,21 +4,23 @@ import ( "database/sql" "fmt" + "github.com/thesaas-company/xray" "github.com/thesaas-company/xray/config" - "github.com/thesaas-company/xray/databases/redshift" "github.com/thesaas-company/xray/types" ) func main() { // Define the configuration for the Redshift instance cfg := &config.Config{ - Region: "my-region-us-west-2", - AccountID: "123456789012", - SecretName: "my-secret", + Host: "default-workgroup.609973658768.ap-south-1.redshift-serverless.amazonaws.com", + DatabaseName: "dev", + Username: "admin", + Port: "5439", + SSL: "require", } // Create a new Redshift instance - rs, err := redshift.NewRedshiftWithConfig(cfg) + rs, err := xray.NewClientWithConfig(cfg,types.Redshift) if err != nil { fmt.Printf("Error creating Redshift instance: %v\n", err) return @@ -54,7 +56,7 @@ func main() { res := rs.GenerateCreateTableQuery(table) fmt.Println(res) - query := "SELECT * FROM my_table" + query := "SELECT * FROM sales limit 10" result, err := rs.Execute(query) if err != nil { fmt.Printf("Error executing query: %v\n", err) diff --git a/go.sum b/go.sum index 0395514..efb8068 100644 --- a/go.sum +++ b/go.sum @@ -467,6 +467,7 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= + github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns=