gocql icon indicating copy to clipboard operation
gocql copied to clipboard

[V2]: List of changes

Open dkropachev opened this issue 1 year ago • 1 comments

Purpose

This issue is here to open discussion for what changes should get into v2

Changes (CONFIRMED)

  1. Change module name to github.com/scylladb/gocql

Changes (PROPESED)

  1. Change package layout

Changes description

Change module name

Change the following in go.mod:

module github.com/gocql/gocql

To

module github.com/scylladb/gocql

As it is established in https://github.com/scylladb/gocql/issues/161 it is a breaking change.

What to do:

  1. Update module name in go.mod to github.com/scylladb/gocql
  2. Change all imports in all the files from github.com/gocql/gocql to github.com/scylladb/gocql
  3. Update examples

Change package layout

Current mostly flat structure creates a problem of dependancy cycles because data structures and interfaces are defined in the same module with code. As result in the gocql module you can't use a code from the other module that returns or consumes types defined in gocql. Example: Say I want to move common_test.go to a testutils package to make test methods public to make it possible to reuse them from different packages. If I do that testutils is going to contain gocql definitions, and therefore can't be used by gocql due to the dependancy cycle.

To solve it we need to evacuate type definitions that have no significant logic (Cluster. Session and Query are definitely do not go anywhere) on them to a separate package, overall package structure can look like this:

types/
testutils/
compression/lz4/
compression/snappy/
scyllacloud/
policies/
internal/

dkropachev avatar Aug 08 '24 12:08 dkropachev