Leoric supprts PostgreSQL as well, which can be easily configured as follow:
const Realm = require('leoric');
const realm = new Realm({
dialect: 'postgres',
host: 'localhost',
user: 'test',
database: 'test',
models: 'app/models',
});
await realm.connect();
pg is the default client to access PostgreSQL database, hence we need to add both pg and leoric to package dependencies:
diff --git a/package.json b/package.json
index cf91c34..7ae144d 100644
--- a/package.json
+++ b/package.json
@@ -45,6 +45,8 @@
"dependencies": {
+ "leoric": "^1.10.0",
+ "pg": "^8.5.1",
hostThe host of the database to connect. (Default: localhost)
portThe port of the database to connect. (Default: 5432)
userThe user with enough privilege to access the database.
passwordThe password of the user to authenticate.
databaseThe name of the database to access.