Manual Setup
Creating database manually
Sometimes you need to adjust database behavior or settings. If this is your case, you can set everything up manually.
First of all, you need to create a database (more details here). Angular
integration under the hood uses ObjectDataProvider
and subscription to
Database events, not any special state management related adapter. If you want
to use different provider, you can use it normally:
import { createDatabase } from '@rattus-orm/core'
const database = createDatabase({
connection: 'entities',
dataProvider: new MyDataProvider()
}).start()
Then, pass database to module parameters:
import { ApplicationConfig, importProvidersFrom } from '@angular/core';
import { RattusOrmModule } from "@rattus-orm/angular-rxjs";
import { myDatabase } from './myDatabase';
export const appConfig: ApplicationConfig = {
providers: [
// ...
importProvidersFrom(
RattusOrmModule.forRoot({
database: myDatabase,
}),
),
],
};
After that, you can use RattusContextService
as usual: your database is linked to it.