Skip to content
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

Stay CouchDB-compliant #45

Closed
iMoses opened this issue Jan 31, 2017 · 2 comments
Closed

Stay CouchDB-compliant #45

iMoses opened this issue Jan 31, 2017 · 2 comments

Comments

@iMoses
Copy link

iMoses commented Jan 31, 2017

Currently, when creating a collection the following logic determines the name of the database:

database.prefix + ':RxDB:' + name

This causes a problem when trying to use RxDB with CouchDB, since both uppercase letters and colons are illegal characters for a CouchDB database name.

An example of my use case, when trying to connect to a CouchDB host:

RxDB.create('http://127.0.0.1:5984/db_name', 'http')
    .then(db => db.collection('col_name', schema))

Receives the following response:

{
  "error": "illegal_database_name",
  "reason": "Name: 'db_name:RxDB:col_name'. Only lowercase characters (a-z), digits (0-9), and any of the characters _, $, (, ), +, -, and / are allowed. Must begin with a letter."
}

The solution here is simple, we can change :RxDB: to -rxdb-, but this will probably cause much damage to those who are already using the library.

Or am I misusing the library? :)

@iMoses iMoses changed the title Stay CouchDB-compliant, as PouchDB Stay CouchDB-compliant Jan 31, 2017
@pubkey
Copy link
Owner

pubkey commented Jan 31, 2017

Hi @iMoses
There are currently no tests for the usage of the http-adapter. Therefore I didn't detect that it won't work.
I will add the tests in the near future.
Since we use semver, we can update the library without breaking existing systems.
I will switch RxDB to version 3.x when the branch schemaMigration is ready.
At this time I can change the prefix and also add some checks so it throws when people use an invalid collection-name.

@pubkey
Copy link
Owner

pubkey commented Feb 2, 2017

@iMoses
Fixed with this commit.
Since its a breaking change, it will be published in RxDB v3.0.0.

@pubkey pubkey added DONE and removed TODO 📌 labels Feb 2, 2017
@pubkey pubkey closed this as completed Feb 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants