-
Notifications
You must be signed in to change notification settings - Fork 25
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
Support set map value by key and fix dependency #43
base: master
Are you sure you want to change the base?
Conversation
- the template would result in extra space
- #3 - not sure if I can run ccm locally
- when use /usr/local/bin got permission denied ...
- it should be using relops/cqlc, but default travis will be using pingginp/cqlc, that's the problem of enable travis on fork
- it seems 3.11 is invalid for ccm
- generator generates files in /tmp for testing, so need global gocql in $GOPATH to work ...
- generator was comparing type, and due to use vendor and global go path, there will be type mismatch https://travis-ci.org/pingginp/cqlc/builds/428908553
- only support `col[?] = ?`, value binding should work, because there was `WHERE foo in (?,?,?)` so in `Prepare` cqlc would flat the slice before passing to gocql - #2 - [ ] TODO: need to test against a real database to see if it works
- in port mapping, was using 904 instead of 9042 ...
- got "can not marshal []interface {} into map(varchar, varchar)"
- when insert, use SetStringStringMap - when update, SetStringStringMapValue didn't work ... got gocql: expected 3 values send got 2
- BuildStatement is called by Exec, Prepare is called by Fetch, previously flatten is only applied in Prepare
- previous implementation is wrong, it blindly expand all value slice, which would break AppendSlice, now we use struct KeyValue as binding value and expand based on CollectionType and CollectionOperationType
- string map worked fine, not sure about slice though ...
- I don't know if old integration test still work though ....
Reboot - Fix #1 we are now using glide - Fix #2 support set map by key, the generated interface `cqlc/columns.go` is updated, the runtime `BuildStatement` is updated to flatten the `KeyValue` struct to a slice of length 2 - Fix #3 use docker-compose to test locally and on CI, the e2e works because we don't allow parallel and go will run them serial in the order they are defined. Also if the schema is changed, the test need to be run twice and the first one will fail (same as latex bib index), the generated package can only be pick up next time - Fix #5 we now use template in go code using long text - Fix #6 need to set broadcast_address to 127.0.0.1 and avoid typo in port mapping
- similar to #8
- in generated table definitions, was using log.Fatalf, that function returns error, better just return errors.Errorf
- make update-ver
[runtime] Use logrus and remove log.Fatal in generated table definition
@pingginp I don't think Ben is maintaining this repo anymore. Last contribution from him on this repo is from 3 years ago. Seems like you have the latest code with all the fixes. If you're okay with it, users can work of your fork and we can maintain your fork as master until we get access to this repo. |
@vidyavnv hi, are you trying to use cqlc command on cassandra 3? Now (even after my fix) it only works on cassandra 2, it is swallowing errors when generating code. I will spend some time to fix the cassandra 3 issue pingginp#7 . A work around is run a local cassandra 2 to create the same schema and generate the code, it works on cassandra 3. @ddave09 I am maintaining my fork but I don't have plan to actively maintain it, I can make sure it works and fix bugs and release new tags (and go mod etc.), but I won't spend time on adding new features for it, I have to use it at work, that's the only reason I picked it up. |
just an update on this PR, after some fix, the fork now supports Cassandra 3 and works w/ go mod. You can download the generator binary in release page and see the README for how to use the fork for runtime |
This PR fixes #36 and #39 Since the repo has not been maintained for a while I changed the readme and test, if it's possible to get those things merged, I can create a cleaner PR with different readme.
Improvements
Dependencies
pkg/errrors
to preserve context in cqlc runtimeKnow issues
And @0x6e6562 if you no longer have the time to maintain it, is it possible to update the repo doc and point to a maintained fork, thx.