Skip to content

Conversation

@ayashjorden
Copy link

When using scylladb/gocql with upstream Cassandra, the driver queries system_schema.tables to get
table metadata.
When using scylladb/gocql with ScyllaDB, the
driver should also query system_schema.scylla_tables.

Closes #579

@mykaul
Copy link

mykaul commented Sep 29, 2025

Typo: Condtionalty in subject.

Copy link

Copilot AI 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 conditionally queries the scylla_tables system table only when connected to ScyllaDB, improving compatibility when using the gocql driver with upstream Cassandra. Previously, the driver would always attempt to query both system_schema.tables and system_schema.scylla_tables regardless of the database type.

  • Added conditional logic to skip ScyllaDB-specific table queries when connected to Cassandra
  • Updated comment to clarify that scylla_tables is only queried for ScyllaDB connections

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

@ayashjorden ayashjorden force-pushed the feat/conditionnally_query_scaylla branch from b197e53 to 85d3795 Compare September 29, 2025 16:23
@ayashjorden ayashjorden changed the title Condtionalty query scylla_tables for table metadata Conditionally query scylla_tables for table metadata Sep 29, 2025
@ayashjorden
Copy link
Author

@mykaul @dkropachev fixed

@ayashjorden
Copy link
Author

ayashjorden commented Oct 1, 2025

@dkropachev any insight on the failed workflow?

EDIT: found it

github.com/gocql/gocql.(*Conn).getScyllaSupported(...)
	/home/runner/work/gocql/gocql/conn.go:260
github.com/gocql/gocql.(*Conn).isScyllaConn(...)
	/home/runner/work/gocql/gocql/scylla.go:286
github.com/gocql/gocql.getTableMetadata(0xc00019e408, {0xa6401d, 0x6})

EDIT#2: How would I reproduce the error? are there changes required elsewhere in the code?

@sylwiaszunejko
Copy link
Collaborator

@dkropachev any insight on the failed workflow?

EDIT: found it

github.com/gocql/gocql.(*Conn).getScyllaSupported(...)
	/home/runner/work/gocql/gocql/conn.go:260
github.com/gocql/gocql.(*Conn).isScyllaConn(...)
	/home/runner/work/gocql/gocql/scylla.go:286
github.com/gocql/gocql.getTableMetadata(0xc00019e408, {0xa6401d, 0x6})

EDIT#2: How would I reproduce the error? are there changes required elsewhere in the code?

func (s *Session) getConn() *Conn can return nil, you should check if the connection if not nil before calling isScyllaConn

@ayashjorden
Copy link
Author

@dkropachev any insight on the failed workflow?
EDIT: found it

github.com/gocql/gocql.(*Conn).getScyllaSupported(...)
	/home/runner/work/gocql/gocql/conn.go:260
github.com/gocql/gocql.(*Conn).isScyllaConn(...)
	/home/runner/work/gocql/gocql/scylla.go:286
github.com/gocql/gocql.getTableMetadata(0xc00019e408, {0xa6401d, 0x6})

EDIT#2: How would I reproduce the error? are there changes required elsewhere in the code?

func (s *Session) getConn() *Conn can return nil, you should check if the connection if not nil before calling isScyllaConn

Ok, thought there was something else, I'll fix it

@ayashjorden ayashjorden force-pushed the feat/conditionnally_query_scaylla branch from 85d3795 to a977802 Compare October 4, 2025 05:03
When using scylladb/gocql with upstream Cassandra,
the driver queries system_schema.tables to get
table metadata.
When using scylladb/gocql with ScyllaDB, the
driver should also query system_schema.scylla_tables.

Closes scylladb#579
@ayashjorden ayashjorden force-pushed the feat/conditionnally_query_scaylla branch from a977802 to 5934195 Compare October 4, 2025 05:04
@dkropachev dkropachev merged commit eb41747 into scylladb:master Oct 6, 2025
4 checks passed
@ayashjorden ayashjorden deleted the feat/conditionnally_query_scaylla branch October 25, 2025 14:28
@ayashjorden
Copy link
Author

Hi @mykaul , wanted to check in on this, since its merged, when is it going to be released?
I assume that scylla/gocqlx would also need to be updated to use the new condition (among other functionalities that were merged.).

@mykaul
Copy link

mykaul commented Oct 26, 2025

Hi @mykaul , wanted to check in on this, since its merged, when is it going to be released? I assume that scylla/gocqlx would also need to be updated to use the new condition (among other functionalities that were merged.).

I hope soon, since we already have 60 PRs since last release (v1.15.3...master ). I assume we'd want to complete few additional items (#592 for example)

Yes, we always update other projects using our Go driver when we release a new driver.

@dkropachev
Copy link
Collaborator

We will release it soon

@dkropachev
Copy link
Collaborator

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Usage with upstream Cassandra - hardcoded system_schema.scylla_tables

4 participants