recordx_sqlite 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 629bf314f8f57718df393bab1a02e5fcf0b105f3
4
- data.tar.gz: 8cf6aa3dec52b3f3563826355f5d4036d81d6d6b
3
+ metadata.gz: 0d43fa3a3d3ec544a14841f54971aa63226b0c34
4
+ data.tar.gz: 994fa803b3ada9d6d4da3702363d75b5d6f90b55
5
5
  SHA512:
6
- metadata.gz: 242b4db12046c61892a20fc7316a1fca7bd3b06219f83d6f470158f6fcc6295944e140b8f8635506c23cff1cad8bcf38c14c19b70e798571c124920e4d4690f9
7
- data.tar.gz: effd34b8ec5c10fba53454ce01b0048f5c0df4bd3eb631867df74cb9c2962b0f659e2a58d0f5e77d266b89405905520ef5c9d0fc42560174761ffe39bad31d5e
6
+ metadata.gz: 07ac1b311e412d966064286d56e39bdcf95813be9cba0c3528f39c2e60572bdb25faffbb76708dd367a9598ef12a96495a21c6ab79a1803800e4c488a8ec2aef
7
+ data.tar.gz: 132384723b69a4ad2cb1b5b863c234455daef4d2845f8a658c2479dfef3cee2f697b2cd77b2a307187d5b9b8dbf0472045eb67bf0fa78b511e4890255d42b058
checksums.yaml.gz.sig CHANGED
Binary file
@@ -19,11 +19,25 @@ class RecordxSqlite
19
19
 
20
20
  end
21
21
 
22
+ # note: when using method all() you will need to execute method refresh()
23
+ # first if a record had recently been added since the recordset was loaded
24
+ #
22
25
  def all()
23
26
  query(@sql) unless @a
24
27
  @a
25
28
  end
26
29
 
30
+ def create(h={})
31
+
32
+ fields = h.keys
33
+ values = h.values
34
+
35
+ sql = "INSERT INTO #{@table} (#{fields.join(', ')})
36
+ VALUES (#{(['?'] * fields.length).join(', ')})"
37
+
38
+ @db.execute(sql, values)
39
+ end
40
+
27
41
  def find(id)
28
42
  query(@sql) unless @a
29
43
  @a.find {|x| x.method(@primary_key).call == id}
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recordx_sqlite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  pewreBQ0QCPuPbV1FPlyX5N5qsGIMHFIYqUlaykOA8156Y6fbIbqQsLwxaSr8WkD
32
32
  eojajR/fTTvliw==
33
33
  -----END CERTIFICATE-----
34
- date: 2016-07-17 00:00:00.000000000 Z
34
+ date: 2017-06-22 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sqlite3
@@ -74,7 +74,7 @@ dependencies:
74
74
  - !ruby/object:Gem::Version
75
75
  version: 0.4.0
76
76
  description:
77
- email: james@r0bertson.co.uk
77
+ email: james@jamesrobertson.eu
78
78
  executables: []
79
79
  extensions: []
80
80
  extra_rdoc_files: []
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  requirements: []
102
102
  rubyforge_project:
103
- rubygems_version: 2.5.1
103
+ rubygems_version: 2.6.8
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: RecordX-SQLite is an object relational mapper primarily designed for updating
metadata.gz.sig CHANGED
@@ -1 +1,2 @@
1
- ����hv�A</98��u(#$x{�/Dg�<��..�i�khи��w8�DO�ث_�)B"G��x�{����c�n�(�Iq$iv/�$ �,=>�^)bZДܱ�A�E�|�]��:��BI��y�՘�7�Q�s( y]UTG��C�T��Z�)�1��X#��[�Ңrk��h3�O��I�u��2�;�+��Z��1j�d�&���¤�{,�BTYT�P,�r�>x2a@r��g�Y�*Xԕj�Ś�G*�c�p}
1
+ ��MeR��A[�*��}���.
2
+ ߵu��*۲