How to use the rxdb.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 / test / tutorials / src / server.ts View on Github external
async function run() {


    // create database
    const db = await RxDB.create({
        name: 'mydb',
        adapter: 'memory'
    });

    // create a collection
    const mySchema = {
        version: 0,
        type: 'object',
        properties: {
            key: {
                type: 'string',
                primary: true
            },
            value: {
                type: 'string'
            }
github decentralized-identity / element / packages / element-lib / src / adapters / database / ElementRXDBAdapter.js View on Github external
async _init() {
    // Only create db if it doesnt exist already
    this.db = await RxDB.create({
      name: this.name,
      adapter: this.adapter,
      multiInstance: false,
    });
    this.collection = await this._createCollection();
  }
github eh3rrera / react-rxdb-example / src / App.js View on Github external
async createDatabase() {
    // password must have at least 8 characters
    const db = await RxDB.create(
      {name: dbName, adapter: 'idb', password: '12345678'}
    );
      console.dir(db);

    // show who's the leader in page's title
    db.waitForLeadership().then(() => {
      document.title = 'â™› ' + document.title;
    });

    // create collection
    const messagesCollection = await db.collection({
      name: 'messages',
      schema: schema
    });

    // set up replication
github pathephone / pathephone-desktop / app / api / rxdb.js View on Github external
export const createDb = async (options) => {
  db = await RxDB.create(options)
  window.RxDb = db
}
github waynecz / dadda-translate-crx / src / db / index.ts View on Github external
;(async function() {
  const database: DaddaDatabase = await RxDB.create({
    name: TR_VOCABULARY_STORE_KEY,
    adapter: 'idb',
    multiInstance: true
  })

  database.collection({
    name: 'vocabulary',
    schema: {
      title: 'word',
      version: 0,
      type: 'object',
      properties: {
        text: {
          type: 'string'
        }
      },
github pubkey / rxdb / examples / react-native / App.js View on Github external
async createDatabase() {
        const db = await RxDB.create({
            name: dbName,
            adapter: 'asyncstorage',
            password: 'myLongAndStupidPassword',
            multiInstance: false,
        });
        const heroCollection = await db.collection({
            name: 'heroes',
            schema,
        });
        heroCollection.sync({
            remote: syncURL + dbName + '/',
            options: {
                live: true,
                retry: true,
            },
        });

rxdb

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

Apache-2.0
Latest version published 20 days ago

Package Health Score

80 / 100
Full package analysis