-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdatabase-near-indexer.ts
40 lines (39 loc) · 1.03 KB
/
database-near-indexer.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { registerAs } from '@nestjs/config';
import { SnakeNamingStrategy } from 'typeorm-naming-strategies';
import { NEAR_INDEXER_DB_CONNECTION } from '@sputnik-v2/common';
import {
AccountChange,
ReceiptAction,
Account,
Receipt,
Transaction,
TransactionAction,
ActionReceiptAction,
AssetsNftEvent,
ExecutionOutcome,
Block,
LastBlock,
} from '@sputnik-v2/near-indexer/entities';
export default registerAs(`db_${NEAR_INDEXER_DB_CONNECTION}`, () => ({
type: 'postgres',
host: process.env.NEAR_INDEXER_DATABASE_HOST,
port: parseInt(process.env.NEAR_INDEXER_DATABASE_PORT, 10),
database: process.env.NEAR_INDEXER_DATABASE_NAME,
username: process.env.NEAR_INDEXER_DATABASE_USERNAME,
password: process.env.NEAR_INDEXER_DATABASE_PASSWORD,
entities: [
Account,
Receipt,
ReceiptAction,
Transaction,
TransactionAction,
ActionReceiptAction,
AccountChange,
AssetsNftEvent,
ExecutionOutcome,
Block,
LastBlock,
],
synchronize: false,
namingStrategy: new SnakeNamingStrategy(),
}));