Updating dependencies
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Fabian Stamm
2020-08-14 11:55:43 +02:00
parent 794820e1d3
commit 5cbc445597
6 changed files with 843 additions and 644 deletions

View File

@ -12,12 +12,15 @@ import {
} from "./query";
import Logging from "@hibas123/nodelogging";
import Session from "./session";
import nanoid = require("nanoid/generate");
import nanoid = require("nanoid");
import { Observable } from "@hibas123/utils";
const ALPHABET =
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
const longNanoId = nanoid.customAlphabet(ALPHABET, 32);
const shortNanoId = nanoid.customAlphabet(ALPHABET, 16);
// interface ITransaction {
// queries: ITypedQuery<IWriteQueries>[];
// }
@ -156,7 +159,7 @@ export class Database {
.then((r) => r.toString())
.catch(resNull);
if (!collectionID && create) {
collectionID = nanoid(ALPHABET, 32);
collectionID = longNanoId();
await this.collections.put(key, collectionID);
setImmediate(() => {
this.collectionChangeListener.send({
@ -329,7 +332,7 @@ export class Database {
const { unsubscribe, value } = await query.snapshot(onchange);
const id = nanoid(ALPHABET, 16);
const id = shortNanoId();
session.subscriptions.set(id, unsubscribe);
return {
id,