Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Migrate from gocql v1.x to v2#1321

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
tejaslodayadd wants to merge2 commits intogolang-migrate:master
base:master
Choose a base branch
Loading
fromtejaslodayadd:tl-cassandra-gocql

Conversation

@tejaslodayadd
Copy link

gocql has recently upgraded from v1.x to v2 with some breaking changes.

Upgrade guide:https://github.com/apache/cassandra-gocql-driver/blob/trunk/UPGRADE_GUIDE.md

We'd like to change this and have it as part of golang-migrate/migrate

CopilotAI review requested due to automatic review settingsOctober 21, 2025 23:03
Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the Cassandra driver from the deprecatedgithub.com/gocql/gocql v1.x to the newergithub.com/apache/cassandra-gocql-driver/v2 v2.0.0, following the Apache Cassandra gocql driver upgrade guide.

Key changes:

  • Updated module dependency fromgocql/gocql toapache/cassandra-gocql-driver/v2
  • Replaced import statements across Cassandra database implementation files
  • Updated documentation to reflect protocol version 5 support

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

FileDescription
go.modAdded new v2 driver dependency, removed old gocql dependency and transitive dependencies
database/cassandra/cassandra.goUpdated import to use aliased v2 driver
database/cassandra/cassandra_test.goUpdated imports with proper organization and v2 driver alias
database/cassandra/README.mdUpdated protocol version documentation to include version 5

Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.

Comment on lines -283 to -285
if_,ok:=err.(*gocql.Error);ok {
returndatabase.NilVersion,false,nil
}

Choose a reason for hiding this comment

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

> golangci-lint run ./database/cassandra/...database/cassandra/cassandra.go:283:21: SA1019: gocql.Error is deprecated: Unused (staticcheck)                if _, ok := err.(*gocql.Error); ok {

The code is checking for *gocql.Error which is deprecated in v2. Looking at the context, this check appears to be trying to handle the case where the table doesn't exist yet. However, since ensureVersionTable() is always called before Version() (as seen in line 78-80), the table should already exist, making this check unnecessary.

@coveralls
Copy link

Coverage Status

coverage: 54.057% (+0.02%) from 54.037%
when pullinge623eb5 on tejaslodayadd:tl-cassandra-gocql
into8b9c5f7 on golang-migrate:master.

@tejaslodayadd
Copy link
Author

CC:@dhui pls feel free to leave comments

@tejaslodayadd
Copy link
Author

@dhui any updates on this?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@tejaslodayadd@coveralls

[8]ページ先頭

©2009-2025 Movatter.jp