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

dash in collection names (2) #3785

Closed
wants to merge 13 commits into from
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,4 @@
"webpack-bundle-analyzer": "4.5.0",
"webpack-cli": "4.9.2"
}
}
}
2 changes: 1 addition & 1 deletion src/rx-database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ export async function removeRxDatabase(
const storageInstance = storage.createStorageInstance<any>(
{
databaseName,
collectionName,
collectionName/* fixed by :colDoc.data.name, */,
schema,
options: {},
multiInstance: false
Expand Down
14 changes: 14 additions & 0 deletions test/unit/rx-database.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,20 @@ config.parallel('rx-database.test.js', () => {
);
assert.strictEqual(pouchPath, 'subfolder/mydb-rxdb-5-humans');
});
it.only('ISSUE - collection name with dashes make it fails', async () => {
const storage = config.storage.getStorage();
const db = await createRxDatabase({
name: randomCouchString(10),
storage,
});
await db.addCollections({
'name_with_a_-_in': { schema: schemas.human },
'name_no_dash': { schema: schemas.human }
});
await db.remove();

//TODO assert that 'name_with_a_-_in' is removed from the storage
});
});

describe('wait a bit', () => {
Expand Down