-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
Cassandra driver #356
Comments
@charyorde Have already seen it a while ago :) I also want to make a public directory where community drivers as well as officially supported drivers are listed. I generally want everything more friendly to new users, first steps taken for the documentation (yes I move again, I move away from readthedocs, because of missing search support for mkdocs which is not likely to be fixed anytime soon readthedocs/readthedocs.org#1487). Keep up the work and let me know if you have some questions, I will be happy to answer. |
I decided to create a new issue for support purposes. As stated above, I'll need extra options passed to the For example, Perhaps, this is what the |
The base api doesn't needs to be adjusted for this, you can always extend and overwrite everything from the base. As soon as you're doing this you will need to document this for your users to make them know of that extended features that are only specific to your driver. I'm not sure if this is something for |
For actions like this, there is very probably a |
Noted. On another note, what triggers the create of migrations table? Is it |
This explains it:
|
Y. Just the up, down and some other functions are creating this table, but not create which creates a boilerplate migration. |
@wzrdtales I can't seem to get the cassandra driver to resolve as expected. Looking at this line , I was expecting it to lookup the NPM module (db-migrate-cql), but I'm getting the The db config file looks like this:
If I reference the driver locally, it works. |
Installing globally resolve this: |
@charyorde This is a configuration schema I am going to deprecate. This circumvents the enforced naming schema. You would configure it like this normally: {
"dev": {
"keyspace": "db_migrate_test",
"user": "cassandra",
"password": "cassandra",
"driver": "cql",
"host": "localhost",
"hosts": ["127.0.0.1"]
},
"sql-file": true
} db-migrate will look for the driver in your local project first and after that search globally for it. |
I also just saw that your driver is another cassandra one, thought it would be the one I already known of :) https://www.npmjs.com/search?q=db-migrate+cassandra Btw. don't forget to add documentation to your driver, so the users now about methods like |
Cool. On |
Principially yes, but currently there are known issues that this does not work yet. |
This one here #338 |
HI @wzrdtales, I did some initial work on getting a Cassandra driver for node-db-migrate. https://github.com/ramakrishnan/db-migrate-cassandra, see if this helps you. |
@wzrdtales , I need some help with getting out of TTY after the db migrate script is done executing. Even though I did implemented the close handler as seen at https://github.com/charyorde/db-migrate-cassandra/blob/master/index.js#L297 , but when the db-migrate script finished executing, it gets stuck at
Any ideas on how to get around this please? |
Sure let me quickly setup a docker env for this. |
@charyorde That error is simple, you're not calling the method to actually close the driver, but you define an event listener. An event that is never going to be called though. Like this, this can't work though: https://github.com/charyorde/db-migrate-cassandra/blob/master/index.js#L298-L300 Here is a working example of how it needs to be done, to say the cassandra-driver docs are pretty incomplete I needed to look the close function up my self by looking into the source ;): close: function(callback) {
return new Promise( function( resolve, reject ) {
this.connection.shutdown(function(err) {
if( err ) {
return reject( err );
}
log.verbose("Cassandra connection closed")
resolve();
});
}.bind(this) )
.nodeify(callback);
} |
Thanks @wzrdtales . Works great. Published a new version with this fix. |
@charyorde Currently cleaning up the issues, I will close here now. Please feel free to hit me up anytime if you've got any questions. |
^^ https://github.com/charyorde/db-migrate-cassandra
Todos
createTable, renameColumn, removeColumn
APIs to be fully Cassandra compatible. Need db-migrate-base to take extra options argument.renameTable
. Currently, renaming a table is not supported in CassandraThe text was updated successfully, but these errors were encountered: