Start a new topic

Kinvey supports Dash (-) in collection name but not from Android SDK

So I created some collections which have a dash(-) in their name eg "My-Collection-1". Now while I can create these collections from the other APIs, I cant seem to be able to do so from Android client SDK. Digging a bit I found that since android SDK uses Sqlite for local storage and Sqlite is not generally very happy with names having "-", its causing the issue. Is there a way around this?

Hey, thanks for reporting this! Sqlite does have strict naming conventions for databases, which are exposed through the android library. After some investigation, it looks like we can surround table names with `[` and `]`, although the android library does not currently do this.

I will add to the backlog and get a future release out with support for this.
Thanks Ed. So in the interim is there a workaround for this issue. One way would be to export data out of collections with "-" and then import them into new collections without "-". Since there are a ton of these collections, is there a way to do this work using a BL script or something rather than individually do it using Export/Import on each collection manually through the console.
From the console you can rename collections-- visit the "data store" addon:

first select the collection you wish to rename, and then at the top you should see a 'settings' button. Click on that, and it will show a slide-in menu on the left side of the screen. The first item on that menu is collection name, where you can enter a new name and click rename.
Yes, that I know but renaming collections one at a time is going to be painful. There are many many collections with this issue. I was hoping I could write a simple business logic script that would allow me to do a blind iteration over all collections and if the collection has a "-" in its name, rename it by removing the "-". Anyways if there is no scripting option, I have no choice but to rename individually and will get started on that :-)
Login or Signup to post a comment