dynamodb_record 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0019712191d0f7ba069ba581bd04a59a5c9dd985d34bc5f7cb2865f08820ac4
|
4
|
+
data.tar.gz: 02ebcbed904cfeca08deb41a315ea9a018068f1be9747a8e884b289e782a132e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6ea7a0acbdf7f5eaa2ebecd8aef15613fafe0337af8ab67d31b648572ed51cf0b08fd24b06dc137895ebd6f2d6e6789cf942b961e708d5e33c67f32a9bbb27e
|
7
|
+
data.tar.gz: 8cbd27b3dc8a12546aadeeabff96d94a4b8e3a562dbef7f2d980acdf7dea7f73ef863a17c62e4b5e662e7661383f5da59d54dadaad556881d3fcdfcae744e8a5
|
@@ -42,12 +42,14 @@ RSpec.describe DynamodbRecord::Fields do
|
|
42
42
|
field :big_decimal_field, :big_decimal
|
43
43
|
field :datetime_field, :datetime
|
44
44
|
field :boolean_field, :boolean
|
45
|
+
field :array_field, :array
|
45
46
|
end
|
46
47
|
|
47
48
|
expect(Record.new(integer_field: '1').integer_field).to be_a(Integer)
|
48
49
|
expect(Record.new(big_decimal_field: '1').big_decimal_field).to be_a(BigDecimal)
|
49
50
|
expect(Record.new(datetime_field: '2014-12-25T04:08:25Z').datetime_field).to eq(DateTime.parse('2014-12-25T04:08:25Z'))
|
50
51
|
expect(Record.new(boolean_field: 'true').boolean_field).to be_truthy
|
52
|
+
expect(Record.new(array_field: %w[admin assistant]).array_field).to be_truthy
|
51
53
|
end
|
52
54
|
|
53
55
|
it 'coearce field to its data type when calling writer' do
|
@@ -1,6 +1,13 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
RSpec.describe DynamodbRecord::Query, :vcr do
|
4
|
+
describe '#all' do
|
5
|
+
it 'find all records' do
|
6
|
+
user = User.all
|
7
|
+
expect(user.count).to eq(1)
|
8
|
+
expect(user.map(&:id)).to eq(['hguzman20@gmail.com'])
|
9
|
+
end
|
10
|
+
end
|
4
11
|
describe 'querying' do
|
5
12
|
describe '#where' do
|
6
13
|
it 'returns records where user balance = 0' do
|
@@ -0,0 +1,54 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://localhost:8000/
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"TableName":"users"}'
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- ''
|
12
|
+
Content-Type:
|
13
|
+
- application/x-amz-json-1.0
|
14
|
+
X-Amz-Target:
|
15
|
+
- DynamoDB_20120810.Scan
|
16
|
+
User-Agent:
|
17
|
+
- aws-sdk-ruby3/3.191.3 ua/2.0 api/dynamodb#1.105.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
|
18
|
+
md/3.2.3 cfg/retry-mode#legacy
|
19
|
+
Host:
|
20
|
+
- localhost:8000
|
21
|
+
X-Amz-Date:
|
22
|
+
- 20240502T233108Z
|
23
|
+
X-Amz-Content-Sha256:
|
24
|
+
- 4beda0215c9ab83d1b5bba1ba2744d5a230ca7b206aad0ffee3f6bdabcff87c5
|
25
|
+
Authorization:
|
26
|
+
- AWS4-HMAC-SHA256 Credential=key/20240502/us-east-1/dynamodb/aws4_request,
|
27
|
+
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
|
28
|
+
Signature=3c16286960a3799524892b4f88f09834f964adeed8923815f8a6e82884e3ee47
|
29
|
+
Content-Length:
|
30
|
+
- '21'
|
31
|
+
Accept:
|
32
|
+
- "*/*"
|
33
|
+
response:
|
34
|
+
status:
|
35
|
+
code: 200
|
36
|
+
message: OK
|
37
|
+
headers:
|
38
|
+
Date:
|
39
|
+
- Thu, 02 May 2024 23:31:08 GMT
|
40
|
+
X-Amzn-Requestid:
|
41
|
+
- 4379a646-85d4-4f6b-ba53-d7edfabd1ec2
|
42
|
+
Content-Type:
|
43
|
+
- application/x-amz-json-1.0
|
44
|
+
X-Amz-Crc32:
|
45
|
+
- '2922398473'
|
46
|
+
Content-Length:
|
47
|
+
- '111'
|
48
|
+
Server:
|
49
|
+
- Jetty(11.0.17)
|
50
|
+
body:
|
51
|
+
encoding: UTF-8
|
52
|
+
string: '{"Items":[{"balance":{"N":"0"},"token":{"N":"0"},"id":{"S":"hguzman20@gmail.com"}}],"Count":1,"ScannedCount":1}'
|
53
|
+
recorded_at: Thu, 02 May 2024 23:31:08 GMT
|
54
|
+
recorded_with: VCR 6.2.0
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamodb_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henry Guzman
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-05-
|
12
|
+
date: 2024-05-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -197,6 +197,7 @@ files:
|
|
197
197
|
- spec/fixtures/vcr_cassettes/DynamodbRecord_Persistence/does_not_overwrite_existing_record.yml
|
198
198
|
- spec/fixtures/vcr_cassettes/DynamodbRecord_Persistence/saves_record.yml
|
199
199
|
- spec/fixtures/vcr_cassettes/DynamodbRecord_Persistence/updates_record.yml
|
200
|
+
- spec/fixtures/vcr_cassettes/DynamodbRecord_Query/_all/find_all_records.yml
|
200
201
|
- spec/fixtures/vcr_cassettes/DynamodbRecord_Query/querying/_where/returns_records_by_limit.yml
|
201
202
|
- spec/fixtures/vcr_cassettes/DynamodbRecord_Query/querying/_where/returns_records_where_user_balance_0.yml
|
202
203
|
- spec/spec_helper.rb
|
@@ -240,6 +241,7 @@ test_files:
|
|
240
241
|
- spec/fixtures/vcr_cassettes/DynamodbRecord_Persistence/does_not_overwrite_existing_record.yml
|
241
242
|
- spec/fixtures/vcr_cassettes/DynamodbRecord_Persistence/saves_record.yml
|
242
243
|
- spec/fixtures/vcr_cassettes/DynamodbRecord_Persistence/updates_record.yml
|
244
|
+
- spec/fixtures/vcr_cassettes/DynamodbRecord_Query/_all/find_all_records.yml
|
243
245
|
- spec/fixtures/vcr_cassettes/DynamodbRecord_Query/querying/_where/returns_records_by_limit.yml
|
244
246
|
- spec/fixtures/vcr_cassettes/DynamodbRecord_Query/querying/_where/returns_records_where_user_balance_0.yml
|
245
247
|
- spec/spec_helper.rb
|