db

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package db contains helper functions for working with Cassandra

Index

Constants

View Source
const CreateKeyspaceCheckAttempts int = 24
View Source
const CreateKeyspaceCheckIntervalSeconds int = 5
View Source
const CreateTableCheckAttempts int = 24
View Source
const CreateTableCheckIntervalSeconds int = 5
View Source
const DeleteKeyspaceCheckAttempts int = 24
View Source
const DeleteKeyspaceCheckIntervalSeconds int = 5
View Source
const ErrorPrefixDb string = "dberror:"

Variables

This section is empty.

Functions

func IsDbConnError

func IsDbConnError(err error) bool

func VerifyAmazonKeyspacesTablesReady added in v1.1.25

func VerifyAmazonKeyspacesTablesReady(cqlSession *gocql.Session, keyspace string, tableNames []string) error

func VerifyKeyspaceDeleted added in v1.1.25

func VerifyKeyspaceDeleted(cqlSession *gocql.Session, keyspace string) error

func WrapDbErrorWithQuery

func WrapDbErrorWithQuery(msg string, query string, dbErr error) error

Types

type CassandraEngineType added in v1.1.25

type CassandraEngineType int
const (
	CassandraEngineNone CassandraEngineType = iota
	CassandraEngineCassandra
	CassandraEngineAmazonKeyspaces
)

func NewSession

func NewSession(envConfig *env.EnvConfig, keyspace string, createKeyspace CreateKeyspaceEnumType) (*gocql.Session, CassandraEngineType, error)

type CreateKeyspaceEnumType

type CreateKeyspaceEnumType int
const CreateKeyspaceOnConnect CreateKeyspaceEnumType = 1
const DoNotCreateKeyspaceOnConnect CreateKeyspaceEnumType = 0

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL