-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHookConfigTemplate.js
More file actions
55 lines (54 loc) · 1.86 KB
/
HookConfigTemplate.js
File metadata and controls
55 lines (54 loc) · 1.86 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
angular.module('angular-hook-orm')
.factory('HookConfigTemplate', HookConfigTemplate);
function HookConfigTemplate(){
function HookConfigTemplate(){
var c = this;
// What database adapter to use. Check in the adapters folder.
c.adapter = 'PouchDBAdapter';
// Database configuration.
c.database = {
name: 'myDB',
adapter: 'websql',
auto_compaction: true,
revs_limit: 1
};
// Database debug options.
c.db_debug = false;//'pouchdb:find';
// Database connections options. Backup and sync.
c.connections = {
backupDB: {
path:'path/to/backup/db',
options: {
live: true,
retry: true
}
},
syncDB: {
path:'path/to/live/db',
options: {
live: true,
retry: true
}
},
backup_on_destroy: false
};
// Entities configuration
c.entities = {
// The primary key of your entities. '_id' is specific to PouchDB.
key: '_id',
// The name of a column that will hold the table name, the type distinction between your entities.
table: 'table_column_name',
// The name of a column that will hold the entities relations.
relations: 'relations_column_name',
// The name of a column that will hold the entities hooks (think of them as joins).
hooks: 'hooks_column_name',
// The name of a column that will be used to mark the entities as deleted.
deleted: '_deleted'
};
// Entities repositories options
c.repo = {
suffix: 'Repo'
};
}
return HookConfigTemplate;
}