1
votes

I am trying out Couchbase Lite library, and I am following the steps from:

http://developer.couchbase.com/documentation/mobile/1.1.0/develop/guides/couchbase-lite/native-api/database/index.html

I cannot understand how do I create a local database. No matter what I'm am trying - I get : Message=Invalid database name:

I've tried different approacchies:

DirectoryInfo info = new DirectoryInfo("c:/");
Manager mgr = new Manager(info, ManagerOptions.Default);
var db = mgr.GetDatabase(dbName);

or

var db = Manager.SharedInstance.GetDatabase(dbName);

The GetDatabase documentation:

Returns the Couchbase.Lite.Database with the given name. If the Couchbase.Lite.Database // does not already exist, it is created.

  • C# code examples are not available on the tutorial...

Why it's not working?

2

2 Answers

2
votes

Yes the naming rules are a bit special for Couchbase Lite. The reason is that Couchbase Lite is supported on a wide variety of platforms and not all of them treat casing and special chars the same way.

The naming rules can be found in the documentation here: http://developer.couchbase.com/documentation/mobile/current/develop/guides/couchbase-lite/native-api/database/index.html

The name must consist only of lowercase ASCII letters, digits, and the special characters _$()+-/

0
votes

Ok, I got it - The problem was that I am passing the database name with Capital letter : "Default-database" and apparently Couchbase don't like it. As soon I changed the name to "default-database" everything worked... :)