recordx_sqlite 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 59baebb30c9cd64aba4f76710c8d8fa87b2743ef
4
+ data.tar.gz: 989191ef26c9f8d60c204f4824e445cdf238ed7d
5
+ SHA512:
6
+ metadata.gz: 6174b61bad4a453ad5a695034eba8579e843e728bd16bbadfc81324a1a18d431d8df20679727719d18e4fdc9852377d493c003c330fe749bd79664ea343d176b
7
+ data.tar.gz: a1ec5326a9c5b494756c2da4e06605a38eeafa7f379b681dc98fa095b2bae98d6286b2b414b125e9b6135f84e6e887e0d8e5b84d55ae8b15005b6008b18d874a
Binary file
@@ -0,0 +1 @@
1
+ P�s*Z�j~�[D*�&t�ĒrBd���EN�B\-�T)�����?����bO�ϲ����D2S=98Pl|~G�9���Wn�aث>5�LR��.����l��?����u����d5��=%5���j����ۤ��%��ZFችWr-�f{�*/�ɖ�U��+�W��� `U�U���))��bv�;�Ќ�I�0.OH��V�6�0�珚A�q�l���� �z��%�(�Q=�V,�E&�gӿm�������a�~
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: recordx_sqlite.rb
4
+
5
+ require 'sqlite3'
6
+ require 'recordx'
7
+
8
+
9
+ class RecordxSqlite
10
+
11
+ def initialize(dbfile, table)
12
+
13
+ @db = SQLite3::Database.new dbfile
14
+ @db.results_as_hash = true
15
+ rs = @db.query 'select * from ' + table
16
+
17
+ @a = rs.map do |h|
18
+ h2 = h.inject({}) {|r, x| k, v = x; r.merge(k.to_sym => v)}
19
+ RecordX.new(h2, self, h2[:uid])
20
+ end
21
+
22
+ end
23
+
24
+ def all()
25
+ @a
26
+ end
27
+
28
+ def update(id, h={})
29
+
30
+ col, value = h.to_a.first
31
+ return if col == :id
32
+
33
+ s = "
34
+ UPDATE headers
35
+ SET #{col}='#{value}'
36
+ WHERE id='#{id}';"
37
+
38
+ @db.execute(s)
39
+
40
+ end
41
+ end
42
+
43
+
44
+ r = rs.all.first
metadata ADDED
@@ -0,0 +1,108 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: recordx_sqlite
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - James Robertson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
+ YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
+ 8ixkARkWAmV1MB4XDTE2MDcxNjE5MzI1NFoXDTE3MDcxNjE5MzI1NFowSDESMBAG
16
+ A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
+ EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
+ ggEBAMhwmacRvDS0pX630f3U6f/tnOZgD0lcUmwFA2S8n1VS78haGvHWNcORImAk
19
+ AIsqNGxwyGTWpSdhSbQG2ba5rbWvFLo9uj7ZzcKlLZgVSDqAVrwc2ufRgHtvmXgH
20
+ Dgq0xfU2YeESpycbPNlUISIWve/0yMsp0mBFnsvKMC61+9DKk0hk7AeuVPdBlGBs
21
+ sWFfvhRf1cltL51KcXEraYVqzVrkGCzqmeZsLt/cEUPaMGAzmjEpEiJ6V5WJnDvM
22
+ aYf30rfuscwgzoTnHO38dAeN5YHYeOEuhVO+yg8cCvVaAnu3cy0tf0JUVUkFT3te
23
+ j+j42gZ3RS54cuQojjB264CAgB8CAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
24
+ DwQEAwIEsDAdBgNVHQ4EFgQUpLuRFutxyut9ElCr1CZT8o36oxQwJgYDVR0RBB8w
25
+ HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAHkvcYqht
27
+ vcvGnJ+CBzNPjOrppZxHtaoN0YuBvyLGy6iIuo5c1AVdAz7Bzal8A8WoYCtCa715
28
+ k7+ICm2wyrzPjVZgfL/Unw78Dz0SQ8hqqN6vY2mObrULiR+iIK0MoBdORp338UeL
29
+ laeLmZ3XJvjwdZpEN+DMPe2SI6aTCV1xU7xSLpLGkkuynlbfc4BGaO9fli75W0CR
30
+ +zidZ8EDF6H4KWua901gnycLrpnglBIl10DWy7lsaDXm5qtKk0dYO5f677JQZVEU
31
+ pewreBQ0QCPuPbV1FPlyX5N5qsGIMHFIYqUlaykOA8156Y6fbIbqQsLwxaSr8WkD
32
+ eojajR/fTTvliw==
33
+ -----END CERTIFICATE-----
34
+ date: 2016-07-16 00:00:00.000000000 Z
35
+ dependencies:
36
+ - !ruby/object:Gem::Dependency
37
+ name: sqlite3
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '1.3'
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 1.3.11
46
+ type: :runtime
47
+ prerelease: false
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '1.3'
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 1.3.11
56
+ - !ruby/object:Gem::Dependency
57
+ name: recordx
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '0.4'
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: 0.4.0
66
+ type: :runtime
67
+ prerelease: false
68
+ version_requirements: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - "~>"
71
+ - !ruby/object:Gem::Version
72
+ version: '0.4'
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 0.4.0
76
+ description:
77
+ email: james@r0bertson.co.uk
78
+ executables: []
79
+ extensions: []
80
+ extra_rdoc_files: []
81
+ files:
82
+ - lib/recordx_sqlite.rb
83
+ homepage: https://github.com/jrobertson/recordx_sqlite
84
+ licenses:
85
+ - MIT
86
+ metadata: {}
87
+ post_install_message:
88
+ rdoc_options: []
89
+ require_paths:
90
+ - lib
91
+ required_ruby_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ requirements: []
102
+ rubyforge_project:
103
+ rubygems_version: 2.5.1
104
+ signing_key:
105
+ specification_version: 4
106
+ summary: RecordX-SQLite is an object relational mapper primarily designed for updating
107
+ records in bulk.
108
+ test_files: []
@@ -0,0 +1,5 @@
1
+ D�������C�N�˰#;X�#6t�����90���D�A���ӳb.� ��g{@N��c�A$0]f��/��9��v�L��;�so 9��R
2
+ �m�
3
+ 3؄q�d��9�Z\nʓWȏ>m0ν�@
4
+ ������E�`
5
+ �� @^� ׆�1�����<��,�XA-y<���}�_�