-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Bring back cassandra adapter using gocqlx v2 #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
1cfe625
8c2d538
2306e62
97c8d10
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,28 +62,43 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| needs: lint | ||
| timeout-minutes: 10 | ||
| # services: | ||
| # cassandra: | ||
| # image: cassandra:5 # Use a specific version if needed | ||
| # ports: | ||
| # - 9042:9042 | ||
| # options: >- | ||
| # --hostname cassandra | ||
| # --health-cmd "cqlsh --debug -e 'DESCRIBE KEYSPACES' || exit 1" | ||
| # --health-interval 10s | ||
| # --health-timeout 5s | ||
| # --health-retries 7 | ||
| services: | ||
| cassandra: | ||
| image: cassandra:5@sha256:1614e9d798651aa0c57adb1be04a6e6e07fcc4661334dc77393d7844ce51ec27 | ||
| ports: | ||
| - 9042:9042 | ||
| options: >- | ||
| --hostname cassandra | ||
| --health-cmd "cqlsh --debug -e 'DESCRIBE KEYSPACES' || exit 1" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 7 | ||
| cosmosdb: | ||
| image: mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview@sha256:10272f84fb9f39eadce9bfd6705d48f3080f6d353fdab753de01fbf9cbaaa156 | ||
| ports: | ||
| - 8081:8081 | ||
| env: | ||
| ENABLE_EXPLORER: "false" | ||
| options: >- | ||
| --hostname cosmosdb | ||
| --health-cmd "curl -f http://localhost:8080/ready" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 7 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| with: | ||
| fetch-depth: 1 | ||
| - uses: actions/setup-go@v5 | ||
| - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 | ||
| with: | ||
| go-version: '1.25.3' | ||
| cache: true | ||
| - name: Run tests | ||
| run: go test -v -cover ./... | ||
| # env: | ||
| # CASSANDRA_HOSTS: "localhost" | ||
| # CASSANDRA_KEYSPACE: "testkeyspace" | ||
| env: | ||
| CASSANDRA_HOSTS: "localhost" | ||
| CASSANDRA_KEYSPACE: "testkeyspace" | ||
| COSMOSDB_ENDPOINT: "http://localhost:8081/" | ||
| COSMOSDB_KEY: "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGg==" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit-pick: worth adding a comment here (and in storage_test.go) to ack that this is indeed an emulator key to prevent security scans/reviews etc from flagging this unnescessarily |
||
| COSMOSDB_DATABASE: "magic" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,7 +50,7 @@ func main() { | |
| // "database": "magic", | ||
| // } | ||
|
|
||
| // config := map[string]string{ | ||
| // config = map[string]string{ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent variable declaration pattern across provider examples. The Cassandra configuration example now uses
For clarity and consistency, standardize all commented provider examples to use the same pattern. Recommendation: Either make all examples use ♻️ Proposed fix for consistencyOption 1: Make all provider examples use - // config := map[string]string{
+ // config = map[string]string{
// "provider": "postgresql",
// "host": "host.docker.internal",- // config := map[string]string{
+ // config = map[string]string{
// "provider": "dynamodb",
// "region": "us-west-2",- // config := map[string]string{
+ // config = map[string]string{
// "provider": "cosmosdb",
// "endpoint": "https://your-cosmosdb-account.documents.azure.com:443/",Option 2: Make all provider examples use - config := map[string]string{}
+ // config := map[string]string{}- // config = map[string]string{
+ // config := map[string]string{
// "provider": "cassandra",
// "endpoint": "localhost",🤖 Prompt for AI Agents |
||
| // "provider": "cassandra", | ||
| // "endpoint": "localhost", | ||
| // "keyspace": "todo", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,13 +11,14 @@ require ( | |
| github.com/aws/aws-sdk-go-v2/credentials v1.19.12 | ||
| github.com/aws/aws-sdk-go-v2/service/dynamodb v1.56.2 | ||
| github.com/aws/aws-sdk-go-v2/service/sns v1.39.11 | ||
| github.com/gocql/gocql v1.7.0 | ||
| github.com/grindlemire/go-lucene v0.0.26 | ||
| github.com/scylladb/go-reflectx v1.0.1 | ||
| github.com/scylladb/gocqlx/v2 v2.8.0 | ||
| gopkg.in/yaml.v3 v3.0.1 | ||
| gorm.io/gorm v1.31.1 | ||
| ) | ||
|
|
||
| // replace github.com/gocql/gocql => github.com/scylladb/gocql v1.17.0 | ||
|
|
||
| require ( | ||
| filippo.io/edwards25519 v1.1.0 // indirect | ||
| github.com/Azure/azure-sdk-for-go v68.0.0+incompatible // indirect | ||
|
|
@@ -37,26 +38,29 @@ require ( | |
| github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.17 // indirect | ||
| github.com/aws/aws-sdk-go-v2/service/sts v1.41.9 // indirect | ||
| github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect | ||
| github.com/go-sql-driver/mysql v1.8.1 // indirect | ||
| github.com/golang-jwt/jwt/v5 v5.3.0 // indirect | ||
| github.com/go-sql-driver/mysql v1.9.3 // indirect | ||
| github.com/golang-jwt/jwt/v5 v5.3.1 // indirect | ||
| github.com/golang/snappy v1.0.0 // indirect | ||
| github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect | ||
| github.com/jackc/pgpassfile v1.0.0 // indirect | ||
| github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect | ||
| github.com/jackc/pgx/v5 v5.6.0 // indirect | ||
| github.com/jackc/pgx/v5 v5.8.0 // indirect | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical security vulnerabilities in Static analysis has flagged multiple critical CVEs affecting this version:
Even though this is an indirect dependency, these vulnerabilities—particularly the SQL injection vector—pose significant risk to any PostgreSQL-backed storage paths. 🧰 Tools🪛 OSV Scanner (2.3.6)[CRITICAL] 47-47: github.com/jackc/pgx/v5 5.8.0: CVE-2026-33815 in github.com/jackc/pgx (GO-2026-4771) [CRITICAL] 47-47: github.com/jackc/pgx/v5 5.8.0: CVE-2026-33816 in github.com/jackc/pgx (GO-2026-4772) [CRITICAL] 47-47: github.com/jackc/pgx/v5 5.8.0: Memory-safety vulnerability in github.com/jackc/pgx/v5. [CRITICAL] 47-47: github.com/jackc/pgx/v5 5.8.0: pgx: SQL Injection via placeholder confusion with dollar quoted string literals 🤖 Prompt for AI Agents |
||
| github.com/jackc/puddle/v2 v2.2.2 // indirect | ||
| github.com/jinzhu/inflection v1.0.0 // indirect | ||
| github.com/jinzhu/now v1.1.5 // indirect | ||
| github.com/kylelemons/godebug v1.1.0 // indirect | ||
| github.com/mattn/go-sqlite3 v1.14.22 // indirect | ||
| github.com/mattn/go-sqlite3 v1.14.33 // indirect | ||
| github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect | ||
| github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect | ||
| github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect | ||
| github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect | ||
| github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect | ||
| golang.org/x/crypto v0.47.0 // indirect | ||
| golang.org/x/net v0.49.0 // indirect | ||
| golang.org/x/sync v0.19.0 // indirect | ||
| golang.org/x/sys v0.40.0 // indirect | ||
| golang.org/x/text v0.33.0 // indirect | ||
| gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect | ||
| gopkg.in/inf.v0 v0.9.1 // indirect | ||
| ) | ||
|
|
||
| require ( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.