Configuration
Listed below are all configuration options.
adapter- useful only for the gem developers to switch to a new adapter. Default and the only available value isaws_sdk_v3namespace- prefix for table names, default isdynamoid_#{application_name}_#{environment}for Rails application anddynamoidotherwiselogger- by default it’s aRails.loggerin Rails application andstdoutotherwise. You can disable logging by settingnilorfalsevalues. Settruevalue to use defaultsaccess_key- DynamoDB custom access key for AWS credentials, override global AWS credentials if they’re presentsecret_key- DynamoDB custom secret key for AWS credentials, override global AWS credentials if they’re presentcredentials- DynamoDB custom pre-configured credentials, override global AWS credentials if they’re presentregion- DynamoDB custom credentials for AWS, override global AWS credentials if they’re presentbatch_size- when you try to load multiple items at once withbatch_get_itemcall Dynamoid loads them not with one api call but in chunks. Default is 100 itemscapacity_mode- used at a table creation and means whether a table read/write capacity mode will be on-demand or provisioned. Allowed values are:on_demandand:provisioned. Default value isnilwhich means provisioned mode will be used.read_capacity- is used during table or index creation. Default is 100 (units)write_capacity- is used during table or index creation. Default is 20 (units)warn_on_scan- log warnings when scan table. Default istrueerror_on_scan- raises an error when scan table. Default isfalseendpoint- if provided, it communicates with the DynamoDB listening at the endpoint. This is useful for testing with DynamoDB Localidentity_map- ensures that each object gets loaded only once by keeping every loaded object in a map. Looks up objects using the map when referring to them. Isn’t thread safe. Default isfalse.Use Dynamoid::Middleware::IdentityMapto clear identity map for each HTTP requesttimestamps- by default Dynamoid setscreated_atandupdated_atfields at model creation and updating. You can disable this behavior by settingfalsevaluesync_retry_max_times- when Dynamoid creates or deletes table synchronously it checks for completion specified times. Default is 60 (times). It’s a bit over 2 minutes by defaultsync_retry_wait_seconds- time to wait between retries. Default is 2 (seconds)convert_big_decimal- iftruethen Dynamoid converts numbers stored inHashinrawfield to float. Default isfalsestore_attribute_with_nil_value- iftrueDynamoid keeps attribute withnilvalue in a document. Otherwise Dynamoid removes it while saving a document. Default isnilwhich equals behaviour withfalsevalue.models_dir-dynamoid:create_tablesrake task loads DynamoDB models from this directory. Default is./app/models.application_timezone- Dynamoid converts alldatetimefields to specified time zone when loads data from the storage. Acceptable values -:utc,:local(to use system time zone) and time zone name e.g.Eastern Time (US & Canada). Default isutcdynamodb_timezone- When a datetime field is stored in string format Dynamoid converts it to specified time zone when saves a value to the storage. Acceptable values -:utc,:local(to use system time zone) and time zone name e.g.Eastern Time (US & Canada). Default isutcstore_datetime_as_string- iftruethen Dynamoid stores :datetime fields in ISO 8601 string format. Default isfalsestore_date_as_string- iftruethen Dynamoid stores :date fields in ISO 8601 string format. Default isfalsestore_empty_string_as_nil- store attribute’s empty String value as NULL. Default istruestore_boolean_as_native- iftrueDynamoid stores boolean fields as native DynamoDB boolean values. Otherwise boolean fields are stored as string values't'and'f'. Default istruestore_binary_as_native- iftrueDynamoid stores binary fields as native DynamoDB binary values. Otherwise binary fields are stored as Base64 encoded string values. Default isfalsebackoff- is a hash: key is a backoff strategy (symbol), value is parameters for the strategy. Is used in batch operations. Default idnilbackoff_strategies: is a hash and contains all available strategies. Default is{ constant: ..., exponential: ...}log_formatter: overrides default AWS SDK formatter. There are several canned formatters:Aws::Log::Formatter.default,Aws::Log::Formatter.coloredandAws::Log::Formatter.short. Please look intoAws::Log::FormatterAWS SDK documentation in order to provide own formatter.http_continue_timeout: The number of seconds to wait for a 100-continue HTTP response before sending the request body. Default option value isnil. If not specified effected value is1http_idle_timeout: The number of seconds an HTTP connection is allowed to sit idle before it is considered stale. Default option value isnil. If not specified effected value is5http_open_timeout: The number of seconds to wait when opening a HTTP session. Default option value isnil. If not specified effected value is15http_read_timeout:The number of seconds to wait for HTTP response data. Default option value isnil. If not specified effected value is60create_table_on_save: iftruethen Dynamoid creates a corresponding table in DynamoDB at model persisting if the table doesn’t exist yet. Default istrue