Other DataBase
Default db for
OORisPostgresql, and supportElastic SearchandMySQL.
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
- Only Support client :
@elastic/elasticsearch,mysql2/promise. Elastic Searchhas no PrimaryKey, Some API with byId need argumentDocument._idnotid fieldinsource。Elastic Searchnot support string compartion.oorsupport 3 different datasource in an application. Not support Multi same datasource in an application.