swift-db-postgres 0.3.1 → 0.3.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 +4 -4
- data/CHANGELOG +4 -0
- data/README.md +16 -13
- data/ext/swift/db/postgres/extconf.rb +4 -0
- data/test/test_adapter.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3acbb4ef1814220888f0e38e28e0c6298a955e7b
|
4
|
+
data.tar.gz: 370402b770e4b496972af96c351e328cc6f6c7c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbb8947e066dd36a0131f6f21f71a6801db3a1c23b7b53201478a95785c21b4ac66fe8a22e0006a6df6391fe9965de380249db935ba50f07504e8b8a8801e3c0
|
7
|
+
data.tar.gz: bb8d61ae2051accc041c378c52ea9405ed88fa2125854be3258ca33b2e58223a9e079aeab7d78100e3d8e82918629a827d802f930026af329bea4bd95372081a
|
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Swift PostgreSQL adapter
|
2
2
|
|
3
|
-
|
3
|
+
PostgreSQL adapter for MRI Ruby.
|
4
|
+
|
5
|
+
NOTE: This has nothing to do with Swift programming language (OSX, iOS)
|
4
6
|
|
5
7
|
## Features
|
6
8
|
|
@@ -159,26 +161,27 @@ db.read(csv)
|
|
159
161
|
|
160
162
|
## Performance
|
161
163
|
|
162
|
-
|
164
|
+
Tests:
|
165
|
+
* Insert 1000 rows
|
166
|
+
* Read them back 100 times with typecast enabled
|
163
167
|
|
164
|
-
|
165
|
-
*
|
168
|
+
Caveats:
|
169
|
+
* This is just a raw performance benchmark, each library has its advantages and disadvantages.
|
166
170
|
|
167
171
|
```
|
168
172
|
$ ruby -v
|
169
|
-
|
170
|
-
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
|
173
|
+
ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]
|
171
174
|
|
172
175
|
$ ruby check.rb
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
+
user system total real
|
177
|
+
swift insert 0.020000 0.000000 0.020000 ( 0.090353)
|
178
|
+
swift select 0.170000 0.000000 0.170000 ( 0.268109)
|
176
179
|
|
177
|
-
|
178
|
-
|
180
|
+
do_postgres insert 0.020000 0.020000 0.040000 ( 0.096619)
|
181
|
+
do_postgres select 0.550000 0.000000 0.550000 ( 0.659646)
|
179
182
|
|
180
|
-
|
181
|
-
|
183
|
+
pg insert 0.020000 0.000000 0.020000 ( 0.069376)
|
184
|
+
pg select 0.680000 0.030000 0.710000 ( 0.819120)
|
182
185
|
```
|
183
186
|
|
184
187
|
## License
|
@@ -22,6 +22,10 @@ lib_paths = %w(
|
|
22
22
|
/sw/lib
|
23
23
|
)
|
24
24
|
|
25
|
+
# add paths for pg_config
|
26
|
+
inc_paths.unshift(%x{pg_config --includedir}.strip) rescue nil
|
27
|
+
lib_paths.unshift(%x{pg_config --libdir}.strip) rescue nil
|
28
|
+
|
25
29
|
uuid_inc, uuid_lib = dir_config('uuid', '/usr/include/uuid', '/usr/lib')
|
26
30
|
libpq_inc, libpq_lib = dir_config('postgresql')
|
27
31
|
|
data/test/test_adapter.rb
CHANGED
@@ -37,7 +37,7 @@ describe 'postgres adapter' do
|
|
37
37
|
row = result.first
|
38
38
|
assert_equal 1, row[:id]
|
39
39
|
assert_equal 'test', row[:name]
|
40
|
-
|
40
|
+
assert_nil row[:age]
|
41
41
|
assert_equal now.to_f.round(3), row[:created_at].to_time.to_f.round(3) # millisecs resolution on postgres
|
42
42
|
|
43
43
|
result = db.execute('delete from users where id = 0')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swift-db-postgres
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bharanee Rathna
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -76,9 +76,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
76
|
version: '0'
|
77
77
|
requirements: []
|
78
78
|
rubyforge_project:
|
79
|
-
rubygems_version: 2.
|
79
|
+
rubygems_version: 2.6.13
|
80
80
|
signing_key:
|
81
81
|
specification_version: 4
|
82
82
|
summary: Swift postgres adapter
|
83
83
|
test_files: []
|
84
|
-
has_rdoc:
|