Getting Started
After doing the quick start, you should have a development project which is up and running and connected to your main data storage system.
However, you can plug as many data sources as you want into the same agent.
Forest Admin collections map to any of those concepts:
- Database collections/tables
- ORM models
- Endpoints on SaaS providers (by writing a custom data source)
- Endpoints on your own API (by writing a custom data source)
In this example, we import tables from a PostgreSQL, MariaDB, and Mongo database into Forest Admin.
const { createAgent } = require('@forestadmin/agent');
const { createSqlDataSource } = require('@forestadmin/datasource-sql');
const { createMongooseDataSource } = require('@forestadmin/datasource-mongoose');
// Plug multiple data sources to a single agent.
const agent = createAgent(options)
.addDataSource(
createSqlDataSource('postgres://user:[email protected]:5432/database_name'),
)
.addDataSource(
createSqlDataSource(
'mariadb://user:[email protected]:5432/other_database_name',
),
)
.addDataSource(createMongooseDataSource(require('./mongoose-models')));
Last modified 1mo ago