Closed shenghu closed 6 years ago
@Setogit @kjdelisle @jannyHou @dhmlau can you please review this PR?
@raymondfeng @jannyHou , could you please review?
Hi @shenghu I may not have the bandwidth to review it immediately, while will try to finish by the end of this week.
@jannyHou @raymondfeng any chance you can review this pr? :)
Due to https://travis-ci.org/strongloop/loopback-connector-cassandra/jobs/394239529, I remove running test for nodes 4. The dependency now requires strong-globalize@4.1.0 which requires nodes > 6. (Note that this is not introduced by this PR. )
And I think now there is no need to support nodejs 4.
@jannyHou @dhmlau any update or progress?
@shenghu reviewing it :) may take a few hours.
@shenghu BTW, please squash 5 commits to 1 :) thanks.
@jannyHou added nodes 8 and 10 to travis and both passed.
@shenghu Cheers 🎉 Another great feature merged. Thank you!
@dhmlau I don't see version bumped automatically. Is there anything I missed?
I just released it.
Description
We need use Cassandra collections. Current cassandra connector doesn't support to define table using collections, as well as inserting/updating column of collection type. This PR adds capabilities to
cassandra.dataType
is required for cassandra connector to understand what type of cassandra dataType should be used. Ifcassandra.dataType
is not set, cassandra connector will infer cassandra dataType from loopback data type, e.g. String is mapped to TEXT, Array/Object is mapped to TEXT. E.g.data: [String]
is a TEXT in cassandra db, whiledata: { type: [String], cassandra: {dataType: 'Set<Text>'}}
is a Set in cassandra. The reason that Array/Object is not mapped to collection whencassandra.dataType
is not set is because cassandra connector extends SqlConnector which convert Array/Object to string. A lot of tests fromloopback-datasource-juggler/test/common.batch.js
andloopback-datasource-juggler/test/include.test.js
will fail if we change this behavior.Note that: nested collections is not fully supported in this PR. It can be used to define model. But there is error to insert/update it. For now, I don't think nested collection is used frequently. So it can be deferred.
Related issues
Checklist