How to use the rxdb/plugins/core.create function in rxdb

To help you get started, we’ve selected a few rxdb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pubkey / rxdb / examples / vue / src / services / Database.service.ts View on Github external
async function _create(): Promise {
    console.log('DatabaseService: creating database..');
    const db = await RxDB.create({
        name: 'heroes',
        adapter: useAdapter,
        queryChangeDetection: true
        // password: 'myLongAndStupidPassword' // no password needed
    });
    console.log('DatabaseService: created database');
    (window as any).db = db; // write to window for debugging

    // show leadership in title
    db.waitForLeadership()
        .then(() => {
            console.log('isLeader now');
            document.title = 'â™› ' + document.title;
        });

    // create collections
github johannesjo / super-productivity / src / app / core / rxdb / ngx-rxdb.service.ts View on Github external
async initDb(config: NgxRxdbConfig) {
    console.log('INIT DB');
    try {
      const db: RxDatabase = await RxDB.create({
        ...DEFAULT_CONFIG,
        ...config
      });
      this._dbInstance = db;
      console.log(this.db);
      console.log('RxdbService: created database');
      // also can create collections from root config
      if (config && config.options && config.options.schemas) {
        await this.initCollections(config.options.schemas);
        console.log('RxdbService: created collections bulk');
      }
      console.log(config);

      if (config && config.options && config.options.dumpPath) {
        // fetch dump json
        const dump = await (await fetch(config.options.dumpPath)).json();
github pubkey / rxdb / examples / angular2 / app / src / services / database.service.ts View on Github external
async function _create(): Promise {
    console.log('DatabaseService: creating database..');
    const db = await RxDB.create({
        name: 'heroes',
        adapter: useAdapter,
        queryChangeDetection: true
        // password: 'myLongAndStupidPassword' // no password needed
    });
    console.log('DatabaseService: created database');
    (window as any)['db'] = db; // write to window for debugging

    // show leadership in title
    db.waitForLeadership()
        .then(() => {
            console.log('isLeader now');
            document.title = 'â™› ' + document.title;
        });

    // create collections
github pubkey / rxdb / examples / angular / src / app / services / database.service.ts View on Github external
async function _create(): Promise {

    await loadRxDBPlugins();

    console.log('DatabaseService: creating database..');
    const db = await RxDB.create({
        name: 'angularheroes',
        adapter: 'idb',
        queryChangeDetection: true
        // password: 'myLongAndStupidPassword' // no password needed
    });
    console.log('DatabaseService: created database');
    (window as any)['db'] = db; // write to window for debugging

    // show leadership in title
    db.waitForLeadership()
        .then(() => {
            console.log('isLeader now');
            document.title = 'â™› ' + document.title;
        });

    // create collections
github pubkey / rxdb / examples / graphql / client / index.js View on Github external
async function run() {
    heroesList.innerHTML = 'Create database..';
    const db = await RxDB.create({
        name: getDatabaseName(),
        adapter: 'idb'
    });
    window.db = db;

    // display crown when tab is leader
    db.waitForLeadership().then(function () {
        document.title = 'â™› ' + document.title;
        leaderIcon.style.display = 'block';
    });

    heroesList.innerHTML = 'Create collection..';
    const collection = await db.collection({
        name: 'hero',
        schema: heroSchema
    });

rxdb

A local-first realtime NoSQL Database for JavaScript applications - https://rxdb.info/

Apache-2.0
Latest version published 5 days ago

Package Health Score

86 / 100
Full package analysis