Other DataBase
Default db for
OOR
isPostgresql
, and supportElastic Search
andMySQL
.
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 Search
has no PrimaryKey, Some API with byId need argumentDocument._id
notid field
insource
。Elastic Search
not support string compartion.oor
support 3 different datasource in an application. Not support Multi same datasource in an application.