Module: Aws::Record::Query::QueryClassMethods
- Included in:
- Aws::Record
- Defined in:
- lib/aws-record/record/query.rb
Instance Method Summary collapse
-
#build_query ⇒ Object
This method allows you to build a query using the BuildableSearch DSL.
-
#build_scan ⇒ Object
This method allows you to build a scan using the BuildableSearch DSL.
-
#query(opts) ⇒ Aws::Record::ItemCollection
This method calls Aws::DynamoDB::Client#query, populating the
:table_name
parameter from the model class, and combining this with the other parameters you provide. -
#scan(opts = {}) ⇒ Aws::Record::ItemCollection
This method calls Aws::DynamoDB::Client#scan, populating the
:table_name
parameter from the model class, and combining this with the other parameters you provide.
Instance Method Details
#build_query ⇒ Object
This method allows you to build a query using the BuildableSearch DSL.
110 111 112 113 114 115 |
# File 'lib/aws-record/record/query.rb', line 110 def build_query BuildableSearch.new( operation: :query, model: self ) end |
#build_scan ⇒ Object
This method allows you to build a scan using the BuildableSearch DSL.
136 137 138 139 140 141 |
# File 'lib/aws-record/record/query.rb', line 136 def build_scan BuildableSearch.new( operation: :scan, model: self ) end |
#query(opts) ⇒ Aws::Record::ItemCollection
This method calls Aws::DynamoDB::Client#query, populating the :table_name
parameter from the model class, and combining this with the other parameters you provide.
52 53 54 55 |
# File 'lib/aws-record/record/query.rb', line 52 def query(opts) query_opts = opts.merge(table_name: table_name) ItemCollection.new(:query, query_opts, self, dynamodb_client) end |
#scan(opts = {}) ⇒ Aws::Record::ItemCollection
This method calls Aws::DynamoDB::Client#scan, populating the :table_name
parameter from the model class, and combining this with the other parameters you provide.
90 91 92 93 |
# File 'lib/aws-record/record/query.rb', line 90 def scan(opts = {}) scan_opts = opts.merge(table_name: table_name) ItemCollection.new(:scan, scan_opts, self, dynamodb_client) end |