Other DataBase

Default db for OOR is Postgresql, and support Elastic Search and MySQL.

Support can be change the import address:

// Default is Postgresql,  eq with 'oor/pg' (pg required)
import { Table, setup } from 'oor';
// Change to 'oor/es' , switch to  Elastic Search mode (@elastic/elasticsearch required)
import { Table, setup } from 'oor/es';
// Change to 'oor/mysql', switch to  MySql mode (mysql2 required)
import { Table, setup } from 'oor/mysql';

Notice : The Argument provider need diffend param in deffent database type.

Example: in Elastic Search , Will set as

setup({
    provider: {
        node: 'https://localhost:9200',
        auth: { username: 'elastic', password: 'changeme' },
        tls: { rejectUnauthorized: false, }
    },
})

Note

  1. Only Support client : @elastic/elasticsearchmysql2/promise.
  2. Elastic Search has no PrimaryKey, Some API with byId need argument Document._id not id field in source
  3. Elastic Search not support string compartion.
  4. oor support 3 different datasource in an application. Not support Multi same datasource in an application.