-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat(source): add scylladb connection #38
Conversation
Add ScyllaDB connection and QueryBuilder
- Added package documentation for scylladb package in sessionx.go, initializedb/init.go, table.go, initializedb/db.go, and querybuilder.go. - Added usage examples and descriptions for each package in the documentation. - Updated function and struct names to follow conventional naming. - Removed unnecessary comments and print statements. Closes feature/source-repository
…1941-9d821ace8654 - Updated golang.org/x/sys dependency to v0.0.0-20211019181941-9d821ace8654. - Added new hash: id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= Issue: #feature/source-repository
Add a new function called CreateKeySpace to the db package in the ScyllaDB initialization module. This function creates a keyspace with the given name using the provided session and executes a CQL statement to create the keyspace if it doesn't already exist. The replication strategy used is 'SimpleStrategy' with a replication factor of 1. Issue: #feature/source-repository
feat(db): add CreateKeySpace function Add a new function called CreateKeySpace to the db package in the ScyllaDB initialization module. This function creates a keyspace with the given name using the provided session and executes a CQL statement to create the keyspace if it doesn't already exist. The replication strategy used is 'SimpleStrategy' with a replication factor of 1. Issue: #feature/source-repository feat(go.sum): update golang.org/x/sys dependency to v0.0.0-20211019181941-9d821ace8654 - Updated golang.org/x/sys dependency to v0.0.0-20211019181941-9d821ace8654. - Added new hash: id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= Issue: #feature/source-repository feat(scylladb): Add package documentation for scylladb package - Added package documentation for scylladb package in sessionx.go, initializedb/init.go, table.go, initializedb/db.go, and querybuilder.go. - Added usage examples and descriptions for each package in the documentation. - Updated function and struct names to follow conventional naming. - Removed unnecessary comments and print statements. Closes feature/source-repository feat(scylladb): add ScyllaDB infrastructure Add ScyllaDB connection and QueryBuilder
…feature/source-repository
@gohossein @AbtinSetyani please review this merge request |
Before the PR is merged, it is necessary for this folder structure to undergo a change. I will make these changes as soon as possible. |
@j3yzz please fix conflicts |
|
||
Note: Make sure to handle errors appropriately when using this package. | ||
*/ | ||
package initializedb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move initialize
file to source/adapter/scylladb
package or rename this package to something like scyllainitialize
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The things you mentioned were added in this PR.
#42
} | ||
|
||
const ( | ||
timeoutCluster = 5 * time.Second |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create Config
struct for scylla and move this const to the struct. You can use this const as fallback(default) value.
Max: maxRetryDelay, | ||
} | ||
cluster.PoolConfig.HostSelectionPolicy = gocql.TokenAwareHostPolicy(gocql.RoundRobinHostPolicy()) | ||
log.Println("cluster was created.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove redundant logs or at least use slog.Debug (the logger package in ormus codebase).
return cluster | ||
} | ||
|
||
func (conn *ScyllaDBConnection) createKeyspace(session scylladb.SessionxInterface, keyspace string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove createKeyspace
method.
) | ||
|
||
type ScyllaDBConnection struct { | ||
consistency gocql.Consistency |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this fields to config struct
} | ||
|
||
func (m *Manager) Run() error { | ||
sourceDriver, err := iofs.New(os.DirFS(m.dir), "migrations") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can embed
migration folder to binary please add embed
statement to migration code.
No description provided.