yahoo / squidb

SquiDB is a SQLite database library for Android and iOS
https://github.com/yahoo/squidb/wiki
Apache License 2.0
1.31k stars 132 forks source link

Pre-built artifacts for squidb-jackson-* #136

Closed lpellegr closed 8 years ago

lpellegr commented 8 years ago

It would be really helpful to have pre-built artifacts for squidb-addons with instructions on how to use them. I mean, especially for squidb-jackson-* since others are already available:

https://yahoo.bintray.com/maven/com/yahoo/squidb/

sbosley commented 8 years ago

The squidb-jackson addon is a) somewhat experimental, and b) not a very configurable module, which are the main reasons it's not well documented and why we don't have pre-built artifacts for it -- it's honestly just not super useful in its current form. The basic idea is that it lets you declare columns of Maps or Lists, which will be serialized to JSON strings when using the model getters and setters. However, at the moment it's pretty limited in its capabilities, as it only works on Maps/Lists of primitive types and it hardcodes an object mapper configuration.

If you really want to use the addon as it stands today, you can build it from source and activate the code generation aspects pretty easily, as seen in the example on this wiki page. TestModelSpec in our test package has examples of how to declare List/Map columns, and the testListProperty() test case shows how to use it.

I will also add that as part of our effort on SquiDB 3.0, we've already completely rewritten the squidb-jackson addon as a more generic squidb-json project to address all the shortcomings of the current version. The new version works on arbitrary types (not just Lists/Maps) and is library-agnostic, so you can use jackson/gson/whatever, configured however you like as the serialization engine. It also includes built-in wrappers for using the SQL functions found in the json1 extension on newer versions of SQLite. When 3.0 is stable, we will absolutely be making pre-built artifacts for the new version of the addon and documenting it thoroughly, since it will be much more useful in its rewritten form.

lpellegr commented 8 years ago

@sbosley Thank you for the clarification.

jaredsburrows commented 8 years ago

@sbosley Since there is a squidb-json Can we close this now?

sbosley commented 8 years ago

@jaredsburrows @lpellegr we'll close this issue as soon as we've published a stable version of the artifacts and documented how to use the new extension in the wiki. Probably a week or two away, but it's close!

sbosley commented 8 years ago

Stable versions of the artifacts for squidb-json have just been released! The new addon is documented here.