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.
121 122 123 124 125 126 |
# File 'lib/aws-record/record/query.rb', line 121 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.
147 148 149 150 151 152 |
# File 'lib/aws-record/record/query.rb', line 147 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.
63 64 65 66 |
# File 'lib/aws-record/record/query.rb', line 63 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.
101 102 103 104 |
# File 'lib/aws-record/record/query.rb', line 101 def scan(opts = {}) scan_opts = opts.merge(table_name: table_name) ItemCollection.new(:scan, scan_opts, self, dynamodb_client) end |