GithubHelp home page GithubHelp logo

cassandra-driver's Introduction

Cassandra Driver

Usage

migrate -url cassandra://host:port/keyspace -path ./db/migrations create add_field_to_table
migrate -url cassandra://host:port/keyspace -path ./db/migrations up
migrate help # for more info

Url format

  • Authentication: cassandra://username:password@host:port/keyspace
  • Cassandra v3.x: cassandra://host:port/keyspace?protocol=4&consistency=all&disable_init_host_lookup

Cassandra in Docker users on a Mac: when using gcql + migrate, use the disable_init_host_lookup option in the connection URL. This will alleviate the issue of gocql trying to connect to internal docker IP addresses.

Authors

cassandra-driver's People

Contributors

gravis avatar josephbuchma avatar n0rmanc avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

cassandra-driver's Issues

db-journey Cassandra driver broken

Hi,

dn-journey Cassandra driver will not compile due to commit 21155bb
line 45: consistency, err := gocql.ParseConsistency(consistencyStr)

gocql.ParseConsistency returns 1 value. this line of code is expecting 2 return values. Exact line of output from the build:
/go/src/github.com/db-journey/cassandra-driver/cassandra.go:45: assignment count mismatch: 2 = 1

Migrate arguments invalid

It looks as though the migrateCommand arguments are not working.

If I send journey --url cassandra://127.0.0.1:9042/keyspace --path ./migrations migrate m -1 it looks as though relativeNInt, err := strconv.Atoi(relativeN) is trying to parse ctx.Args().First(), where the correct argument should be ctx.Args()[2].

So change the following code:

Action: func(ctx *cli.Context) error {
		relativeN := ctx.Args().First()
		relativeNInt, err := strconv.Atoi(relativeN)
		if err != nil {
			logErr(err).Fatal("Unable to parse param <n>")
		}
		log.Infof("Applying %d migrations", relativeNInt)
		pipe := pipep.New()
		go migrate.Migrate(pipe, ctx.GlobalString("url"), ctx.GlobalString("path"), relativeNInt)
		ok := readPipe(pipe)
		if !ok {
			os.Exit(1)
		}
		logCurrentVersion(ctx.GlobalString("url"), ctx.GlobalString("path"))
		return nil
	},

to:

Action: func(ctx *cli.Context) error {
	        relativeN := ctx.Args()[2]
		relativeNInt, err := strconv.Atoi(relativeN)
		if err != nil {
			logErr(err).Fatal("Unable to parse param <n>")
		}
		log.Infof("Applying %d migrations", relativeNInt)
		pipe := pipep.New()
		go migrate.Migrate(pipe, ctx.GlobalString("url"), ctx.GlobalString("path"), relativeNInt)
		ok := readPipe(pipe)
		if !ok {
			os.Exit(1)
		}
		logCurrentVersion(ctx.GlobalString("url"), ctx.GlobalString("path"))
		return nil
	},

goto not working

if I have version 1, 2, 3, 4, 5 (all created in that order), and I am currently at 5. If I use migrate goto 3, it applies the down for all versions.

Possibly tag one commit?

Is there any way you could tag commit 1063bea with a version?

Thanks for all you do. I am hoping to update to the newest versions soon, and will help create more PR's for some bug fixes I have found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.