Module: Legion::Data::Settings
- Defined in:
- lib/legion/data/settings.rb
Constant Summary collapse
- CREDS =
{ sqlite: { database: 'legionio.db' }, mysql2: { username: 'legion', password: 'legion', database: 'legionio', host: '127.0.0.1', port: 3306 }, postgres: { user: 'legion', password: 'legion', database: 'legionio', host: '127.0.0.1', port: 5432 } }.freeze
Class Method Summary collapse
- .archival ⇒ Object
- .cache ⇒ Object
- .connection ⇒ Object
- .creds(adapter = nil) ⇒ Object
- .default ⇒ Object
- .local ⇒ Object
- .migrations ⇒ Object
- .models ⇒ Object
Class Method Details
.archival ⇒ Object
85 86 87 88 89 90 91 |
# File 'lib/legion/data/settings.rb', line 85 def self.archival { retention_days: 90, batch_size: 1000, storage_backend: nil } end |
.cache ⇒ Object
93 94 95 96 97 98 99 |
# File 'lib/legion/data/settings.rb', line 93 def self.cache { connected: false, auto_enable: Legion::Settings[:cache][:connected], ttl: 60 } end |
.connection ⇒ Object
69 70 71 72 73 74 75 76 77 78 |
# File 'lib/legion/data/settings.rb', line 69 def self.connection { log: false, log_connection_info: false, log_warn_duration: 1, sql_log_level: 'debug', max_connections: 10, preconnect: false } end |
.creds(adapter = nil) ⇒ Object
80 81 82 83 |
# File 'lib/legion/data/settings.rb', line 80 def self.creds(adapter = nil) adapter = (adapter || :sqlite).to_sym CREDS.fetch(adapter, CREDS[:sqlite]).dup end |
.default ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/legion/data/settings.rb', line 26 def self.default { adapter: 'sqlite', connected: false, cache: cache, connection: connection, creds: creds, migrations: migrations, models: models, local: local, dev_mode: false, dev_fallback: true, connect_on_start: true, read_replica_url: nil, replicas: [], archival: archival } end |
.local ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/legion/data/settings.rb', line 45 def self.local { enabled: true, database: 'legionio_local.db', migrations: { auto_migrate: true } } end |
.migrations ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'lib/legion/data/settings.rb', line 60 def self.migrations { continue_on_fail: false, auto_migrate: true, ran: false, version: nil } end |
.models ⇒ Object
53 54 55 56 57 58 |
# File 'lib/legion/data/settings.rb', line 53 def self.models { continue_on_load_fail: false, autoload: true } end |