diff --git a/.github/workflows/test-scylladb.yml b/.github/workflows/test-scylladb.yml index c76def0d..a8c8e590 100644 --- a/.github/workflows/test-scylladb.yml +++ b/.github/workflows/test-scylladb.yml @@ -32,7 +32,7 @@ jobs: - name: Create Default Keyspace run: | - docker exec -it scylladb cqlsh -e "CREATE KEYSPACE IF NOT EXISTS scylla_db WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1};" + docker exec --tty scylladb cqlsh -e "CREATE KEYSPACE IF NOT EXISTS scylla_db WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1};" - name: Install Go uses: actions/setup-go@v4 diff --git a/scylladb/README.md b/scylladb/README.md index 357a210d..0d614ccc 100644 --- a/scylladb/README.md +++ b/scylladb/README.md @@ -42,11 +42,10 @@ store := scylladb.New() // Initialize custom config store := scylladb.New(scylladb.Config{ - Host: "127.0.0.1", - Port: 9042, - Database: "fiber", - Collection: "fiber_storage", - Reset: false, + Hosts: []string{"127.0.0.1"}, + Keyspace: "fiber_keyspace", + Consistency: "ONE", + Table: "fiber_table", }) @@ -55,15 +54,10 @@ store := scylladb.New(scylladb.Config{ ### Config ```go type Config struct { - // Host name where the DB is hosted + // Hosts name where the DB is hosted // // Optional. Default is "127.0.0.1" - Host string - - // Port where the DB is listening on - // - // Optional. Default is 9042 - Port int + Hosts []string // Server username // @@ -80,6 +74,11 @@ type Config struct { // Optional. Default is "scylladb_db" Keyspace string + // Level of the consistency + // + // Optional. Default is "LOCAL_ONE" + Consistency string + // Number of replication // // Optional. Default 1 @@ -100,12 +99,12 @@ type Config struct { ### Default Config ```go var ConfigDefault = Config{ - Host: "127.0.0.1", - Port: 9042, - Username: "", - Password: "", - Table: "scylladb_table", - Keyspace: "scylladb_db", - ReplicationFactor: 1, + Hosts: []string{"172.0.0.1"}, + Username: "", + Password: "", + Table: "scylla_table", + Keyspace: "scylla_db", + Consistency: "LOCAL_ONE", + ReplicationFactor: 1, } ``` diff --git a/scylladb/config.go b/scylladb/config.go index cb3b5d35..f9d7b682 100644 --- a/scylladb/config.go +++ b/scylladb/config.go @@ -43,7 +43,7 @@ type Config struct { } var ConfigDefault = Config{ - Hosts: []string{"172.19.0.10"}, + Hosts: []string{"172.0.0.1"}, Username: "", Password: "", Table: "scylla_table",